diff --git a/CMakeModules/CorsikaUtilities.cmake b/CMakeModules/CorsikaUtilities.cmake index 5d6fb773eb6c2b96823e198cf309668fdd9a6a2e..ad853b8d1c5c48c94761c7edbcaccbf25427ca45 100644 --- a/CMakeModules/CorsikaUtilities.cmake +++ b/CMakeModules/CorsikaUtilities.cmake @@ -101,24 +101,30 @@ endmacro(CORSIKA_ADD_FILES_ABSOLUTE) # Pass the name of the test.cc file as the first # argument, without the ".cc" extention. # -# Example: CORSIKA_ADD_TEST(testSomething) -# (generates target testSomething from file testSomething.cc) +# Example: CORSIKA_ADD_TEST (testSomething) # -# 2) Customize sources +# This generates target testSomething from file testSomething.cc. +# +# 2) Customize sources: # If 1) doesn't work, use the SOURCES keyword to explicitly # specify the sources. # -# Example: CORSIKA_ADD_TEST(testSomething SOURCES source1.cc source2.cc someheader.h) +# Example: CORSIKA_ADD_TEST (testSomething +# SOURCES source1.cc source2.cc someheader.h) # -# 3) Customize sanitizers +# 3) Customize sanitizers: # You can override which sanitizers are compiled into the # test, but only do this if the defaults do not work. # -# Example: CORSIKA_ADD_TEST(testSomething SANITIZE undefined) -# (only uses the sanitizer for undefined behavior) +# Example: CORSIKA_ADD_TEST (testSomething SANITIZE undefined) +# +# Only uses the sanitizer for undefined behavior. # # In all cases, you can further customize the target with # target_link_libraries(testSomething ...) and so on. +# +# TEMPORARY: All sanitizers are currently globally disabled by default, to enable them, +# set CORSIKA_SANITIZERS_ENABLED to TRUE. function (CORSIKA_ADD_TEST) cmake_parse_arguments(PARSE_ARGV 1 _ "" "SANITIZE" "SOURCES") diff --git a/Documentation/Examples/CMakeLists.txt b/Documentation/Examples/CMakeLists.txt index 80855d599e6f7ca6942ad1b7a04cf21d0218fe50..99808260eebe0025bd632ee87de45d983e2be7da 100644 --- a/Documentation/Examples/CMakeLists.txt +++ b/Documentation/Examples/CMakeLists.txt @@ -14,8 +14,11 @@ CORSIKA_ADD_TEST (stack_example) target_link_libraries (stack_example SuperStupidStack CORSIKAunits CORSIKAlogging) -CORSIKA_ADD_TEST (cascade_example) -target_link_libraries (cascade_example SuperStupidStack CORSIKAunits +# address sanitizer is making this example too slow, so we only do "undefined" +CORSIKA_ADD_TEST (cascade_example SANITIZE "undefined") +target_link_libraries (cascade_example + SuperStupidStack + CORSIKAunits CORSIKAlogging CORSIKArandom ProcessSibyll @@ -34,30 +37,11 @@ target_link_libraries (cascade_example SuperStupidStack CORSIKAunits ) install (TARGETS cascade_example DESTINATION share/examples) -if (Pythia8_FOUND) - # address sanitizer is making this example too slow, so we only do "undefined" - CORSIKA_ADD_TEST (cascade_example SANITIZE "undefined") - target_link_libraries (cascade_example SuperStupidStack CORSIKAunits - CORSIKAlogging - CORSIKArandom - ProcessSibyll - CORSIKAcascade - ProcessEnergyLoss - ProcessStackInspector - ProcessTrackWriter - ProcessTrackingLine - CORSIKAprocesses - CORSIKAcascade - CORSIKAparticles - CORSIKAgeometry - CORSIKAenvironment - CORSIKAprocesssequence - ) - install (TARGETS cascade_example DESTINATION share/examples) -endif() - CORSIKA_ADD_TEST (boundary_example) -target_link_libraries (boundary_example SuperStupidStack CORSIKAunits CORSIKAlogging +target_link_libraries (boundary_example + SuperStupidStack + CORSIKAunits + CORSIKAlogging CORSIKArandom ProcessSibyll CORSIKAcascade @@ -72,9 +56,11 @@ target_link_libraries (boundary_example SuperStupidStack CORSIKAunits CORSIKAlog ) install (TARGETS boundary_example DESTINATION share/examples) -if (Pythia8_FOUND) +if (PYTHIA8_FOUND) CORSIKA_ADD_TEST (cascade_proton_example) - target_link_libraries (cascade_proton_example SuperStupidStack CORSIKAunits + target_link_libraries (cascade_proton_example + SuperStupidStack + CORSIKAunits CORSIKAlogging CORSIKArandom ProcessSibyll @@ -96,10 +82,11 @@ if (Pythia8_FOUND) install (TARGETS cascade_proton_example DESTINATION share/examples) endif() -if (Pythia8_FOUND) - # CORSIKA_ADD_TEST (vertical_EAS) not yet... +if (PYTHIA8_FOUND) CORSIKA_ADD_TEST(vertical_EAS) - target_link_libraries (vertical_EAS SuperStupidStack CORSIKAunits + target_link_libraries (vertical_EAS + SuperStupidStack + CORSIKAunits CORSIKAlogging CORSIKArandom ProcessSibyll @@ -116,7 +103,7 @@ if (Pythia8_FOUND) CORSIKAenvironment CORSIKAprocesssequence ) - install (TARGETS vertical_EAS DESTINATION share/examples) + install (TARGETS vertical_EAS DESTINATION share/examples) endif() CORSIKA_ADD_TEST (staticsequence_example)