Skip to content

gtest package broken on Windows using gcc toolchain #8202

@dkaszews

Description

@dkaszews

Xmake Version

v3.0.1+HEAD.3350cc5ab

Operating System Version and Architecture

Windows 11 24H2 26100.4946

Describe Bug

#8157 made gtest installed using cmake by default. This does not appear to correctly forward the toolchain, as xmake config --toolchain=gcc fails on Windows. Adding { configs = { cmake = false }} fixes the issue temporarily, which shows the root cause is the new default (making a new option the default is probably not a great idea).

Expected Behavior

gtest can be installed

Project Configuration

add_requires('gtest >= 1.14.0')
target('test')
    set_kind('binary')
    add_files('**.cpp')
    add_packages('gtest')

Additional Information and Error Logs

I am not able to provide full logs as the Windows machine in questions is a corporate one I cannot downloads logs from, but the relevant part is:

The C compiler identification is MSVC 19.44.35214.0
The CXX compiler identification is MSVC 19.44.35214.0
...
Check for working C compiler: C:/Program Files/Microsoft Visual Studio/Community/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64/cl.exe - broken

The MSVC toolchain being broken is a known issue on our side, that's why we use GCC instead, which now appears ignored. We should never see this message as MSVC compiler should not be used at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions