[Git][wxwidgets/wxwidgets][master] 5 commits: CMake: Generate appropriate expat_config.h for Expat

3 views
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Mar 24, 2026, 11:18:53 PM (5 days ago) Mar 24
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets

Commits:

  • 57edf800
    by Vadim Zeitlin at 2026-03-24T22:17:30+01:00
    CMake: Generate appropriate expat_config.h for Expat
    
    Expat built by CMake always used hardcoded values in macconfig.h which
    could be inappropriate for the system it was being built on (without
    mentioning that using a notionally Mac-specific file under non-Mac
    systems was confusing), e.g. this header always defined HAVE_GETRANDOM
    even on Linux systems without <sys/random.h>.
    
    Generate the correct header, with the results of the check for the
    current system and use it instead.
    
  • 8af1ec05
    by Vadim Zeitlin at 2026-03-24T22:23:07+01:00
    CMake: Build wxxml in non-GUI builds too
    
    This library is not GUI-specific, so build it even when GUI is disabled
    and also don't disable it if XRC support is disabled as it could still
    be wanted independently of it.
    
  • a2f5a533
    by Vadim Zeitlin at 2026-03-25T02:20:50+01:00
    Try running wxMSW/Univ builds using Debian Sid
    
    Somehow wine64 package doesn't seem to exist in Debian Testing any more.
    
  • 25b02a64
    by mcorino at 2026-03-25T03:48:27+01:00
    Avoid debug messages about wrong FromDIP() use in wxMSW
    
    Postpone initializing the fields that use FromDIP() till after window
    has been created as FromDIP() doesn't return correct result for a window
    that hasn't been created yet.
    
    Closes #26313.
    
  • da02b000
    by Vadim Zeitlin at 2026-03-25T03:48:38+01:00
    Merge branch 'cmake-xml'
    
    XML/Expat-related fixes for CMake.
    
    See #26315.
    

5 changed files:

