1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Yet another attempt to fix Windows compile:

when building vcmi_lib statically (or linking against static vcmi_lib)
do not place dllexport/dllimport tags
This commit is contained in:
Ivan Savenko 2022-12-06 18:35:24 +02:00
parent 085abb9e32
commit fd97b51183
3 changed files with 6 additions and 1 deletions

View File

@ -217,7 +217,10 @@ typedef boost::lock_guard<boost::recursive_mutex> TLockGuardRec;
/* ---------------------------------------------------------------------------- */
// Import + Export macro declarations
#ifdef VCMI_WINDOWS
# ifdef __GNUC__
#ifdef VCMI_DLL_STATIC
# define DLL_IMPORT
# define DLL_EXPORT
#elif defined(__GNUC__)
# define DLL_IMPORT __attribute__((dllimport))
# define DLL_EXPORT __attribute__((dllexport))
# else

View File

@ -1,2 +1,3 @@
add_main_lib(vcmi_lib_server STATIC)
target_compile_definitions(vcmi_lib_server PUBLIC VCMI_LIB_NAMESPACE=LIB_SERVER)
target_compile_definitions(vcmi_lib_server PUBLIC VCMI_DLL_STATIC=1)

View File

@ -24,6 +24,7 @@ endif()
if(ENABLE_SINGLE_APP_BUILD)
add_library(vcmiserver STATIC ${server_SRCS} ${server_HEADERS})
target_compile_definitions(vcmiserver PUBLIC VCMI_DLL_STATIC=1)
set(server_LIBS vcmi_lib_server)
else()
add_executable(vcmiserver ${server_SRCS} ${server_HEADERS})