Use PIC in mpi_stubs when BUILD_SHARED_LIBS=on

This commit is contained in:
Richard Berger 2017-08-27 17:27:43 -04:00
parent 313b8bc2fa
commit 153c771a6d
1 changed files with 3 additions and 0 deletions

View File

@ -71,6 +71,9 @@ else()
else()
add_library(mpi_stubs STATIC ${MPI_SOURCES})
endif()
if(BUILD_SHARED_LIBS)
set_target_properties(mpi_stubs PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif()
include_directories(${LAMMPS_SOURCE_DIR}/STUBS)
list(APPEND LAMMPS_LINK_LIBS mpi_stubs)
endif()