summaryrefslogtreecommitdiffstats
path: root/config/cmake/HDFMacros.cmake
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2022-08-20 00:18:30 (GMT)
committerGitHub <noreply@github.com>2022-08-20 00:18:30 (GMT)
commit2b786ffe5a189c203530e42ea0edf7b4a0b93c1a (patch)
tree97aece0796f2d41b284603626adfdf851a94330b /config/cmake/HDFMacros.cmake
parent281db5876e5c0b003b59ef86e0bd6b3bbfab1089 (diff)
downloadhdf5-2b786ffe5a189c203530e42ea0edf7b4a0b93c1a.zip
hdf5-2b786ffe5a189c203530e42ea0edf7b4a0b93c1a.tar.gz
hdf5-2b786ffe5a189c203530e42ea0edf7b4a0b93c1a.tar.bz2
[WIP] Add Developer build mode to CMake (#1659)
* Add Developer build mode to CMake * Set a few CMake variables for Developer build modes * Refactor enabling of debug and developer-level compile definitions * Convert cache debugging macros to normal ifdef style Normal ifdef-style instead of if-style allows build system to define macros without warning about redefining macros with different values (0 vs. 1) * Add HDF5 Developer compile definitions to testing files * Temporarily disable -fanalyzer flag for GCC 12+ Developer builds
Diffstat (limited to 'config/cmake/HDFMacros.cmake')
-rw-r--r--config/cmake/HDFMacros.cmake20
1 files changed, 11 insertions, 9 deletions
diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake
index 6f517bd..9d98408 100644
--- a/config/cmake/HDFMacros.cmake
+++ b/config/cmake/HDFMacros.cmake
@@ -34,7 +34,7 @@ macro (SET_HDF_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
- "MinSizeRel" "RelWithDebInfo")
+ "MinSizeRel" "RelWithDebInfo" "Developer")
endif()
endmacro ()
@@ -80,7 +80,7 @@ macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent)
if (${libtype} MATCHES "SHARED")
set (targetfilename $<TARGET_PDB_FILE:${libtarget}>)
else ()
- get_property (target_name TARGET ${libtarget} PROPERTY $<IF:$<CONFIG:Debug>,OUTPUT_NAME_DEBUG,OUTPUT_NAME_RELWITHDEBINFO>)
+ get_property (target_name TARGET ${libtarget} PROPERTY $<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:Developer>>,OUTPUT_NAME_DEBUG,OUTPUT_NAME_RELWITHDEBINFO>)
set (targetfilename $<TARGET_FILE_DIR:${libtarget}>/${target_name}.pdb)
endif ()
install (
@@ -124,6 +124,7 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype)
set_target_properties (${libtarget} PROPERTIES
OUTPUT_NAME ${LIB_RELEASE_NAME}
# OUTPUT_NAME_DEBUG ${LIB_DEBUG_NAME}
+ OUTPUT_NAME_DEVELOPER ${LIB_DEBUG_NAME}
OUTPUT_NAME_RELEASE ${LIB_RELEASE_NAME}
OUTPUT_NAME_MINSIZEREL ${LIB_RELEASE_NAME}
OUTPUT_NAME_RELWITHDEBINFO ${LIB_RELEASE_NAME}
@@ -133,6 +134,7 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype)
if (WIN32)
set_target_properties (${libtarget} PROPERTIES
COMPILE_PDB_NAME_DEBUG ${LIB_DEBUG_NAME}
+ COMPILE_PDB_NAME_DEVELOPER ${LIB_DEBUG_NAME}
COMPILE_PDB_NAME_RELEASE ${LIB_RELEASE_NAME}
COMPILE_PDB_NAME_MINSIZEREL ${LIB_RELEASE_NAME}
COMPILE_PDB_NAME_RELWITHDEBINFO ${LIB_RELEASE_NAME}
@@ -158,7 +160,7 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion)
if (${importtype} MATCHES "IMPORT")
set (importprefix "${CMAKE_STATIC_LIBRARY_PREFIX}")
endif ()
- if (${HDF_CFG_NAME} MATCHES "Debug")
+ if (${HDF_CFG_NAME} MATCHES "Debug" OR ${HDF_CFG_NAME} MATCHES "Developer")
set (IMPORT_LIB_NAME ${LIB_DEBUG_NAME})
else ()
set (IMPORT_LIB_NAME ${LIB_RELEASE_NAME})
@@ -391,12 +393,12 @@ macro (HDF_DIR_PATHS package_prefix)
endif ()
#set the default debug suffix for all library targets
- if(NOT CMAKE_DEBUG_POSTFIX)
- if (WIN32)
- set (CMAKE_DEBUG_POSTFIX "_D")
- else ()
- set (CMAKE_DEBUG_POSTFIX "_debug")
- endif ()
+ if(NOT CMAKE_DEBUG_POSTFIX)
+ if (WIN32)
+ set (CMAKE_DEBUG_POSTFIX "_D")
+ else ()
+ set (CMAKE_DEBUG_POSTFIX "_debug")
+ endif ()
endif ()
SET_HDF_BUILD_TYPE()