@@ -193,6 +193,10 @@ add_compile_options(-Werror -Wall -Wextra)
193
193
#this will generate a warning but it will build successfully
194
194
#do not need unit_test paramfiles when unit_test is not built
195
195
196
+ if (BUILD_UNIT_TEST_PC AND BUILD_UNIT_TEST_MC)
197
+ message (FATAL_ERROR "Cannot build both primordial chem and metal chem tests at the same time!" )
198
+ endif ()
199
+
196
200
if (BUILD_UNIT_TEST_PC)
197
201
#Build primordial chem unit test
198
202
setup_target_for_microphysics_compilation("primordial_chem" ${CMAKE_BINARY_DIR} )
@@ -201,24 +205,15 @@ if(BUILD_UNIT_TEST_PC)
201
205
#adding unit_tests as subdirectories
202
206
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /unit_test)
203
207
204
- else ()
205
-
206
- message ("Not building primordial chem unit test" )
207
- endif ()
208
-
209
-
210
- if (BUILD_UNIT_TEST_MC)
208
+ elseif (BUILD_UNIT_TEST_MC)
211
209
#Build metal chem unit test
212
210
setup_target_for_microphysics_compilation("metal_chem" ${CMAKE_BINARY_DIR} )
213
211
include_directories (${metal_chem_dirs} )
214
212
215
- #adding unit_tests as subdirectories (only needed if PC test wasn't built above)
216
- if (!BUILD_UNIT_TEST_PC)
217
- add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /unit_test)
218
- endif ()
219
- else ()
213
+ #adding unit_tests as subdirectories
214
+ add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /unit_test)
220
215
221
- message ("Not building metal chem unit test" )
216
+ message ("Not building primordial chem unit test" )
222
217
endif ()
223
218
224
219
#Sample command: cmake .. -DBUILD_UNIT_TEST_MC=True -DBUILD_AMReX=True -DAMReX_SPACEDIM=1
0 commit comments