1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-02 09:02:03 +02:00

Fix static linking

This commit is contained in:
Evgeniy Meshcheryakov 2024-10-09 11:27:43 +03:00
parent 40576e9bb9
commit 7847fc4bba
3 changed files with 9 additions and 1 deletions

View File

@ -202,6 +202,10 @@ elseif(NOT APPLE_IOS)
target_link_libraries(vcmilauncher SDL2::SDL2)
endif()
if(ENABLE_STATIC_LIBS OR NOT (ENABLE_EDITOR AND ENABLE_LAUNCHER))
target_compile_definitions(vcmilauncher PRIVATE VCMIQT_STATIC)
endif()
target_link_libraries(vcmilauncher vcmi vcmiqt Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network)
target_include_directories(vcmilauncher
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}

View File

@ -217,6 +217,10 @@ if(APPLE)
set_property(GLOBAL PROPERTY AUTOGEN_TARGETS_FOLDER vcmieditor)
endif()
if(ENABLE_STATIC_LIBS OR NOT (ENABLE_EDITOR AND ENABLE_LAUNCHER))
target_compile_definitions(vcmieditor PRIVATE VCMIQT_STATIC)
endif()
target_link_libraries(vcmieditor vcmi vcmiqt Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network)
target_include_directories(vcmieditor
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}

View File

@ -10,7 +10,7 @@
#include <QtCore/QtGlobal>
#if VCMIQT_STATIC
#ifdef VCMIQT_STATIC
# define VCMIQT_LINKAGE
#elif defined(VCMIQT_SHARED)
# define VCMIQT_LINKAGE Q_DECL_EXPORT