-
-
Notifications
You must be signed in to change notification settings - Fork 763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MACOSX LLVM/Clang的sysroot参数 #1179
Comments
回头我会改进下 |
我现在没装 /Library/Developer/CommandLineTools, 这个目录下的文件列表能给我看下么,看下还有哪些东西。。 ls -l /Library/Developer/CommandLineTools
ls -l /Library/Developer/CommandLineTools/SDKS |
$ /bin/ls -l /Library/Developer/CommandLineTools |
我改进过了,你再试试, xmake update dev
source ~/.xmake/profile |
应该可以了的,不行再开好了 |
1.1 Clang:
$ touch a.cc
$ clang -c -v a.cc 2>&1|rg sysroot
会输出clang自带的sysroot参数,比如我的机器是这样的:
-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
需要编程提取里面的信息。
后面的
SDKS/MacOSX.sdk
看起来是固定的,因此找到前面的/Library/Developer/CommandLineTools
即可。1.2 Clang
$ clang --version
会输出InstalledDir,比如我的机器是
/Library/Developer/CommandLineTools/usr/bin
。2. xcode-select
$ xcode-select -p
会输出类似这样的目录
/Library/Developer/CommandLineTools
用
$(xcode-select -p)/SDKS/MacOSX.sdk
可以当做sysroot的参数。The text was updated successfully, but these errors were encountered: