Skip to content

Commit 8ff8bef

Browse files
committed
Add NDEBUG to compile definitions for release and debug configurations in CMake.
1 parent f3f59eb commit 8ff8bef

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,15 @@ if(WIN32)
100100
# The flag JSBSIM_EXPORT must be declared PRIVATE to avoid propagating it
101101
# to other targets such as the executable, the Python module and the unit
102102
# tests. Otherwise the linking of these targets will fail.
103-
target_compile_definitions(libJSBSim PRIVATE JSBSIM_EXPORT)
103+
target_compile_definitions(libJSBSim PRIVATE
104+
JSBSIM_EXPORT
105+
$<$<CONFIG:Release>:NDEBUG>
106+
$<$<CONFIG:RelWithDebInfo>:NDEBUG>)
104107
foreach(TARGET_OBJECT ${TARGET_OBJECTS_LIST})
105-
target_compile_definitions(${TARGET_OBJECT} PRIVATE JSBSIM_EXPORT)
108+
target_compile_definitions(${TARGET_OBJECT} PRIVATE
109+
JSBSIM_EXPORT
110+
$<$<CONFIG:Release>:NDEBUG>
111+
$<$<CONFIG:RelWithDebInfo>:NDEBUG>)
106112
endforeach(TARGET_OBJECT)
107113
else()
108114
list(APPEND MSVC_COMPILE_DEFINITIONS JSBSIM_STATIC_LINK)

0 commit comments

Comments
 (0)