Get compiling on Mac Mini M1

This commit is contained in:
gingerBill
2021-02-24 23:21:34 +00:00
parent 2d88c6c6a5
commit ba817d153c
4 changed files with 37 additions and 19 deletions
+10 -4
View File
@@ -2,8 +2,9 @@
release_mode=$1
warnings_to_disable="-std=c++11 -Wno-switch -Wno-pointer-sign -Wno-tautological-constant-out-of-range-compare -Wno-tautological-compare -Wno-macro-redefined"
libraries="-pthread -ldl -lm -lstdc++"
warnings_to_disable="-std=c++11 -Wno-switch"
libraries="-pthread -ldl -lm -lstdc++ -lz -lcurses -lxml2"
other_args="-DLLVM_BACKEND_SUPPORT -DUSE_NEW_LLVM_ABI_SYSTEM"
compiler="clang"
@@ -22,10 +23,15 @@ if [[ "$(uname)" == "Darwin" ]]; then
# MacOS provides a symlink to clang called gcc, but it's nice to be explicit here.
compiler="clang"
llvm_config_flags="--cxxflags --ldflags"
# llvm_config_flags="${llvm_config_flags} --link-static"
llvm_config="llvm-config ${llvm_config_flags}"
other_args="${other_args} -liconv"
other_args="${other_args} `${llvm_config}` -lLLVM-C"
elif [[ "$(uname)" == "FreeBSD" ]]; then
compiler="clang"
fi
${compiler} src/main.cpp ${warnings_to_disable} ${libraries} ${other_args} -o odin \
&& ./odin run examples/demo/demo.odin -llvm-api
${compiler} src/main.cpp ${warnings_to_disable} ${libraries} ${other_args} -o odin
# && ./odin run examples/demo/demo.odin -llvm-api