diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index e2229ba19..a56893838 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -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} diff --git a/mapeditor/CMakeLists.txt b/mapeditor/CMakeLists.txt index 33f6f6e67..e9f7ad6cf 100644 --- a/mapeditor/CMakeLists.txt +++ b/mapeditor/CMakeLists.txt @@ -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} diff --git a/vcmiqt/vcmiqt.h b/vcmiqt/vcmiqt.h index a3cf5f8c0..4783eaaae 100644 --- a/vcmiqt/vcmiqt.h +++ b/vcmiqt/vcmiqt.h @@ -10,7 +10,7 @@ #include -#if VCMIQT_STATIC +#ifdef VCMIQT_STATIC # define VCMIQT_LINKAGE #elif defined(VCMIQT_SHARED) # define VCMIQT_LINKAGE Q_DECL_EXPORT