mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 15:45:08 +00:00
Build: update macOS
parent
72c8777796
commit
d217a4d038
41
Build.md
41
Build.md
@ -24,14 +24,6 @@ cmake -H. -BRelease -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/path/to/clan
|
|||||||
cmake --build Release
|
cmake --build Release
|
||||||
```
|
```
|
||||||
|
|
||||||
For mac users with brew
|
|
||||||
```
|
|
||||||
brew info llvm
|
|
||||||
cmake -H. -BRelease -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/usr/local/Cellar/llvm/<Your Version>/lib/cmake
|
|
||||||
cmake --build Release
|
|
||||||
```
|
|
||||||
[source](https://github.com/EOSIO/eos/issues/43)
|
|
||||||
|
|
||||||
As of 2020-06-23 no pre-built binaries exist for Ubuntu 20.04. `sudo apt-get install clang` and all the other dependencies listed here **excluding** rapidjson-dev (it is vendored in this repo), then run
|
As of 2020-06-23 no pre-built binaries exist for Ubuntu 20.04. `sudo apt-get install clang` and all the other dependencies listed here **excluding** rapidjson-dev (it is vendored in this repo), then run
|
||||||
```sh
|
```sh
|
||||||
cmake -H. -BRelease -DCMAKE_BUILD_TYPE=Release \
|
cmake -H. -BRelease -DCMAKE_BUILD_TYPE=Release \
|
||||||
@ -229,7 +221,7 @@ Then installing `libncurses5` with `sudo apt install libncurses5` can fix the pr
|
|||||||
Older versions (6.x) use an older GNU libc which requires
|
Older versions (6.x) use an older GNU libc which requires
|
||||||
`-DCMAKE_CXX_FLAGS=-D__STDC_FORMAT_MACROS`
|
`-DCMAKE_CXX_FLAGS=-D__STDC_FORMAT_MACROS`
|
||||||
|
|
||||||
### MacOS
|
### macOS
|
||||||
|
|
||||||
To install ccls with Homebrew:
|
To install ccls with Homebrew:
|
||||||
```sh
|
```sh
|
||||||
@ -237,25 +229,26 @@ brew update
|
|||||||
brew install ccls
|
brew install ccls
|
||||||
```
|
```
|
||||||
|
|
||||||
To build from source you need MacOS 10.12 (Sierra) or higher to get a version
|
Homebrew clang is a bit different from `/usr/bin/clang`.
|
||||||
of Xcode with a sufficiently-new Clang.
|
Invoke `clang++ -xc++ -fsyntax-only -v /dev/null` to get a list of C/C++ search paths.
|
||||||
|
Add them as `-isystem` into the [shell script wrapper](Install#shell-script-wrapper). For example:
|
||||||
To build using MacPorts Clang add CMake flags
|
|
||||||
```sh
|
|
||||||
-DCMAKE_CXX_COMPILER=clang++-mp-6.0
|
|
||||||
-DCMAKE_PREFIX_PATH=/opt/local/libexec/llvm-6.0
|
|
||||||
```
|
|
||||||
|
|
||||||
See https://github.com/MaskRay/ccls/issues/512 , use a [shell script wrapper](Install#shell-script-wrapper):
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
exec /path/to/ccls/Release/ccls -init='{"clang":{"extraArgs":["-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include"]}}' "$@"
|
exec /opt/homebrew/bin/ccls --init='{"clang":{"extraArgs":[
|
||||||
|
"-isystem/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1",
|
||||||
|
"-isystem/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.5/include",
|
||||||
|
"-isystem/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include",
|
||||||
|
"-isystem/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
|
||||||
|
"-isystem/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks"
|
||||||
|
]}}' "$@"
|
||||||
```
|
```
|
||||||
|
|
||||||
With clang < 8, `"-isystem", "/Library/Developer/CommandLineTools/usr/include/c++/v1"` is also needed (https://github.com/MaskRay/ccls/issues/191#issuecomment-453809905)
|
To build from source:
|
||||||
|
```sh
|
||||||
With most recent MacOSs(e.g. Catalina 10.15.2), one more clang.extraArgs is needed to make ccls work properly (https://github.com/MaskRay/ccls/issues/512#issuecomment-545575369)
|
brew info llvm
|
||||||
|
cmake -H. -BRelease -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/usr/local/Cellar/llvm/<Your Version>/lib/cmake
|
||||||
|
cmake --build Release
|
||||||
|
```
|
||||||
|
|
||||||
### FreeBSD
|
### FreeBSD
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user