Skip to content

Commit

Permalink
Use the same name for the oxDNA common library for all build types
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo-rovigatti committed Sep 7, 2022
1 parent 7a0c5b8 commit e003f6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions oxpy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ IF(Python)
SET(CMAKE_SHARED_LIBRARY_PREFIX "")

# we need the oxDNA "common" library to be compiled so that the resulting code is position-independent and the library can be linked dynamically
SET_TARGET_PROPERTIES(${lib_name} PROPERTIES POSITION_INDEPENDENT_CODE ON)
SET_TARGET_PROPERTIES(oxdna_common PROPERTIES POSITION_INDEPENDENT_CODE ON)

ADD_LIBRARY(_oxpy_lib STATIC ${oxpy_SOURCES})
TARGET_LINK_LIBRARIES(_oxpy_lib ${PYTHON_LIBRARIES} ${lib_name})
TARGET_LINK_LIBRARIES(_oxpy_lib ${PYTHON_LIBRARIES} oxdna_common)
SET_TARGET_PROPERTIES(_oxpy_lib PROPERTIES POSITION_INDEPENDENT_CODE ON)
pybind11_add_module(core SHARED bindings.cpp)
TARGET_LINK_LIBRARIES(core PRIVATE _oxpy_lib)
Expand Down
5 changes: 2 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

SET(lib_name oxdna_common)

IF(CMAKE_BUILD_TYPE MATCHES Debug)
SET(exe_name oxDNA_debug)
SET(lib_name oxdna_common_debug)
ELSEIF(MPI)
SET(exe_name oxDNA_mpi)
SET(lib_name oxdna_common)
ELSE()
SET(exe_name oxDNA)
SET(lib_name oxdna_common)
ENDIF()

SET(observables_SOURCES
Expand Down

0 comments on commit e003f6c

Please sign in to comment.