Skip to content

SDK directory detection error of MinGW under Linux #6660

@Redbeanw44602

Description

@Redbeanw44602

Xmake Version

xmake v3.0.1+HEAD.3350cc5ab

Operating System Version and Architecture

Manjaro Linux

Describe Bug

As far as I know, in ArchLinux or Debian, Mingw may have the following two SDK directories.

  • /usr/x86_64-w64-mingw32
  • /usr/i686-w64-mingw32

Xmake generally specifies sdkdir as /usr

This will cause CMAKE_FIND_ROOT_PATH to be configured incorrectly

envs.CMAKE_FIND_ROOT_PATH = sdkdir

This ultimately results in directories such as /usr/include being added to the header file search directory, causing a large number of compilation errors.

Expected Behavior

The sdkdir detection should be fixed, based on testing, everything works fine when --sdk=/usr/x86_64-w64-mingw32 (or i686) is manually specified.

Project Configuration

(under linux)

xrepo add-repo https://github.com/Redbeanw44602/xmake-repo-testing
xrepo install -p mingw -vD td

Additional Information and Error Logs

[4/506] /usr/bin/x86_64-w64-mingw32-g++ -DNOMINMAX -DNTDDI_VERSION=0x06020000 -DPSAPI_VERSION=1 -DUNICODE -DWIN32_LEAN_AND_MEAN -DWINVER=0x0602 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_UNICODE -D_WIN32_WINNT=0x0602 -I/home/username/.xmake/cache/packages/2507/t/td/1.8.51/source/td/tdutils -I/home/username/.xmake/cache/packages/2507/t/td/1.8.51/source/td/build/tdutils --->[[[[-isystem /usr/include]]]] -m64 -std=c++17 -fno-omit-frame-pointer -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wa,-mbig-obj -Wall -Wextra -Wimplicit-fallthrough=2 -Wpointer-arith -Wcast-qual -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Walloc-zero -Wlogical-op -Wno-tautological-compare -Wpointer-arith -Wvla -Wnon-virtual-dtor -Wno-unused-parameter -Wconversion -Wno-sign-conversion -Wdeprecated -Wodr -flto-odr-type-merging -Wno-psabi -Wno-maybe-uninitialized -Wno-cast-function-type -Wno-redundant-move -Wno-stringop-overflow -ftrack-macro-expansion=0 -m64 -O3 -DNDEBUG -MD -MT tdutils/CMakeFiles/tdutils.dir/td/utils/port/Clocks.cpp.obj -MF tdutils/CMakeFiles/tdutils.dir/td/utils/port/Clocks.cpp.obj.d -o tdutils/CMakeFiles/tdutils.dir/td/utils/port/Clocks.cpp.obj -c /home/username/.xmake/cache/packages/2507/t/td/1.8.51/source/td/tdutils/td/utils/port/Clocks.cpp
FAILED: tdutils/CMakeFiles/tdutils.dir/td/utils/port/Clocks.cpp.obj 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions