Remove wxUSE_UNICODE option from CMake too

Keep it in build.cfg just in case it's needed for compatibility, but
always define it as 1.
This commit is contained in:
Vadim Zeitlin 2022-10-27 01:22:16 +01:00
parent a60c9b0f5e
commit 885ab36c11
8 changed files with 15 additions and 40 deletions

View file

@ -4,7 +4,7 @@ WXVER_RELEASE=@wxRELEASE_NUMBER@
BUILD=@wxBUILD@
MONOLITHIC=@wxBUILD_MONOLITHIC_bf@
SHARED=@wxBUILD_SHARED_bf@
UNICODE=@wxUSE_UNICODE_bf@
UNICODE=1
TOOLKIT=@wxBUILD_TOOLKIT_UPPER@
TOOLKIT_VERSION=@wxTOOLKIT_VERSION@
WXUNIV=@wxUNIV@

View file

@ -18,7 +18,6 @@ endmacro()
wx_buildfile_var(wxBUILD_MONOLITHIC)
wx_buildfile_var(wxBUILD_SHARED)
wx_buildfile_var(wxUSE_UNICODE)
wx_buildfile_var(wxUSE_EXCEPTIONS)
wx_buildfile_var(wxUSE_THREADS)
wx_buildfile_var(wxUSE_AUI)

View file

@ -106,13 +106,8 @@ function(wx_write_config)
else()
set(SHARED 0)
endif()
if(wxUSE_UNICODE)
set(WX_CHARTYPE unicode)
set(lib_unicode_suffix u)
else()
set(WX_CHARTYPE ansi)
set(lib_unicode_suffix)
endif()
if(CMAKE_CROSSCOMPILING)
set(cross_compiling yes)
set(host_alias ${CMAKE_SYSTEM_NAME})

View file

@ -190,9 +190,7 @@ function(wx_set_target_properties target_name)
endif()
set(lib_unicode)
if(wxUSE_UNICODE)
set(lib_unicode "u")
endif()
set(lib_rls)
set(lib_dbg)
@ -285,12 +283,10 @@ function(wx_set_target_properties target_name)
target_compile_definitions(${target_name} PRIVATE wxUSE_GUI=1 wxUSE_BASE=0)
endif()
if(wxUSE_UNICODE)
if(WIN32)
target_compile_definitions(${target_name} PUBLIC UNICODE)
endif()
target_compile_definitions(${target_name} PUBLIC _UNICODE)
endif()
if(WIN32 AND MSVC)
# Suppress deprecation warnings for standard library calls
@ -510,7 +506,7 @@ endmacro()
# Set common properties for a builtin third party library
function(wx_set_builtin_target_properties target_name)
set(lib_unicode)
if(wxUSE_UNICODE AND target_name STREQUAL "wxregex")
if(target_name STREQUAL "wxregex")
set(lib_unicode "u")
endif()
@ -532,12 +528,10 @@ function(wx_set_builtin_target_properties target_name)
OUTPUT_NAME_DEBUG "${target_name}${lib_unicode}${lib_dbg}${lib_flavour}${lib_version}"
)
if(wxUSE_UNICODE)
if(WIN32)
target_compile_definitions(${target_name} PUBLIC UNICODE)
endif()
target_compile_definitions(${target_name} PUBLIC _UNICODE)
endif()
if(MSVC)
# we're not interested in deprecation warnings about the use of

View file

@ -113,11 +113,7 @@ endif()
# Build wxBUILD_FILE_ID used for config and setup path
#TODO: build different id for WIN32
set(wxBUILD_FILE_ID "${wxBUILD_TOOLKIT}${wxBUILD_WIDGETSET}-")
if(wxUSE_UNICODE)
wx_string_append(wxBUILD_FILE_ID "unicode")
else()
wx_string_append(wxBUILD_FILE_ID "ansi")
endif()
wx_string_append(wxBUILD_FILE_ID "unicode")
if(NOT wxBUILD_SHARED)
wx_string_append(wxBUILD_FILE_ID "-static")
endif()
@ -164,11 +160,7 @@ if(wxBUILD_CUSTOM_SETUP_HEADER_PATH)
else()
# Set path where setup.h will be created
if(WIN32_MSVC_NAMING)
if(wxUSE_UNICODE)
set(lib_unicode u)
else()
set(lib_unicode)
endif()
set(wxSETUP_HEADER_PATH
${wxOUTPUT_DIR}/${wxPLATFORM_LIB_DIR}/${wxBUILD_TOOLKIT}${lib_unicode})
file(MAKE_DIRECTORY ${wxSETUP_HEADER_PATH}/wx)

View file

@ -118,10 +118,7 @@ if(WXGTK AND wxUSE_WEBVIEW_WEBKIT2)
set_target_properties(wxwebkit2_ext PROPERTIES NO_SONAME 1)
# Change output name to match expected name in webview_webkit2.cpp: webkit2_ext*
set(lib_unicode)
if(wxUSE_UNICODE)
set(lib_unicode "u")
endif()
set(lib_rls)
set(lib_dbg)

View file

@ -87,6 +87,5 @@ message(STATUS "Configured wxWidgets ${wxVERSION} for ${CMAKE_SYSTEM}
Which GUI toolkit should wxWidgets use? ${wxBUILD_TOOLKIT} ${wxTOOLKIT_VERSION} ${wxTOOLKIT_DESC}
Should wxWidgets be compiled into single library? ${wxBUILD_MONOLITHIC}
Should wxWidgets be linked as a shared library? ${wxBUILD_SHARED}
Should wxWidgets support Unicode? ${wxUSE_UNICODE}
Which wxWidgets API compatibility should be used? ${wxBUILD_COMPATIBILITY}"
)

View file

@ -80,7 +80,6 @@ wx_option(wxUSE_STL "use standard C++ classes for everything" OFF)
set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} wxUSE_STL "use C++ STL classes")
wx_dependent_option(wxUSE_STD_CONTAINERS "use standard C++ container classes" ON "wxUSE_STL" OFF)
wx_option(wxUSE_UNICODE "compile with Unicode support (NOT RECOMMENDED to be turned off)")
if(NOT WIN32)
wx_option(wxUSE_UNICODE_UTF8 "use UTF-8 representation for strings (Unix only)" OFF)
wx_dependent_option(wxUSE_UTF8_LOCALE_ONLY "only support UTF-8 locales in UTF-8 build (Unix only)" ON "wxUSE_UNICODE_UTF8" OFF)
@ -97,7 +96,7 @@ wx_option(wxUSE_REPRODUCIBLE_BUILD "enable reproducable build" OFF)
# external libraries
# ---------------------------------------------------------------------------
set(PCRE2_CODE_UNIT_WIDTH 8)
if(wxUSE_UNICODE AND (NOT DEFINED wxUSE_UNICODE_UTF8 OR NOT wxUSE_UNICODE_UTF8))
if(NOT DEFINED wxUSE_UNICODE_UTF8 OR NOT wxUSE_UNICODE_UTF8)
# This is also checked in setup.cmake, but setup.cmake will run after options.cmake.
include(CheckTypeSize)
check_type_size(wchar_t SIZEOF_WCHAR_T)