瀏覽代碼

Choose compiler-specific flags earlier in CMake's own build

Add the flags early enough be used in the checks for C++ features.
Brad King 8 年之前
父節點
當前提交
86edc5b6a5
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      CMakeLists.txt

+ 4 - 3
CMakeLists.txt

@@ -63,6 +63,10 @@ if(NOT DEFINED CMAKE_CXX_STANDARD AND NOT CMake_NO_CXX_STANDARD)
   endif()
   endif()
 endif()
 endif()
 if(NOT CMake_TEST_EXTERNAL_CMAKE)
 if(NOT CMake_TEST_EXTERNAL_CMAKE)
+  # include special compile flags for some compilers
+  include(CompileFlags.cmake)
+
+  # check for available C++ features
   include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx_features.cmake)
   include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx_features.cmake)
 endif()
 endif()
 
 
@@ -648,9 +652,6 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
     include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake)
     include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake)
   endif()
   endif()
 
 
-  # include special compile flags for some compilers
-  include(CompileFlags.cmake)
-
   # no clue why we are testing for this here
   # no clue why we are testing for this here
   include(CheckSymbolExists)
   include(CheckSymbolExists)
   CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
   CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)