Skip to content

Can not build rc file with configs_file #12913

@star-hengxing

Description

@star-hengxing

Describe the bug
When use configs_file to specify toolchain, meson generate error ninja file.

$ meson setup build --native-file=build/configs_file.txt
$ cd build
$ ninja
ninja: error: 'C:/Users/x/scoop/apps/mingw/current/bin/windres', needed by 'src_test.rc_test.o', missing and no known rule to make it

build.ninja:

build src_test.rc_test.o: CUSTOM_COMMAND_DEP ../src/test.rc | C$:/Users/x/scoop/apps/mingw/current/bin/windres
 DEPFILE = "src_test.rc_test.o.d"
 DEPFILE_UNQUOTED = src_test.rc_test.o.d
 COMMAND = "C:\Users\x\scoop\apps\mingw\current\bin\windres" "../src/test.rc" "src_test.rc_test.o" "--preprocessor-arg=-MD" "--preprocessor-arg=-MQsrc_test.rc_test.o" "--preprocessor-arg=-MFsrc_test.rc_test.o.d"
 description = Compiling$ Windows$ resource$ src_test.rc

Why rc target need compiler as dep?

It's already been detected here.

rescomp = ExternalProgram('windres', silent=True)

To Reproduce

meson.build:

project('test', 'cpp')

windows = import('windows')

rc = windows.compile_resources('src/test.rc')

executable('test_rc', 'src/test.cpp', rc)

configs_file.txt:

[binaries]
c=['C:\Users\x\scoop\apps\mingw\current\bin\x86_64-w64-mingw32-gcc']
cpp=['C:\Users\x\scoop\apps\mingw\current\bin\x86_64-w64-mingw32-g++']
ld=['C:\Users\x\scoop\apps\mingw\current\bin\x86_64-w64-mingw32-g++']
ar=['C:\Users\x\scoop\apps\mingw\current\bin\ar']
strip=['C:\Users\x\scoop\apps\mingw\current\bin\strip']
ranlib=['C:\Users\x\scoop\apps\mingw\current\bin\ranlib']
windres=['C:\Users\x\scoop\apps\mingw\current\bin\windres']
cmake=['cmake']

[built-in options]
c_args=['-m64']
cpp_args=['-m64']
c_link_args=['-m64', '-m64']
cpp_link_args=['-m64', '-m64']

Expected behavior
Remove compiler dep.

system parameters

  • Native build
  • Windows 10
  • Python 3.12.2
  • Meson 1.3.2
  • Ninja 1.11.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions