From 8e9703b0da9ae912bc67e0c5a74669f408ed02e7 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 7 Feb 2025 09:53:40 +0100 Subject: [PATCH] fixed: extract MainDispatchDynamic to a object library fixes building with shared libraries. linking a shared library with missing symbols is a problem, while linking a binary against a static library will prune non-referenced symbols and it is thus fine. --- CMakeLists.txt | 5 +++++ CMakeLists_files.cmake | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a40adc97e..2c1b979c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -538,6 +538,9 @@ endif() add_library(moduleVersion OBJECT opm/simulators/utils/moduleVersion.cpp) set_property(TARGET moduleVersion PROPERTY POSITION_INDEPENDENT_CODE ON) +add_library(MainDispatchDynamic OBJECT opm/simulators/flow/MainDispatchDynamic.cpp) +set_property(TARGET MainDispatchDynamic PROPERTY POSITION_INDEPENDENT_CODE ON) + # Strictly we only depend on the update-version target, # but this is not exposed in a super-build. add_dependencies(moduleVersion opmsimulators) @@ -587,6 +590,7 @@ opm_add_test(flow flow/flow.cpp ${FLOW_TGTS} $ + $ ) opm_add_test(flow_blackoil_polyhedralgrid @@ -609,6 +613,7 @@ opm_add_test(flow_distribute_z flow/flow_distribute_z.cpp ${FLOW_TGTS} $ + $ ) opm_add_test(flowexp_blackoil diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index f91a198a7..4702f18ac 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -106,7 +106,6 @@ list (APPEND MAIN_SOURCE_FILES opm/simulators/flow/KeywordValidation.cpp opm/simulators/flow/LogOutputHelper.cpp opm/simulators/flow/Main.cpp - opm/simulators/flow/MainDispatchDynamic.cpp opm/simulators/flow/MechContainer.cpp opm/simulators/flow/MixingRateControls.cpp opm/simulators/flow/NonlinearSolver.cpp