forked from lijiext/lammps
enable PIC globally
This commit is contained in:
parent
153c771a6d
commit
4bff008777
|
@ -48,6 +48,9 @@ option(INSTALL_LIB "Install lammps library and header" ON)
|
|||
if(NOT INSTALL_LIB AND ( BUILD_SHARED_LIBS OR BUILD_SHARED_PKG_LIBS ) )
|
||||
message(FATAL_ERROR "Shared libs need to be installed, enable install with -DINSTALL_LIB=ON")
|
||||
endif()
|
||||
if(BUILD_SHARED_LIBS OR BUILD_SHARED_PKG_LIBS)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(LAMMPS_LINK_LIBS)
|
||||
|
@ -71,9 +74,6 @@ 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()
|
||||
|
@ -193,9 +193,6 @@ if(ENABLE_MSCG OR ENABLE_USER-ATC OR ENABLE_USER-AWPMD OR ENABLE_USER-QUIP)
|
|||
else()
|
||||
add_library(linalg STATIC ${LAPACK_SOURCES})
|
||||
endif()
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set_target_properties(linalg PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
include(CheckFortranCompilerFlag)
|
||||
check_Fortran_compiler_flag("-fno-second-underscore" FC_HAS_NO_SECOND_UNDERSCORE)
|
||||
if(FC_HAS_NO_SECOND_UNDERSCORE)
|
||||
|
@ -324,9 +321,6 @@ if(ENABLE_MSCG)
|
|||
else()
|
||||
add_library(mscg STATIC ${MSCG_SOURCES})
|
||||
endif()
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set_target_properties(mscg PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
list(APPEND LAMMPS_LINK_LIBS mscg)
|
||||
target_compile_options(mscg PRIVATE -DDIMENSION=3 -D_exclude_gromacs=1)
|
||||
target_include_directories(mscg PUBLIC ${LAMMPS_LIB_MSCG_BIN_DIR})
|
||||
|
@ -396,9 +390,6 @@ foreach(SIMPLE_LIB REAX MEAM POEMS USER-ATC USER-AWPMD USER-COLVARS USER-H5MD
|
|||
else()
|
||||
add_library(${PKG_LIB} STATIC ${${PKG_LIB}_SOURCES})
|
||||
endif()
|
||||
if(BUILD_SHARED_LIBS)
|
||||
set_target_properties(${PKG_LIB} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
list(APPEND LAMMPS_LINK_LIBS ${PKG_LIB})
|
||||
if(PKG_LIB STREQUAL awpmd)
|
||||
target_include_directories(awpmd PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/awpmd/systems/interact ${LAMMPS_LIB_SOURCE_DIR}/awpmd/ivutils/include)
|
||||
|
|
Loading…
Reference in New Issue