Merge pull request #2811 from akva2/python_binding_reuse

changed: reuse objects if building python inline
This commit is contained in:
Markus Blatt 2020-09-29 15:57:13 +02:00 committed by GitHub
commit 3a41c78114
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -223,11 +223,16 @@ else()
endif()
add_library(moduleVersion OBJECT opm/simulators/utils/moduleVersion.cpp)
set_property(TARGET moduleVersion 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)
add_library(flow_libblackoil OBJECT flow/flow_ebos_blackoil.cpp)
set_property(TARGET flow_libblackoil PROPERTY POSITION_INDEPENDENT_CODE ON)
add_dependencies(flow_libblackoil opmsimulators)
# the production oriented general-purpose ECL simulator
opm_add_test(flow
ONLY_COMPILE
@ -237,7 +242,6 @@ opm_add_test(flow
LIBRARIES opmsimulators
SOURCES
flow/flow.cpp
flow/flow_ebos_blackoil.cpp
flow/flow_ebos_gasoil.cpp
flow/flow_ebos_oilwater.cpp
flow/flow_ebos_polymer.cpp
@ -248,7 +252,9 @@ opm_add_test(flow
flow/flow_ebos_energy.cpp
flow/flow_ebos_oilwater_polymer.cpp
flow/flow_ebos_oilwater_polymer_injectivity.cpp
$<TARGET_OBJECTS:moduleVersion>)
$<TARGET_OBJECTS:moduleVersion>
$<TARGET_OBJECTS:flow_libblackoil>
)
if (NOT BUILD_FLOW_BLACKOIL_ONLY)

View File

@ -4,8 +4,8 @@ set_target_properties( simulators PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_
target_sources(simulators
PRIVATE
../../opm/simulators/utils/moduleVersion.cpp
../../flow/flow_ebos_blackoil.cpp)
$<TARGET_OBJECTS:moduleVersion>
$<TARGET_OBJECTS:flow_libblackoil>)
target_link_libraries( simulators PRIVATE opmsimulators )