diff options
author | Brad King <brad.king@kitware.com> | 2008-07-17 19:19:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-07-17 19:19:25 (GMT) |
commit | 129f3bef2d7af0f1c5beec788dc64fcd20b21b0b (patch) | |
tree | fb8a0684c6d0bf3bcc23d2ea3baf55dc93d25374 /Utilities/cmcurl | |
parent | eb8567692872e14ff865b7bb060250f955a2dd03 (diff) | |
download | CMake-129f3bef2d7af0f1c5beec788dc64fcd20b21b0b.zip CMake-129f3bef2d7af0f1c5beec788dc64fcd20b21b0b.tar.gz CMake-129f3bef2d7af0f1c5beec788dc64fcd20b21b0b.tar.bz2 |
COMP: Check for -Wno-long-double before using
Older GCC on the Mac warns for use of long double, so we use
-Wno-long-double. Newer GCC on the Mac does not have this flag and
gives an error. We now check for the flag before using it.
See bug #7357.
Diffstat (limited to 'Utilities/cmcurl')
-rw-r--r-- | Utilities/cmcurl/CMakeLists.txt | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt index 3ed177f..d2f319d 100644 --- a/Utilities/cmcurl/CMakeLists.txt +++ b/Utilities/cmcurl/CMakeLists.txt @@ -675,15 +675,19 @@ ELSE(RETSIGTYPE_TEST) ENDIF(RETSIGTYPE_TEST) IF(CMAKE_COMPILER_IS_GNUCC AND APPLE) - # The Mac version of GCC warns about use of long double. Disable it. - GET_SOURCE_FILE_PROPERTY(MPRINTF_COMPILE_FLAGS mprintf.c COMPILE_FLAGS) - IF(MPRINTF_COMPILE_FLAGS) - SET(MPRINTF_COMPILE_FLAGS "${MPRINTF_COMPILE_FLAGS} -Wno-long-double") - ELSE(MPRINTF_COMPILE_FLAGS) - SET(MPRINTF_COMPILE_FLAGS "-Wno-long-double") - ENDIF(MPRINTF_COMPILE_FLAGS) - SET_SOURCE_FILES_PROPERTIES(mprintf.c PROPERTIES - COMPILE_FLAGS ${MPRINTF_COMPILE_FLAGS}) + INCLUDE(CheckCCompilerFlag) + CHECK_C_COMPILER_FLAG(-Wno-long-double HAVE_C_FLAG_Wno_long_double) + IF(HAVE_C_FLAG_Wno_long_double) + # The Mac version of GCC warns about use of long double. Disable it. + GET_SOURCE_FILE_PROPERTY(MPRINTF_COMPILE_FLAGS mprintf.c COMPILE_FLAGS) + IF(MPRINTF_COMPILE_FLAGS) + SET(MPRINTF_COMPILE_FLAGS "${MPRINTF_COMPILE_FLAGS} -Wno-long-double") + ELSE(MPRINTF_COMPILE_FLAGS) + SET(MPRINTF_COMPILE_FLAGS "-Wno-long-double") + ENDIF(MPRINTF_COMPILE_FLAGS) + SET_SOURCE_FILES_PROPERTIES(mprintf.c PROPERTIES + COMPILE_FLAGS ${MPRINTF_COMPILE_FLAGS}) + ENDIF(HAVE_C_FLAG_Wno_long_double) ENDIF(CMAKE_COMPILER_IS_GNUCC AND APPLE) INCLUDE(CMake/OtherTests.cmake) |