summaryrefslogtreecommitdiffstats
path: root/libcxx/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/CMakeLists.txt')
-rw-r--r--libcxx/CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index 99a4a33f5f3..51d9958a207 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -57,6 +57,8 @@ option(LIBCXX_ENABLE_MONOTONIC_CLOCK
This option may only be used when LIBCXX_ENABLE_THREADS=OFF." ON)
option(LIBCXX_INSTALL_HEADERS "Install the libc++ headers." ON)
option(LIBCXX_INSTALL_SUPPORT_HEADERS "Install libc++ support headers." ON)
+set(LIBCXX_SYSROOT "" CACHE STRING "Use alternate sysroot.")
+set(LIBCXX_GCC_TOOLCHAIN "" CACHE STRING "Use alternate GCC toolchain.")
if (LIBCXX_BUILT_STANDALONE)
set(LLVM_USE_SANITIZER "" CACHE STRING
"Define the sanitizer used to build the library and tests")
@@ -277,6 +279,11 @@ if (LIBCXX_BUILT_STANDALONE)
endif()
endif()
+list(APPEND LIBCXX_CXX_FLAGS "-target ${LIBCXX_TARGET_TRIPLE}")
+append_if(LIBCXX_CXX_FLAGS LIBCXX_SYSROOT "--sysroot ${LIBCXX_SYSROOT}")
+append_if(LIBCXX_CXX_FLAGS LIBCXX_GCC_TOOLCHAIN
+ "-gcc-toolchain ${LIBCXX_GCC_TOOLCHAIN}")
+
string(REPLACE ";" " " LIBCXX_CXX_FLAGS "${LIBCXX_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBCXX_CXX_FLAGS}")
OpenPOWER on IntegriCloud