diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-03-12 04:11:28 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-03-12 04:11:28 +0000 |
commit | 89a52ffd543e3325d236aa876259c6bea8906474 (patch) | |
tree | c432c5d733063d33e649b11176b0662043e1427a | |
parent | 6875f3b6e41d8d3361d71474fa80a54474d5826a (diff) | |
download | libcxx_35a-89a52ffd543e3325d236aa876259c6bea8906474.tar.gz |
build: fix add_definition abuse in CMake
add_definitions is meant for adding C preprocessor definitions. Modern cmake
suggests use of the CMAKE_CXX_FLAGS for the purposes of pushing flags to the
compilation commands. Simply switch to the modern form given that we are
already requiring a new enough cmake.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203637 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index aee36f27..677abaa6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -259,11 +259,14 @@ if (MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS) endif() -add_definitions( - ${LIBCXX_CXX_REQUIRED_FLAGS} - ${LIBCXX_CXX_WARNING_FLAGS} - ${LIBCXX_CXX_FEATURE_FLAGS} - ) +string(REPLACE ";" " " LIBCXX_CXX_REQUIRED_FLAGS "${LIBCXX_CXX_REQUIRED_FLAGS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBCXX_CXX_REQUIRED_FLAGS}") + +string(REPLACE ";" " " LIBCXX_CXX_WARNING_FLAGS "${LIBCXX_CXX_WARNING_FLAGS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBCXX_CXX_WARNING_FLAGS}") + +string(REPLACE ";" " " LIBCXX_CXX_FEATURE_FLAGS "${LIBCXX_CXX_FEATURE_FLAGS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBCXX_CXX_FEATURE_FLAGS}") #=============================================================================== # Setup Source Code |