Skip to content

[wxwidgets] Build error on Ubuntu with triplet=x64-mingw-static #26571

@nnn1590

Description

@nnn1590

Host Environment

  • OS: Ubuntu 20.04 LTS amd64
  • Compiler: x86_64-w64-mingw32-gcc (GCC) 9.3-posix 20200320

To Reproduce
Steps to reproduce the behavior:
./vcpkg --triplet=x64-mingw-static install wxwidgets

Failure logs

-- Building x64-mingw-static-dbg
-- Building x64-mingw-static-rel
CMake Error at buildtrees/versioning_/versions/wxwidgets/39e102a05ff8b8e2f8a137b1f3bbe8e44f88a8ad/portfile.cmake:123 (file):
  file RENAME failed to rename

    /.../vcpkg/packages/wxwidgets_x64-mingw-static/bin/wx-config

  to

    /.../vcpkg/packages/wxwidgets_x64-mingw-static/tools/wxwidgets/wx-config

  because: No such file or directory
-- Building x64-mingw-static-dbg
-- Building x64-mingw-static-rel
-- Installing: /.../vcpkg/packages/wxwidgets_x64-mingw-static/lib/mswud/wx/setup.h
CMake Error at scripts/cmake/vcpkg_replace_string.cmake:2 (file):
  file failed to open for reading (No such file or directory):

    /.../vcpkg/packages/wxwidgets_x64-mingw-static/include/wx-3.2/wx/debug.h

Additional context
After this change, build succeeded. But I don't know if this will cause problems in other configurations.

diff --git a/ports/wxwidgets/portfile.cmake b/ports/wxwidgets/portfile.cmake
index 5bee63f..0023c8c 100644
--- a/ports/wxwidgets/portfile.cmake
+++ b/ports/wxwidgets/portfile.cmake
@@ -117,7 +117,7 @@ file(REMOVE_RECURSE
 )
 
 set(tools wxrc)
-if(NOT VCPKG_TARGET_IS_WINDOWS OR NOT VCPKG_HOST_IS_WINDOWS)
+if(NOT VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_HOST_IS_WINDOWS)
     list(APPEND tools wxrc-3.2)
     file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
     file(RENAME "${CURRENT_PACKAGES_DIR}/bin/wx-config" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/wx-config")
@@ -189,7 +189,7 @@ if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/mswud/wx/setup.h")
 endif()
 
 if(NOT "debug-support" IN_LIST FEATURES)
-    if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_HOST_IS_WINDOWS)
+    if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_HOST_IS_WINDOWS)
         vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/wx/debug.h" "#define wxDEBUG_LEVEL 1" "#define wxDEBUG_LEVEL 0")
     else()
         vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/wx-3.2/wx/debug.h" "#define wxDEBUG_LEVEL 1" "#define wxDEBUG_LEVEL 0")

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:community-tripletA PR or issue related to community triplets not officially validated by the vcpkg team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions