| OLD | NEW |
| 1 # See www/CMake.html for instructions on how to build libcxx with CMake. | 1 # See www/CMake.html for instructions on how to build libcxx with CMake. |
| 2 | 2 |
| 3 #=============================================================================== | 3 #=============================================================================== |
| 4 # Setup Project | 4 # Setup Project |
| 5 #=============================================================================== | 5 #=============================================================================== |
| 6 | 6 |
| 7 project(libcxx CXX C) | 7 project(libcxx CXX C) |
| 8 cmake_minimum_required(VERSION 2.8) | 8 cmake_minimum_required(VERSION 2.8) |
| 9 | 9 |
| 10 set(PACKAGE_NAME libcxx) | 10 set(PACKAGE_NAME libcxx) |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 # Declare libc++ configuration variables. | 88 # Declare libc++ configuration variables. |
| 89 # They are intended for use as follows: | 89 # They are intended for use as follows: |
| 90 # LIBCXX_CXX_FLAGS: General flags for both the compiler and linker. | 90 # LIBCXX_CXX_FLAGS: General flags for both the compiler and linker. |
| 91 # LIBCXX_COMPILE_FLAGS: Compile only flags. | 91 # LIBCXX_COMPILE_FLAGS: Compile only flags. |
| 92 # LIBCXX_LINK_FLAGS: Linker only flags. | 92 # LIBCXX_LINK_FLAGS: Linker only flags. |
| 93 set(LIBCXX_CXX_FLAGS "") | 93 set(LIBCXX_CXX_FLAGS "") |
| 94 set(LIBCXX_COMPILE_FLAGS "") | 94 set(LIBCXX_COMPILE_FLAGS "") |
| 95 set(LIBCXX_LINK_FLAGS "") | 95 set(LIBCXX_LINK_FLAGS "") |
| 96 | 96 |
| 97 # Configure compiler. | 97 # Configure compiler. |
| 98 include(config-ix) | 98 # @LOCALMOD-START Use a custom compiler config because cmake try_compile always |
| 99 # tries to link an executable and linking doesnt work during bootstrap without |
| 100 # libnacl. |
| 101 if (CMAKE_SYSTEM_NAME STREQUAL "nacl") |
| 102 include(config-ix-pnacl) |
| 103 else() |
| 104 include(config-ix) |
| 105 endif() |
| 106 # @LOCALMOD-END |
| 99 # Configure ABI library | 107 # Configure ABI library |
| 100 include(HandleLibCXXABI) | 108 include(HandleLibCXXABI) |
| 101 | 109 |
| 102 #=============================================================================== | 110 #=============================================================================== |
| 103 # Setup Compiler Flags | 111 # Setup Compiler Flags |
| 104 #=============================================================================== | 112 #=============================================================================== |
| 105 | 113 |
| 106 # Get required flags. | 114 # Get required flags. |
| 107 # On all systems the system c++ standard library headers need to be excluded. | 115 # On all systems the system c++ standard library headers need to be excluded. |
| 108 if (MSVC) | 116 if (MSVC) |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 list(APPEND LIBCXX_CXX_FLAGS "-fsanitize=thread") | 241 list(APPEND LIBCXX_CXX_FLAGS "-fsanitize=thread") |
| 234 else() | 242 else() |
| 235 message(WARNING "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANIT
IZER}") | 243 message(WARNING "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANIT
IZER}") |
| 236 endif() | 244 endif() |
| 237 elseif(MSVC) | 245 elseif(MSVC) |
| 238 message(WARNING "LLVM_USE_SANITIZER is not supported with MSVC") | 246 message(WARNING "LLVM_USE_SANITIZER is not supported with MSVC") |
| 239 endif() | 247 endif() |
| 240 endif() | 248 endif() |
| 241 | 249 |
| 242 string(REPLACE ";" " " LIBCXX_CXX_FLAGS "${LIBCXX_CXX_FLAGS}") | 250 string(REPLACE ";" " " LIBCXX_CXX_FLAGS "${LIBCXX_CXX_FLAGS}") |
| 243 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBCXX_CXX_FLAGS}") | 251 # @LOCALMOD reverse the order, so that we can override -std=... |
| 252 set(CMAKE_CXX_FLAGS "${LIBCXX_CXX_FLAGS} ${CMAKE_CXX_FLAGS}") |
| 244 | 253 |
| 245 #=============================================================================== | 254 #=============================================================================== |
| 246 # Setup Source Code | 255 # Setup Source Code |
| 247 #=============================================================================== | 256 #=============================================================================== |
| 248 | 257 |
| 249 include_directories(include) | 258 include_directories(include) |
| 250 add_subdirectory(include) | 259 add_subdirectory(include) |
| 251 | 260 |
| 252 # Add source code. This also contains all of the logic for deciding linker flags | 261 # Add source code. This also contains all of the logic for deciding linker flags |
| 253 # soname, etc... | 262 # soname, etc... |
| 254 add_subdirectory(lib) | 263 add_subdirectory(lib) |
| 255 | 264 |
| 256 #=============================================================================== | 265 #=============================================================================== |
| 257 # Setup Tests | 266 # Setup Tests |
| 258 #=============================================================================== | 267 #=============================================================================== |
| 259 | 268 |
| 260 add_subdirectory(test) | 269 add_subdirectory(test) |
| OLD | NEW |