Fix wx-config generation in CMake build.

See https://github.com/wxWidgets/wxWidgets/pull/2353

Closes #19164.
This commit is contained in:
Vadim Zeitlin 2021-05-01 14:10:21 +02:00
commit c8c55be4ab

View File

@ -39,11 +39,10 @@ macro(wx_get_dependencies var lib)
else()
get_target_property(dep_name ${dep} OUTPUT_NAME)
endif()
set(dep_name "-l${dep_name}")
else()
get_filename_component(dep_name ${dep} NAME)
endif()
wx_string_append(${var} "${dep_name} ")
wx_string_append(${var} "-l${dep_name} ")
endforeach()
string(STRIP ${${var}} ${var})
endif()
@ -153,10 +152,14 @@ function(wx_write_config)
set(WXCONFIG_CFLAGS "-pthread")
set(WXCONFIG_LDFLAGS "-pthread")
endif()
set(WXCONFIG_CPPFLAGS "-DWXUSINGDLL")
set(WXCONFIG_CPPFLAGS)
if(wxBUILD_SHARED)
wx_string_append(WXCONFIG_CPPFLAGS " -DWXUSINGDLL")
endif()
foreach(flag IN LISTS wxTOOLKIT_DEFINITIONS)
wx_string_append(WXCONFIG_CPPFLAGS " -D${flag}")
endforeach()
string(STRIP "${WXCONFIG_CPPFLAGS}" WXCONFIG_CPPFLAGS)
set(WXCONFIG_CXXFLAGS ${WXCONFIG_CFLAGS})
set(WXCONFIG_LDFLAGS_GUI)
set(WXCONFIG_RESFLAGS)