Skip to content

Commit

Permalink
moved -fPIC flag to separate variable
Browse files Browse the repository at this point in the history
  • Loading branch information
amartyads committed Sep 7, 2023
1 parent 5b3e2d9 commit 68f616a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cmake/modules/mamico.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ option(MAMICO_COUPLING "Couple with MaMiCo" OFF)
if (MAMICO_COUPLING)
message(STATUS "MaMiCo coupling enabled. ls1 mardyn will compile as library. No executable will be created.")
set(MAMICO_COMPILE_DEFINITIONS MAMICO_COUPLING MDDim3)
option(MAMICO_ENABLE_FPIC "Enable -fPIC flag for MaMiCo python bindings" OFF)
set(MAMICO_SRC_DIR CACHE PATH "Root directory of the MaMiCo codebase")
if(NOT MAMICO_SRC_DIR)
message(FATAL_ERROR "MaMiCo source directory not specified.")
endif()
if(ENABLE_MPI)
set(MAMICO_MPI_DEFINITIONS MDCoupledParallel TarchParallel)
endif()
if(MAMICO_ENABLE_FPIC)
set(MAMICO_COMPILE_OPTIONS "${MAMICO_COMPILE_OPTIONS} -fPIC")
endif()
else()
message(STATUS "MaMiCo coupling disabled.")
endif()
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if (MAMICO_COUPLING)
TARGET_COMPILE_DEFINITIONS(MarDyn PUBLIC
${MAMICO_COMPILE_DEFINITIONS} ${MAMICO_MPI_DEFINITIONS}
)
TARGET_COMPILE_OPTIONS(MarDyn PUBLIC -fPIC)
TARGET_COMPILE_OPTIONS(MarDyn PUBLIC ${MAMICO_COMPILE_OPTIONS})
else()
ADD_EXECUTABLE(MarDyn
${MY_SRC}
Expand Down

0 comments on commit 68f616a

Please sign in to comment.