-
Notifications
You must be signed in to change notification settings - Fork 48
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
Building on OS X: LLVM, flags #105
Comments
Well, here we are. My workaround was to utilize environment variables, since string-substitution in the
Hope it helps! |
Hi ,
I'll look into it. I dont have my Macbook with me now, but this afternoon I
should have some time for it..
…On Mon, Feb 4, 2019 at 2:52 AM Ingwie Phoenix ***@***.***> wrote:
Well, here we are.
My workaround was to utilize environment variables, since
string-substitution in the fish shell is not that great. So here is a
direct copy of what I did:
***@***.*** ~/W/g/c/out $ set LLVM_LIBS (/usr/local/opt/llvm/bin/llvm-config --libs)
***@***.*** ~/W/g/c/out $ set LLVM_CFLAGS (/usr/local/opt/llvm/bin/llvm-config --cflags)
***@***.*** ~/W/g/c/out $ set LLVM_CXXFLAGS (/usr/local/opt/llvm/bin/llvm-config --cxxflags)
***@***.*** ~/W/g/c/out $ set LLVM_LDFLAGS (/usr/local/opt/llvm/bin/llvm-config --ldflags)
***@***.*** ~/W/g/c/out $ rm -rf *
***@***.*** ~/W/g/c/out $ cmake .. -G Ninja -DCMAKE_CXX_COMPILER="/usr/local/opt/llvm/bin/clang++" -DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang -DCMAKE_CXX_FLAGS="-I /usr/local/opt/llvm/include -std=c++11 $LLVM_CXXFLAGS" -DCMAKE_EXE_LINKER_FLAGS="$LLVM_LDFLAGS $LLVM_LIBS"
-- The CXX compiler identification is Clang 7.0.1
-- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++
-- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/Ingwie/Work/git/c2compiler/out
***@***.*** ~/W/g/c/out $ ninja
[57/98] Building CXX object c2c/CMakeFiles/c2core.dir/Analyser/FunctionAnalyser.cpp.o
../c2c/Analyser/FunctionAnalyser.cpp:2178:21: warning: variable length arrays are a C99 feature [-Wvla-extension]
char enumHandled[ETD->numConstants()];
^
1 warning generated.
[67/98] Building CXX object c2c/CMakeFiles/c2core.dir/Algo/TagWriter.cpp.o
../c2c/Algo/TagWriter.cpp:197:18: warning: variable length arrays are a C99 feature [-Wvla-extension]
char* offsets[files.size()];
^
1 warning generated.
[92/98] Building CXX object tools/CMakeFiles/tester.dir/tester/main.cpp.o
../tools/tester/main.cpp:1183:29: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual]
char* end = (char*) &target[strlen(target) -1];
^
1 warning generated.
[98/98] Linking CXX executable c2c/c2c
Hope it helps!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#105 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAC1mrxUvIDIvdK8auCOXWVOJzq_bXUpks5vJ5JbgaJpZM4agcKS>
.
|
If you need anything tested on a Mac, feel free to ask. :) Also: Travis offers building on OS X as well. So technically, you can use that too. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wanted to try out c2 and went ahead and tried to build right away. Well, this is unfortunately what happened:
What I had to do beforehand was to install LLVM via Homebrew (
brew install llvm
). Now, what I am guessing is that there are a lot of flags missing, possibly due tollvm-config
not being in my$PATH
by default. I would suggest you to use the LLVM CMake files.Could save you some troubble. :)
I'll try and see if I can find a workaround here. By looking at my CMake invocation above, you can already see a bit of that.
The text was updated successfully, but these errors were encountered: