diff --git a/.travis.yml b/.travis.yml index 45b41640e..ee8b772c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,11 +20,7 @@ before_install: - brew update - brew upgrade boost; return 0 install: - - brew install llvm - - export CXX=/usr/local/opt/llvm/bin/clang++ - - export LDFLAGS="-L/usr/local/opt/llvm/lib" - - export CPPFLAGS="-I/usr/local/opt/llvm/include" - - brew install yaml-cpp + - brew install llvm yaml-cpp script: - mkdir build - cd build diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c0c91b9a..ff923dfd6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,8 +22,20 @@ endif() include_directories( "/usr/local/include" ) link_directories( "/usr/local/lib" ) -include_directories( "/usr/local/opt/openssl/include" ) -link_directories( "/usr/local/opt/openssl/lib" ) +if(${APPLE}) + include_directories( "/usr/local/opt/openssl/include" ) + link_directories( "/usr/local/opt/openssl/lib" ) + execute_process( + COMMAND bash -c "sw_vers | head -n 2 | tail -n 1 | cut -f 2 | cut -f 2 -d \".\"" + OUTPUT_VARIABLE OSX_VERSION + ) + if(NOT ${OSX_VERSION} EQUAL 14) + message(STATUS "Set to homebrew's llvm") + set(CMAKE_CXX_COMPILER "/usr/local/opt/llvm/bin/clang++") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/local/opt/llvm/include") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/opt/llvm/lib") + endif() +endif() add_executable(${PROJECT_NAME} main.cpp) target_link_libraries(${PROJECT_NAME}