diff options
author | Brad King <brad.king@kitware.com> | 2012-05-02 12:46:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-05-02 12:46:10 (GMT) |
commit | 221b5b697734dec909964bdba50c2e7004184539 (patch) | |
tree | cb2052078241ec50d837626b3936fd4fef95ada2 /Source/kwsys/CMakeLists.txt | |
parent | 3817314e2a7d83b70a8d0ced189781f676db844c (diff) | |
download | CMake-221b5b697734dec909964bdba50c2e7004184539.zip CMake-221b5b697734dec909964bdba50c2e7004184539.tar.gz CMake-221b5b697734dec909964bdba50c2e7004184539.tar.bz2 |
KWSys: Remove dependencies on FundamentalType
The hash_fun.hxx header is configured whether FundamentalType is enabled
or not and so cannot depend on it. Run the relevant platform tests
whether or not FundamentalType is on and configure the result directly
into hash_fun. While at it, remove the dependence of SystemInformation
on FundamentalType too since it needs only information that we now
always compute.
Diffstat (limited to 'Source/kwsys/CMakeLists.txt')
-rw-r--r-- | Source/kwsys/CMakeLists.txt | 70 |
1 files changed, 39 insertions, 31 deletions
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index 520cafb..a132357 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -141,7 +141,6 @@ IF(KWSYS_USE_Process) SET(KWSYS_USE_System 1) ENDIF(KWSYS_USE_Process) IF(KWSYS_USE_SystemInformation) - SET(KWSYS_USE_FundamentalType 1) SET(KWSYS_USE_Process 1) ENDIF(KWSYS_USE_SystemInformation) @@ -413,6 +412,39 @@ IF(UNIX) "Checking whether struct stat has st_mtim member" DIRECT) ENDIF(UNIX) +# Check existence and uniqueness of long long and __int64. +KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_LONG_LONG + "Checking whether C++ compiler has 'long long'" DIRECT) +KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS___INT64 + "Checking whether C++ compiler has '__int64'" DIRECT) +IF(KWSYS_CXX_HAS___INT64) + KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_SAME_LONG_AND___INT64 + "Checking whether long and __int64 are the same type" DIRECT) + IF(KWSYS_CXX_HAS_LONG_LONG) + KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_SAME_LONG_LONG_AND___INT64 + "Checking whether long long and __int64 are the same type" DIRECT) + ENDIF() +ENDIF() + +# Enable the "long long" type if it is available. It is standard in +# C99 and C++03 but not in earlier standards. +IF(KWSYS_CXX_HAS_LONG_LONG) + SET(KWSYS_USE_LONG_LONG 1) +ELSE() + SET(KWSYS_USE_LONG_LONG 0) +ENDIF() + +# Enable the "__int64" type if it is available and unique. It is not +# standard. +SET(KWSYS_USE___INT64 0) +IF(KWSYS_CXX_HAS___INT64) + IF(NOT KWSYS_CXX_SAME_LONG_AND___INT64) + IF(NOT KWSYS_CXX_SAME_LONG_LONG_AND___INT64) + SET(KWSYS_USE___INT64 1) + ENDIF() + ENDIF() +ENDIF() + IF(KWSYS_USE_FundamentalType) # Look for type size helper macros. KWSYS_PLATFORM_INFO_TEST(C KWSYS_C_TYPE_MACROS @@ -463,34 +495,6 @@ IF(KWSYS_USE_FundamentalType) ENDIF() ENDFOREACH() - # Check uniqueness of types. - IF(KWSYS_SIZEOF___INT64) - KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_SAME_LONG_AND___INT64 - "Checking whether long and __int64 are the same type" DIRECT) - IF(KWSYS_SIZEOF_LONG_LONG) - KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_SAME_LONG_LONG_AND___INT64 - "Checking whether long long and __int64 are the same type" DIRECT) - ENDIF(KWSYS_SIZEOF_LONG_LONG) - ENDIF(KWSYS_SIZEOF___INT64) - - # Enable the "long long" type if it is available. It is standard in - # C99 and C++03 but not in earlier standards. - IF(KWSYS_SIZEOF_LONG_LONG) - SET(KWSYS_USE_LONG_LONG 1) - ELSE(KWSYS_SIZEOF_LONG_LONG) - SET(KWSYS_USE_LONG_LONG 0) - ENDIF(KWSYS_SIZEOF_LONG_LONG) - - # Enable the "__int64" type if it is available and unique. It is not - # standard. - SET(KWSYS_USE___INT64 0) - IF(KWSYS_SIZEOF___INT64) - IF(NOT KWSYS_CXX_SAME_LONG_AND___INT64) - IF(NOT KWSYS_CXX_SAME_LONG_LONG_AND___INT64) - SET(KWSYS_USE___INT64 1) - ENDIF(NOT KWSYS_CXX_SAME_LONG_LONG_AND___INT64) - ENDIF(NOT KWSYS_CXX_SAME_LONG_AND___INT64) - ENDIF(KWSYS_SIZEOF___INT64) IF(KWSYS_USE___INT64) KWSYS_PLATFORM_CXX_TEST(KWSYS_CAN_CONVERT_UI64_TO_DOUBLE "Checking whether unsigned __int64 can convert to double" DIRECT) @@ -505,8 +509,6 @@ ENDIF(KWSYS_USE_FundamentalType) IF(KWSYS_USE_IOStream) # Determine whether iostreams support long long. - KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_LONG_LONG - "Checking whether C++ compiler has 'long long'" DIRECT) IF(KWSYS_CXX_HAS_LONG_LONG) SET(KWSYS_PLATFORM_CXX_TEST_DEFINES -DKWSYS_IOS_USE_ANSI=${KWSYS_IOS_USE_ANSI} @@ -563,6 +565,12 @@ IF(KWSYS_USE_SystemTools) COMPILE_FLAGS "-DKWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV} -DKWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV} -DKWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H}") ENDIF() +IF(KWSYS_USE_SystemInformation) + SET_PROPERTY(SOURCE SystemInformation.cxx PROPERTY + COMPILE_DEFINITIONS KWSYS_USE_LONG_LONG=${KWSYS_USE_LONG_LONG} + KWSYS_USE___INT64=${KWSYS_USE___INT64}) +ENDIF() + #----------------------------------------------------------------------------- # Choose a directory for the generated headers. IF(NOT KWSYS_HEADER_ROOT) |