revert back to not supporting loading plugins on windows

This commit is contained in:
Axel Kohlmeyer
2021-03-13 10:25:44 -05:00
parent 4ae7f84c2a
commit e3d9c3126b
2 changed files with 22 additions and 49 deletions

View File

@ -31,6 +31,11 @@ endif()
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# bail out on windows
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
message(FATAL_ERROR "LAMMPS plugins are currently not supported on Windows")
endif()
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR})
include(CheckIncludeFileCXX)
include(LAMMPSInterfaceCXX)
@ -48,13 +53,12 @@ target_link_libraries(nve2plugin PRIVATE lammps)
add_library(helloplugin MODULE helloplugin.cpp)
target_link_libraries(helloplugin PRIVATE lammps)
set_target_properties(morse2plugin nve2plugin helloplugin PROPERTIES PREFIX "")
set_target_properties(morse2plugin nve2plugin helloplugin PROPERTIES
PREFIX ""
LINK_FLAGS "-rdynamic")
# MacOS seems to need this
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set_target_properties(morse2plugin nve2plugin helloplugin PROPERTIES
LINK_FLAGS "-Wl,-undefined,dynamic_lookup")
elseif(CMAKE_SYSTEM_NAME STREQUAL Windows)
set_target_properties(morse2plugin nve2plugin helloplugin PROPERTIES LINK_FLAGS "-Wl,--undefined")
else()
set_target_properties(morse2plugin nve2plugin helloplugin PROPERTIES LINK_FLAGS "-rdynamic")
endif()