IAP GITLAB

Commit 492c9456 authored by Lukas Nellen's avatar Lukas Nellen 👣

Detect SCL compiler, deal with old ABI

parent c6e6ac5c
Pipeline #3558 passed with stages
in 14 minutes and 10 seconds
......@@ -80,6 +80,9 @@ set (CMAKE_CXX_EXTENSIONS OFF)
# FYI: optimizer flags: -O2 would not trade speed for size, neither O2/3 use fast-math
# debug: O0, relwithdebinfo: 02, release: O3, minsizerel: Os (all defaults)
set (CMAKE_CXX_FLAGS "-Wall -pedantic -Wextra -Wno-ignored-qualifiers")
if (CORSIKA_SCL_CXX)
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
endif()
set (DEFAULT_BUILD_TYPE "Release")
# clang produces a lot of unecessary warnings without this:
......@@ -126,6 +129,7 @@ endif (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
#+++++++++++++++++++++++++++++
# Setup external dependencies.
#
###
include (conan) # self-provided in 'cmake' directory
#
# download and build all dependencies
......
......@@ -14,10 +14,15 @@ endif ()
#
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set (CORSIKA_OS_WINDOWS TRUE)
set (CORSIKA_OS "Windows")
set (CORSIKA_OS "Windows")
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set (CORSIKA_OS_LINUX TRUE)
set (CORSIKA_OS "Linux")
set (CORSIKA_OS "Linux")
# check for RedHat/CentOS compiler from the software collections (scl)
string (FIND ${CMAKE_CXX_COMPILER} "/opt/rh/devtoolset-" index)
if (${index} EQUAL 0)
set (CORSIKA_SCL_CXX TRUE)
endif ()
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set (CORSIKA_OS_MAC TRUE)
set (CORSIKA_OS "Mac")
......
......@@ -47,7 +47,13 @@ namespace corsika {
auto logger = spdlog::stdout_color_mt(name);
// set the default C8 format
#if (!defined(_GLIBCXX_USE_CXX11_ABI) || _GLIBCXX_USE_CXX11_ABI == 1)
logger->set_pattern(logging::default_pattern);
#else
// special case: gcc from the software collections devtoolset
std::string dp(default_pattern);
logger->set_pattern(dp);
#endif
// if defaultlog is True, we set this as the default spdlog logger.
if (defaultlog) { spdlog::set_default_logger(logger); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment