Index: CMakeLists.txt |
diff --git a/CMakeLists.txt b/CMakeLists.txt |
index f12c5257409d5e1d5e8cdb03c971e8e19c549c03..50c1fa2ce56da2e25ec1d9c430c7c72f01316e15 100644 |
--- a/CMakeLists.txt |
+++ b/CMakeLists.txt |
@@ -95,7 +95,15 @@ set(LIBCXX_COMPILE_FLAGS "") |
set(LIBCXX_LINK_FLAGS "") |
# Configure compiler. |
-include(config-ix) |
+# @LOCALMOD-START Use a custom compiler config because cmake try_compile always |
+# tries to link an executable and linking doesnt work during bootstrap without |
+# libnacl. |
+if (CMAKE_SYSTEM_NAME STREQUAL "nacl") |
+ include(config-ix-pnacl) |
+else() |
+ include(config-ix) |
+endif() |
+# @LOCALMOD-END |
# Configure ABI library |
include(HandleLibCXXABI) |
@@ -240,7 +248,8 @@ if (LIBCXX_BUILT_STANDALONE) |
endif() |
string(REPLACE ";" " " LIBCXX_CXX_FLAGS "${LIBCXX_CXX_FLAGS}") |
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBCXX_CXX_FLAGS}") |
+# @LOCALMOD reverse the order, so that we can override -std=... |
+set(CMAKE_CXX_FLAGS "${LIBCXX_CXX_FLAGS} ${CMAKE_CXX_FLAGS}") |
#=============================================================================== |
# Setup Source Code |