From 7683219f90582ff80f9895e0959ff2a3a43e7d93 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 10 Apr 2022 23:44:59 +0200 Subject: [PATCH] CMake: Remove duplicate and unused defines Remove unused CMake code to get number of mono source files. wxUSE_BASE=1 is also defined in wx_set_target_properties. There seems no reason to define _LIB and DLL_EXPORTS, wx does not use it. They were probably added because the vcxproj files have them. --- build/cmake/functions.cmake | 6 +++--- build/cmake/lib/CMakeLists.txt | 1 - build/cmake/lib/base/CMakeLists.txt | 4 ---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index bc012a14b6..9b493593ad 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -271,7 +271,7 @@ function(wx_set_target_properties target_name) endif() # Set common compile definitions - target_compile_definitions(${target_name} PRIVATE WXBUILDING _LIB) + target_compile_definitions(${target_name} PRIVATE WXBUILDING) if(target_name_short STREQUAL "mono" AND wxUSE_GUI) target_compile_definitions(${target_name} PRIVATE wxUSE_GUI=1 wxUSE_BASE=1) elseif(wxTARGET_IS_PLUGIN) @@ -350,9 +350,9 @@ function(wx_set_target_properties target_name) if(wxBUILD_SHARED) string(TOUPPER ${target_name_short} target_name_upper) if(target_name_short STREQUAL "mono") - target_compile_definitions(${target_name} PRIVATE DLL_EXPORTS WXMAKINGDLL) + target_compile_definitions(${target_name} PRIVATE WXMAKINGDLL) elseif(NOT wxTARGET_IS_PLUGIN) - target_compile_definitions(${target_name} PRIVATE DLL_EXPORTS WXMAKINGDLL_${target_name_upper}) + target_compile_definitions(${target_name} PRIVATE WXMAKINGDLL_${target_name_upper}) endif() target_compile_definitions(${target_name} INTERFACE WXUSINGDLL) endif() diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt index 570e2b581f..41471190fe 100644 --- a/build/cmake/lib/CMakeLists.txt +++ b/build/cmake/lib/CMakeLists.txt @@ -75,7 +75,6 @@ endforeach() if(wxBUILD_MONOLITHIC) # Create monolithic library target - list(LENGTH wxMONO_SRC_FILES src_file_count) wx_add_library(wxmono ${wxMONO_SRC_FILES}) foreach(vis PRIVATE PUBLIC) if(wxMONO_LIBS_${vis}) diff --git a/build/cmake/lib/base/CMakeLists.txt b/build/cmake/lib/base/CMakeLists.txt index 9f4a472813..dc512f23e2 100644 --- a/build/cmake/lib/base/CMakeLists.txt +++ b/build/cmake/lib/base/CMakeLists.txt @@ -26,10 +26,6 @@ endif() wx_add_library(wxbase IS_BASE ${BASE_FILES}) -if(NOT wxBUILD_MONOLITHIC) - wx_lib_compile_definitions(wxbase PRIVATE wxUSE_BASE=1) -endif() - if(wxUSE_ZLIB) wx_lib_include_directories(wxbase ${ZLIB_INCLUDE_DIRS}) wx_lib_link_libraries(wxbase PRIVATE ${ZLIB_LIBRARIES})