From 65385b55e99106604abba7585d2e842f20dd4b30 Mon Sep 17 00:00:00 2001 From: Daniel Patterson Date: Mon, 2 Oct 2017 12:40:31 -0700 Subject: [PATCH] Add include via cmake rather than environment variable - env variable breaks compiler detection. --- .travis.yml | 8 ++++---- CMakeLists.txt | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 625584126..272a4f87b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -187,7 +187,7 @@ matrix: apt: sources: ['ubuntu-toolchain-r-test'] packages: ['libstdc++-4.9-dev'] - env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 CXXFLAGS='-include ../include/util/glibc_workaround.hpp' + env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 install: - pushd ${OSRM_BUILD_DIR} - | @@ -210,7 +210,7 @@ matrix: apt: sources: ['ubuntu-toolchain-r-test'] packages: ['libstdc++-4.9-dev'] - env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 CXXFLAGS='-include ../include/util/glibc_workaround.hpp' + env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 install: - pushd ${OSRM_BUILD_DIR} - | @@ -233,7 +233,7 @@ matrix: apt: sources: ['ubuntu-toolchain-r-test'] packages: ['libstdc++-4.9-dev'] - env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6" CXXFLAGS='-include ../include/util/glibc_workaround.hpp' + env: CLANG_VERSION='4.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6" install: - pushd ${OSRM_BUILD_DIR} - | @@ -256,7 +256,7 @@ matrix: apt: sources: ['ubuntu-toolchain-r-test'] packages: ['libstdc++-4.9-dev'] - env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6" CXXFLAGS='-include ../include/util/glibc_workaround.hpp' + env: CLANG_VERSION='4.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="6" install: - pushd ${OSRM_BUILD_DIR} - | diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d5912bf8..1f50c3cf2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -402,6 +402,8 @@ endif() if(UNIX AND NOT APPLE) set(MAYBE_RT_LIBRARY -lrt) + # TODO: print some warnings, or make this test a bit more detailed + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include ${CMAKE_CURRENT_SOURCE_DIR}/include/util/glibc_workaround.hpp") endif() # Disallow deprecated protozero APIs