Changes:

  • .github/workflows/ci_msw_cross.yml
    ... ... @@ -82,7 +82,7 @@ jobs:
    82 82
                 debian_release: stable
    
    83 83
                 triplet: i686-w64-mingw32
    
    84 84
               - name: wxMSW/Univ
    
    85
    -            debian_release: testing
    
    85
    +            debian_release: unstable
    
    86 86
                 configure_flags: --enable-universal --disable-compat32 --disable-debug --disable-optimise
    
    87 87
                 minimal: true
    
    88 88
         env:
    

  • build/cmake/init.cmake
    ... ... @@ -249,8 +249,8 @@ endif()
    249 249
     # Constants for setup.h creation
    
    250 250
     if(NOT wxUSE_EXPAT)
    
    251 251
         set(wxUSE_XRC OFF)
    
    252
    +    set(wxUSE_XML OFF)
    
    252 253
     endif()
    
    253
    -set(wxUSE_XML ${wxUSE_XRC})
    
    254 254
     
    
    255 255
     if(DEFINED wxUSE_OLE AND wxUSE_OLE)
    
    256 256
         set(wxUSE_OLE_AUTOMATION ON)
    

  • build/cmake/lib/expat.cmake
    ... ... @@ -16,13 +16,34 @@ if(wxUSE_EXPAT STREQUAL "sys")
    16 16
     endif()
    
    17 17
     
    
    18 18
     if(wxUSE_EXPAT STREQUAL "builtin")
    
    19
    +    set(wxEXPAT_DIR ${wxSOURCE_DIR}/src/expat/expat)
    
    20
    +
    
    19 21
         # TODO: implement building expat via its CMake file, using
    
    20 22
         # add_subdirectory or ExternalProject_Add
    
    23
    +    #
    
    24
    +    # Until this is done, at least use Expat's own CMake file to check for the
    
    25
    +    # features it needs, so that we can produce the appropriate expat_config.h.
    
    26
    +    include(${wxEXPAT_DIR}/ConfigureChecks.cmake)
    
    27
    +
    
    28
    +    # Also define some options normally set by Expat's CMakeLists.txt.
    
    29
    +    set(XML_DTD 1)
    
    30
    +    set(XML_GE 1)
    
    31
    +    set(XML_NS 1)
    
    32
    +    set(XML_CONTEXT_BYTES 1024)
    
    33
    +
    
    34
    +    configure_file(${wxEXPAT_DIR}/expat_config.h.cmake
    
    35
    +        ${wxBINARY_DIR}/libs/expat/expat_config.h
    
    36
    +    )
    
    37
    +
    
    21 38
         wx_add_builtin_library(wxexpat
    
    22 39
             src/expat/expat/lib/xmlparse.c
    
    23 40
             src/expat/expat/lib/xmlrole.c
    
    24 41
             src/expat/expat/lib/xmltok.c
    
    25 42
         )
    
    43
    +
    
    44
    +    target_include_directories(wxexpat PRIVATE ${wxBINARY_DIR}/libs/expat)
    
    45
    +    target_compile_definitions(wxexpat PRIVATE HAVE_EXPAT_CONFIG_H)
    
    46
    +
    
    26 47
         set(EXPAT_LIBRARIES wxexpat)
    
    27
    -    set(EXPAT_INCLUDE_DIRS ${wxSOURCE_DIR}/src/expat/expat/lib)
    
    48
    +    set(EXPAT_INCLUDE_DIRS ${wxEXPAT_DIR}/lib)
    
    28 49
     endif()

  • build/cmake/options.cmake
    ... ... @@ -263,6 +263,8 @@ wx_option(wxUSE_PROTOCOL_FILE "FILE support in wxProtocol")
    263 263
     
    
    264 264
     wx_option(wxUSE_THREADS "use threads")
    
    265 265
     
    
    266
    +wx_option(wxUSE_XML "use the XML library")
    
    267
    +
    
    266 268
     if(WIN32)
    
    267 269
         wx_option(wxUSE_DBGHELP "use dbghelp.dll API")
    
    268 270
         wx_option(wxUSE_INICONF "use wxIniConfig")
    
    ... ... @@ -282,7 +284,6 @@ wx_option(wxUSE_MS_HTML_HELP "use MS HTML Help (win32)")
    282 284
     wx_option(wxUSE_HTML "use wxHTML sub-library")
    
    283 285
     wx_option(wxUSE_WXHTML_HELP "use wxHTML-based help")
    
    284 286
     wx_option(wxUSE_XRC "use XRC resources sub-library")
    
    285
    -wx_option(wxUSE_XML "use the xml library (overruled by wxUSE_XRC)")
    
    286 287
     wx_option(wxUSE_AUI "use AUI docking library")
    
    287 288
     wx_option(wxUSE_PROPGRID "use wxPropertyGrid library")
    
    288 289
     wx_option(wxUSE_RIBBON "use wxRibbon library")
    

  • src/propgrid/propgrid.cpp
    ... ... @@ -409,17 +409,6 @@ void wxPropertyGrid::Init1()
    409 409
     
    
    410 410
         m_doubleBuffer = nullptr;
    
    411 411
     
    
    412
    -#ifndef wxPG_ICON_WIDTH
    
    413
    -    m_iconWidth = FromDIP(11);
    
    414
    -    m_iconHeight = FromDIP(11);
    
    415
    -#else
    
    416
    -    m_iconWidth = FromDIP(wxPG_ICON_WIDTH);
    
    417
    -    m_iconHeight = FromDIP(wxPG_ICON_WIDTH);
    
    418
    -#endif
    
    419
    -
    
    420
    -    m_gutterWidth = wxMax(0, (FromDIP(16) - m_iconWidth) / 2);
    
    421
    -    m_subgroup_extramargin = m_iconWidth + m_gutterWidth;
    
    422
    -
    
    423 412
         m_lineHeight = 0;
    
    424 413
     
    
    425 414
         m_width = m_height = 0;
    
    ... ... @@ -476,8 +465,14 @@ void wxPropertyGrid::Init2()
    476 465
     
    
    477 466
         m_iconWidth = s_expandbmp.GetWidth();
    
    478 467
         m_iconHeight = s_expandbmp.GetHeight();
    
    468
    +#else
    
    469
    +    m_iconWidth = FromDIP(wxPG_ICON_WIDTH);
    
    470
    +    m_iconHeight = FromDIP(wxPG_ICON_WIDTH);
    
    479 471
     #endif
    
    480 472
     
    
    473
    +    m_gutterWidth = wxMax(0, (FromDIP(16) - m_iconWidth) / 2);
    
    474
    +    m_subgroup_extramargin = m_iconWidth + m_gutterWidth;
    
    475
    +
    
    481 476
         m_curcursor = wxCURSOR_ARROW;
    
    482 477
         m_cursorSizeWE = wxCursor(wxCURSOR_SIZEWE);
    
    483 478
     
    

Reply all
Reply to author
Forward
0 new messages