浏览代码

cmConfigure.h: Establish as 'include first' file

At the moment, cmStandardIncludes.h needs to be included before any
standard includes because it disables some warnings that are caused
by the standard library of some compilers.  Move this responsibility
to the cmConfigure.h file.

Also add include guards to cmConfigure.h to make sure the file can be
included multiple times.
Daniel Pfeifer 9 年之前
父节点
当前提交
c3819acad2
共有 2 个文件被更改,包括 17 次插入12 次删除
  1. 17 0
      Source/cmConfigure.cmake.h.in
  2. 0 12
      Source/cmStandardIncludes.h

+ 17 - 0
Source/cmConfigure.cmake.h.in

@@ -9,6 +9,21 @@
   implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the License for more information.
   See the License for more information.
 ============================================================================*/
 ============================================================================*/
+#ifndef cmConfigure_h
+#define cmConfigure_h
+
+#include <cmsys/Configure.hxx>
+
+#ifdef _MSC_VER
+#pragma warning(disable : 4786)
+#pragma warning(disable : 4503)
+#endif
+
+#ifdef __ICL
+#pragma warning(disable : 985)
+#pragma warning(disable : 1572) /* floating-point equality test */
+#endif
+
 #cmakedefine HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE
 #cmakedefine HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE
 #cmakedefine HAVE_UNSETENV
 #cmakedefine HAVE_UNSETENV
 #cmakedefine CMAKE_USE_ELF_PARSER
 #cmakedefine CMAKE_USE_ELF_PARSER
@@ -17,3 +32,5 @@
 #cmakedefine CMake_HAVE_CXX11_UNORDERED_MAP
 #cmakedefine CMake_HAVE_CXX11_UNORDERED_MAP
 #define CMAKE_BIN_DIR "/@CMAKE_BIN_DIR@"
 #define CMAKE_BIN_DIR "/@CMAKE_BIN_DIR@"
 #define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@"
 #define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@"
+
+#endif

+ 0 - 12
Source/cmStandardIncludes.h

@@ -18,18 +18,6 @@
 
 
 #include <cmConfigure.h>
 #include <cmConfigure.h>
 
 
-#include <cmsys/Configure.hxx>
-
-#ifdef _MSC_VER
-#pragma warning(disable : 4786)
-#pragma warning(disable : 4503)
-#endif
-
-#ifdef __ICL
-#pragma warning(disable : 985)
-#pragma warning(disable : 1572) /* floating-point equality test */
-#endif
-
 // Provide fixed-size integer types.
 // Provide fixed-size integer types.
 #include <cm_kwiml.h>
 #include <cm_kwiml.h>