From 4999c1c84bdf481e77ebcca111f317d31a3bca8a Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 10 Apr 2022 22:25:13 +0200 Subject: [PATCH] CMake: Export WXUSINGDLL for shared builds Always define WXUSINGDLL for plugins. --- build/cmake/functions.cmake | 10 ++++------ build/cmake/utils/CMakeLists.txt | 3 --- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index 79893cc71b..bc012a14b6 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -354,9 +354,10 @@ function(wx_set_target_properties target_name) elseif(NOT wxTARGET_IS_PLUGIN) target_compile_definitions(${target_name} PRIVATE DLL_EXPORTS WXMAKINGDLL_${target_name_upper}) endif() - if(NOT target_name_short STREQUAL "base") - target_compile_definitions(${target_name} PRIVATE WXUSINGDLL) - endif() + target_compile_definitions(${target_name} INTERFACE WXUSINGDLL) + endif() + if(wxTARGET_IS_PLUGIN OR (wxBUILD_SHARED AND NOT target_name_short STREQUAL "base")) + target_compile_definitions(${target_name} PRIVATE WXUSINGDLL) endif() # Link common libraries @@ -824,9 +825,6 @@ function(wx_add name group) if(APP_LIBRARIES) wx_exe_link_libraries(${target_name} ${APP_LIBRARIES}) endif() - if(wxBUILD_SHARED) - target_compile_definitions(${target_name} PRIVATE WXUSINGDLL) - endif() if(APP_DEFINITIONS) target_compile_definitions(${target_name} PRIVATE ${APP_DEFINITIONS}) endif() diff --git a/build/cmake/utils/CMakeLists.txt b/build/cmake/utils/CMakeLists.txt index 2b3a22834d..d6b34658db 100644 --- a/build/cmake/utils/CMakeLists.txt +++ b/build/cmake/utils/CMakeLists.txt @@ -10,9 +10,6 @@ if(wxUSE_XRC) add_executable(wxrc "${wxSOURCE_DIR}/utils/wxrc/wxrc.cpp") wx_set_common_target_properties(wxrc) - if(wxBUILD_SHARED) - target_compile_definitions(wxrc PRIVATE WXUSINGDLL) - endif() if(wxUSE_XML) wx_exe_link_libraries(wxrc wxxml) endif()