diff --git a/CMakeLists.txt b/CMakeLists.txt index b7a37854c654ba7a46c56ecd4419b8c3e5564bd8..9a788d053bfaac4589b8315bcf8da2a6736f411a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,17 +34,21 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) # Set the possible values of build type for cmake-gui set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") -endif() +endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) # enable warnings and disallow non-standard language set(CMAKE_CXX_FLAGS "-Wall -pedantic -Wextra -Wno-ignored-qualifiers") set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") -set(CMAKE_CXX_FLAGS_RELEASE "-O3") +set(CMAKE_CXX_FLAGS_RELEASE "-O3") # -O2 would not trade speed for size, neither O2/3 use fast-math # clang produces a lot of unecessary warnings without this: add_compile_options("$<$<CXX_COMPILER_ID:Clang>:-Wno-nonportable-include-path>") - +# check if we are on OSX: +if (APPLE) + add_compile_definitions (CORSIKA_OSX) +endif (APPLE) + # unit testing coverage, does not work yet #include (CodeCoverage) ##set(COVERAGE_LCOV_EXCLUDES 'Documentation/*') diff --git a/Processes/Sibyll/Decay.h b/Processes/Sibyll/Decay.h index ec776afcd5c2d974936c2e4ec82d5301e83b85bf..13c6a3ebc094b7618ca694fb7b2b74786571cdcc 100644 --- a/Processes/Sibyll/Decay.h +++ b/Processes/Sibyll/Decay.h @@ -169,7 +169,10 @@ namespace corsika::process { using corsika::geometry::Point; using namespace corsika::units::si; + // TODO: this should be done in a central, common place. Not here.. +#ifndef CORSIKA_OSX feenableexcept(FE_INVALID); +#endif fCount++; SibStack ss; @@ -216,7 +219,10 @@ namespace corsika::process { // empty sibyll stack ss.Clear(); + // TODO: this should be done in a central, common place. Not here.. +#ifndef CORSIKA_OSX fedisableexcept(FE_INVALID); +#endif } }; } // namespace sibyll