IAP GITLAB

Skip to content
Snippets Groups Projects
Commit d7c3a493 authored by Ralf Ulrich's avatar Ralf Ulrich Committed by Maximilian Reininghaus
Browse files

Resolve "WITH_HISTORY not working"

parent 59ccd241
No related branches found
No related tags found
No related merge requests found
......@@ -193,12 +193,6 @@ if (NOT DEFINED ENV{CI})
add_test (NAME copyright_notices COMMAND ./do-copyright.py WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
endif (NOT DEFINED ENV{CI})
#+++++++++++++++++++++++++++++
# Options
#
# HISTORY option selection
option (WITH_HISTORY "Flag to switch on/off HISTORY" ON)
#+++++++++++++++++++++++++++++
# Externals
#
......@@ -346,13 +340,9 @@ install (DIRECTORY examples DESTINATION share/corsika)
add_subdirectory (tools)
#+++++++++++++++++++++++++++++++
#
# final summary output
#
include (FeatureSummary)
add_feature_info (HISTORY WITH_HISTORY "Full information on cascade history for particles.")
feature_summary (WHAT ALL)
......@@ -2,6 +2,30 @@ set (CORSIKA8_VERSION @c8_version@)
@PACKAGE_INIT@
#+++++++++++++++++++++++++++
# Options
#
option (WITH_HISTORY "Flag to switch on/off HISTORY" ON)
#+++++++++++++++++++++++++++++
# Build types settings
#
# setup coverage build type
set (CMAKE_CXX_FLAGS_COVERAGE "-g --coverage")
set (CMAKE_EXE_LINKER_FLAGS_COVERAGE "--coverage")
set (CMAKE_SHARED_LINKER_FLAGS_COVERAGE "--coverage")
# set a flag to inform code that we are in debug mode
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
set (ALLOWED_BUILD_TYPES Debug Release MinSizeRel RelWithDebInfo Coverage)
set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${ALLOWED_BUILD_TYPES})
set (DEFAULT_BUILD_TYPE "Release")
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set (CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE
STRING "Choose the type of build." FORCE)
endif (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
#++++++++++++++++++++++++++++
# General config and flags
#
......@@ -37,3 +61,25 @@ message (STATUS "Pythia8 at: @Pythia8_PREFIX@")
#
include ("${CMAKE_CURRENT_LIST_DIR}/corsikaTargets.cmake")
check_required_components (corsika)
#+++++++++++++++++++++++++++++++
# add further definitions / options
#
if (WITH_HISTORY)
set_property (
TARGET CORSIKA8::CORSIKA8
APPEND PROPERTY
INTERFACE_COMPILE_DEFINITIONS "WITH_HISTORY"
)
endif (WITH_HISTORY)
#+++++++++++++++++++++++++++++++
#
# final summary output
#
include (FeatureSummary)
add_feature_info (HISTORY WITH_HISTORY "Full information on cascade history for particles.")
feature_summary (WHAT ALL)
......@@ -18,12 +18,15 @@ namespace corsika::setup {
#ifdef WITH_HISTORY
#include <corsika/stack/history/HistoryStackExtension.hpp>
#include <corsika/stack/history/HistorySecondaryProducer.hpp>
/*
* the version with history
*/
using Stack = detail::StackWithHistory;
template <typename T1, template <typename> typename M2>
using StackViewProducer = HistorySecondaryProducer<T1, M2>;
using StackViewProducer = history::HistorySecondaryProducer<T1, M2>;
#else // WITH_HISTORY
......@@ -32,7 +35,7 @@ namespace corsika::setup {
*/
using Stack = detail::StackWithGeometry;
template <typename T1, template <typename> typename M2>
using StackViewProducer = corsika::DefaultSecondaryProducer<T1, M2>;
using StackViewProducer = DefaultSecondaryProducer<T1, M2>;
#endif
......@@ -58,7 +61,7 @@ namespace corsika::setup {
// CHECK with CLANG: setup::Stack::MPIType>;
detail::StackWithHistoryInterface, StackViewProducer>;
#elif defined(__GNUC__) || defined(__GNUG__)
using StackView = make_view<setup::Stack, StackViewProducer>::type;
using StackView = MakeView<setup::Stack, StackViewProducer>::type;
#endif
#else // WITH_HISTORY
......@@ -69,7 +72,7 @@ namespace corsika::setup {
// setup::Stack::MPIType>;
setup::detail::StackWithGeometryInterface>;
#elif defined(__GNUC__) || defined(__GNUG__)
using StackView = corsika::MakeView<setup::Stack>::type;
using StackView = MakeView<setup::Stack>::type;
#endif
#endif // WITH_HISTORY
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment