diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2019-09-17 20:43:27 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2019-09-17 20:43:27 (GMT) |
commit | 8e686c8211f837cd57427c46efc06386f156fb92 (patch) | |
tree | bac625513ba96a0ee05b032a2b25caa90eb61eec /config | |
parent | 564d710e93525094f026e1ff859f9efca857e4e0 (diff) | |
download | hdf5-8e686c8211f837cd57427c46efc06386f156fb92.zip hdf5-8e686c8211f837cd57427c46efc06386f156fb92.tar.gz hdf5-8e686c8211f837cd57427c46efc06386f156fb92.tar.bz2 |
Correct HDF5 options to tristate values.
Diffstat (limited to 'config')
-rw-r--r-- | config/cmake/HDFCompilerFlags.cmake | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 37ddcbb..adace89 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -346,10 +346,12 @@ endif () # By default, CMake adds NDEBUG to CMAKE_${lang}_FLAGS for Release build types # This option will force/override the default setting for all configurations #----------------------------------------------------------------------------- -option (HDF5_ENABLE_ASSERTS "Determines whether NDEBUG is defined to control assertions." OFF) -if (HDF5_ENABLE_ASSERTS) +#option (HDF5_ENABLE_ASSERTS "Determines whether NDEBUG is defined to control assertions." OFF) +set (HDF5_ENABLE_ASSERTS "OFF" CACHE STRING "Determines whether NDEBUG is defined to control assertions (OFF NO YES)") +set_property (CACHE HDF5_ENABLE_ASSERTS PROPERTY STRINGS OFF NO YES) +if (HDF5_ENABLE_ASSERTS MATCHES "YES") add_compile_options ("-UNDEBUG") -else () +elseif (HDF5_ENABLE_ASSERTS MATCHES "NO") add_compile_options ("-DNDEBUG") endif () MARK_AS_ADVANCED (HDF5_ENABLE_ASSERTS) @@ -358,8 +360,10 @@ MARK_AS_ADVANCED (HDF5_ENABLE_ASSERTS) # Option for --enable-symbols # This option will force/override the default setting for all configurations #----------------------------------------------------------------------------- -option (HDF5_ENABLE_SYMBOLS "Add debug symbols to the library independent of the build mode and optimization level." OFF) -if (HDF5_ENABLE_SYMBOLS) +#option (HDF5_ENABLE_SYMBOLS "Add debug symbols to the library independent of the build mode and optimization level." OFF) +set (HDF5_ENABLE_SYMBOLS "OFF" CACHE STRING "Add debug symbols to the library independent of the build mode and optimization level (OFF NO YES)") +set_property (CACHE HDF5_ENABLE_SYMBOLS PROPERTY STRINGS OFF NO YES) +if (HDF5_ENABLE_SYMBOLS MATCHES "YES") if (CMAKE_C_COMPILER_ID STREQUAL "Intel") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g") elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") @@ -372,7 +376,7 @@ if (HDF5_ENABLE_SYMBOLS) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") endif () endif () -else () +elseif (HDF5_ENABLE_SYMBOLS MATCHES "NO") if (CMAKE_C_COMPILER_ID STREQUAL "Intel") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-s") elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU") |