CMake: Fix wx-config library list with monolithic build
Closes https://github.com/wxWidgets/wxWidgets/pull/1132
This commit is contained in:
committed by
Vadim Zeitlin
parent
fc65bd92a6
commit
8555f4abb0
@@ -93,7 +93,8 @@ function(wx_write_config)
|
||||
set(STD_BASE_LIBS_ALL xml net base)
|
||||
set(STD_GUI_LIBS_ALL xrc html qa adv core)
|
||||
foreach(lib IN ITEMS xrc webview stc richtext ribbon propgrid aui gl media html qa adv core xml net base)
|
||||
if(TARGET ${lib})
|
||||
list(FIND wxLIB_TARGETS ${lib} hasLib)
|
||||
if (hasLib GREATER -1)
|
||||
wx_string_append(BUILT_WX_LIBS "${lib} ")
|
||||
list(FIND STD_BASE_LIBS_ALL ${lib} index)
|
||||
if (index GREATER -1)
|
||||
@@ -130,6 +131,9 @@ function(wx_write_config)
|
||||
wx_get_dependencies(EXTRALIBS_MEDIA media)
|
||||
wx_get_dependencies(OPENGL_LIBS gl)
|
||||
set(DMALLOC_LIBS)
|
||||
if(wxBUILD_MONOLITHIC)
|
||||
wx_get_dependencies(WXCONFIG_LIBS mono)
|
||||
endif()
|
||||
|
||||
set(CC ${CMAKE_C_COMPILER})
|
||||
set(CXX ${CMAKE_CXX_COMPILER})
|
||||
|
@@ -286,6 +286,9 @@ function(wx_set_target_properties target_name is_base)
|
||||
wx_set_common_target_properties(${target_name})
|
||||
endfunction()
|
||||
|
||||
# List of libraries added via wx_add_library() to use for wx-config
|
||||
set(wxLIB_TARGETS)
|
||||
|
||||
# Add a wxWidgets library
|
||||
# wx_add_library(<target_name> [IS_BASE] <src_files>...)
|
||||
# first parameter is the name of the library
|
||||
@@ -295,6 +298,9 @@ macro(wx_add_library name)
|
||||
cmake_parse_arguments(wxADD_LIBRARY "IS_BASE" "" "" ${ARGN})
|
||||
set(src_files ${wxADD_LIBRARY_UNPARSED_ARGUMENTS})
|
||||
|
||||
list(APPEND wxLIB_TARGETS ${name})
|
||||
set(wxLIB_TARGETS ${wxLIB_TARGETS} PARENT_SCOPE)
|
||||
|
||||
if(wxBUILD_MONOLITHIC AND NOT ${name} STREQUAL "mono")
|
||||
# collect all source files for mono library
|
||||
set(wxMONO_SRC_FILES ${wxMONO_SRC_FILES} ${src_files} PARENT_SCOPE)
|
||||
|
@@ -97,3 +97,6 @@ if(wxBUILD_MONOLITHIC)
|
||||
endforeach()
|
||||
wx_finalize_lib(mono)
|
||||
endif()
|
||||
|
||||
# Propagate variable(s) to parent scope
|
||||
set(wxLIB_TARGETS ${wxLIB_TARGETS} PARENT_SCOPE)
|
||||
|
Reference in New Issue
Block a user