11# output generic information about the core and buildtype chosen
22message ("" )
33message ("* TrinityCore revision : ${rev_hash} ${rev_date} (${rev_branch} branch)" )
4- if (NOT ("${CMAKE_GENERATOR} " MATCHES "Visual Studio" OR "${CMAKE_GENERATOR} " STREQUAL "Ninja Multi-Config" ))
4+ get_property (IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
5+ if (NOT IS_MULTI_CONFIG)
56 message ("* TrinityCore buildtype : ${CMAKE_BUILD_TYPE} " )
67endif ()
78message ("" )
@@ -72,7 +73,9 @@ if(WITH_COREDEBUG)
7273 message (" *** -DCMAKE_BUILD_TYPE=RelWithDebInfo" )
7374 message (" *** DO NOT ENABLE IT UNLESS YOU KNOW WHAT YOU'RE DOING!" )
7475 message ("* Use coreside debug : Yes" )
75- add_definitions (-DTRINITY_DEBUG)
76+ target_compile_definitions (trinity-compile-option-interface
77+ INTERFACE
78+ TRINITY_DEBUG)
7679else ()
7780 message ("* Use coreside debug : No (default)" )
7881endif ()
@@ -111,60 +114,70 @@ if(HELGRIND)
111114 message (" *** HELGRIND - WARNING!" )
112115 message (" *** Please specify the valgrind include directory in VALGRIND_INCLUDE_DIR option if you get build errors" )
113116 message (" *** Please note that this is for DEBUGGING WITH HELGRIND only!" )
114- add_definitions (-DHELGRIND)
117+ target_compile_definitions (trinity-compile-option-interface
118+ INTERFACE
119+ HELGRIND)
115120endif ()
116121
117122if (ASAN)
118123 message ("" )
119124 message (" *** ASAN - WARNING!" )
120125 message (" *** Please note that this is for DEBUGGING WITH ADDRESS SANITIZER only!" )
121- add_definitions (-DASAN)
126+ target_compile_definitions (trinity-compile-option-interface
127+ INTERFACE
128+ ASAN)
122129endif ()
123130
124131if (MSAN)
125132 message ("" )
126133 message (" *** MSAN - WARNING!" )
127134 message (" *** Please note that this is for DEBUGGING WITH MEMORY SANITIZER only!" )
128- add_definitions (-DMSAN)
135+ target_compile_definitions (trinity-compile-option-interface
136+ INTERFACE
137+ MSAN)
129138endif ()
130139
131140if (UBSAN)
132141 message ("" )
133142 message (" *** UBSAN - WARNING!" )
134143 message (" *** Please note that this is for DEBUGGING WITH UNDEFINED BEHAVIOR SANITIZER only!" )
135- add_definitions (-DUBSAN)
144+ target_compile_definitions (trinity-compile-option-interface
145+ INTERFACE
146+ UBSAN)
136147endif ()
137148
138149if (TSAN)
139150 message ("" )
140151 message (" *** TSAN - WARNING!" )
141152 message (" *** Please note that this is for DEBUGGING WITH THREAD SANITIZER only!" )
142- add_definitions (-DTSAN -DNO_BUFFERPOOL)
153+ target_compile_definitions (trinity-compile-option-interface
154+ INTERFACE
155+ TSAN)
143156endif ()
144157
145158if (PERFORMANCE_PROFILING)
146159 message ("" )
147160 message (" *** PERFORMANCE_PROFILING - WARNING!" )
148161 message (" *** Please note that this is for PERFORMANCE PROFILING only! Do NOT report any issue when enabling this configuration!" )
149- add_definitions (-DPERFORMANCE_PROFILING)
162+ target_compile_definitions (trinity-compile-option-interface
163+ INTERFACE
164+ PERFORMANCE_PROFILING)
150165endif ()
151166
152167if (WITHOUT_METRICS)
153168 message ("" )
154169 message (" *** WITHOUT_METRICS - WARNING!" )
155170 message (" *** Please note that this will disable all metrics output (i.e. InfluxDB and Grafana)" )
156- add_definitions (-DWITHOUT_METRICS)
171+ target_compile_definitions (trinity-compile-option-interface
172+ INTERFACE
173+ WITHOUT_METRICS)
157174elseif (WITH_DETAILED_METRICS)
158175 message ("" )
159176 message (" *** WITH_DETAILED_METRICS - WARNING!" )
160177 message (" *** Please note that this will enable detailed metrics output (i.e. time each session takes to update)" )
161- add_definitions (-DWITH_DETAILED_METRICS)
162- endif ()
163-
164- if (WITH_BOOST_STACKTRACE)
165- if (BOOST_STACKTRACE_BACKTRACE_INCLUDE_FILE)
166- add_definitions (-DBOOST_STACKTRACE_BACKTRACE_INCLUDE_FILE="${BOOST_STACKTRACE_BACKTRACE_INCLUDE_FILE} " )
167- endif ()
178+ target_compile_definitions (trinity-compile-option-interface
179+ INTERFACE
180+ WITH_DETAILED_METRICS)
168181endif ()
169182
170183if (BUILD_SHARED_LIBS )
@@ -176,7 +189,9 @@ if(BUILD_SHARED_LIBS)
176189 message ("" )
177190 message (" *** Dynamic linking was enforced through a dynamic script module!" )
178191 endif ()
179- add_definitions (-DTRINITY_API_USE_DYNAMIC_LINKING)
192+ target_compile_definitions (trinity-compile-option-interface
193+ INTERFACE
194+ TRINITY_API_USE_DYNAMIC_LINKING)
180195
181196 WarnAboutSpacesInBuildPath()
182197endif ()
0 commit comments