[bugfix] Make library list used for setup.py a comma separated list.

It is used verbatim in setup.py in the list that specifies the linker
flage. Hence it needs to comma separted instead of using a semicolon
as separator.

We also rename it to SETUP_PY_LINKAGE to indicate where it is used.

Closes #2947
This commit is contained in:
Markus Blatt 2022-01-27 11:14:58 +01:00
parent 7471cef938
commit 1daa7d1df4
2 changed files with 7 additions and 1 deletions

View File

@ -397,6 +397,12 @@ if (OPM_ENABLE_PYTHON)
list(APPEND opm-common_PYTHON_LINKAGE "'${cjson_LIBRARIES}'")
endif()
# opm-common_PYTHON_LINKAGE is used verbatim in a listin python.
# Hence items need to be comma separated.
if (opm-common_PYTHON_LINKAGE)
string(REPLACE ";" "," SETUP_PY_LINKAGE "${opm-common_PYTHON_LINKAGE}")
endif()
configure_file (${PROJECT_SOURCE_DIR}/python/setup.py.in ${PROJECT_BINARY_DIR}/python/setup.py)
file(COPY ${PROJECT_SOURCE_DIR}/python/README.md DESTINATION ${PROJECT_BINARY_DIR}/python)
execute_process(COMMAND ${Python3_EXECUTABLE} target_name.py

View File

@ -69,7 +69,7 @@ ext_modules = [
undef_macros=["NDEBUG"],
include_dirs=[@SETUP_PY_PYBIND_INCLUDE_DIR@],
extra_compile_args=['-std=c++17', '-fopenmp', @SETUP_PY_FMT_FLAGS@],
extra_link_args=['-fopenmp', @opm-common_PYTHON_LINKAGE@]
extra_link_args=['-fopenmp', @SETUP_PY_LINKAGE@]
)
]