From 55072adf16231cc27befe4370d0ec261a59138c9 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 8 Oct 2023 18:26:08 +0200 Subject: FindwxWidgets: Improve linking with scintilla Treat scintilla like any other common lib. Only add it when the stc component is specified. Add imm32 to the list of required libraries when stc is used. Fixes: #23519 --- Modules/FindwxWidgets.cmake | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 82ae07f..933f14e 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -37,7 +37,7 @@ select a configuration): wxWidgets_EXCLUDE_COMMON_LIBRARIES - Set to TRUE to exclude linking of commonly required libs (e.g., png tiff - jpeg zlib regex expat). + jpeg zlib regex expat scintilla). @@ -286,8 +286,10 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") # Add the common (usually required libs) unless # wxWidgets_EXCLUDE_COMMON_LIBRARIES has been set. if(NOT wxWidgets_EXCLUDE_COMMON_LIBRARIES) - list(APPEND wxWidgets_FIND_COMPONENTS - ${wxWidgets_COMMON_LIBRARIES}) + if(stc IN_LIST wxWidgets_FIND_COMPONENTS) + list(APPEND wxWidgets_FIND_COMPONENTS scintilla) + endif() + list(APPEND wxWidgets_FIND_COMPONENTS ${wxWidgets_COMMON_LIBRARIES}) endif() #------------------------------------------------------------------- @@ -455,6 +457,10 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32") list(APPEND wxWidgets_LIBRARIES opengl32 glu32) endif() + if(stc IN_LIST ${_LIBS}) + list(APPEND wxWidgets_LIBRARIES imm32) + endif() + list(APPEND wxWidgets_LIBRARIES winmm comctl32 uuid oleacc uxtheme rpcrt4 shlwapi version wsock32) endmacro() -- cgit v0.12