Fix windres module argument flattening

pull/5584/head
ePirat 5 years ago committed by Jussi Pakkanen
parent 1e182b51c6
commit b347f00dc0
  1. 4
      mesonbuild/modules/windows.py
  2. 3
      test cases/windows/5 resources/res/meson.build

@ -23,7 +23,7 @@ from . import get_include_args
from . import ModuleReturnValue from . import ModuleReturnValue
from . import ExtensionModule from . import ExtensionModule
from ..interpreter import CustomTargetHolder from ..interpreter import CustomTargetHolder
from ..interpreterbase import permittedKwargs, FeatureNewKwargs from ..interpreterbase import permittedKwargs, FeatureNewKwargs, flatten
from ..dependencies import ExternalProgram from ..dependencies import ExternalProgram
class ResourceCompilerType(enum.Enum): class ResourceCompilerType(enum.Enum):
@ -78,7 +78,7 @@ class WindowsModule(ExtensionModule):
@FeatureNewKwargs('windows.compile_resources', '0.47.0', ['depend_files', 'depends']) @FeatureNewKwargs('windows.compile_resources', '0.47.0', ['depend_files', 'depends'])
@permittedKwargs({'args', 'include_directories', 'depend_files', 'depends'}) @permittedKwargs({'args', 'include_directories', 'depend_files', 'depends'})
def compile_resources(self, state, args, kwargs): def compile_resources(self, state, args, kwargs):
extra_args = mesonlib.stringlistify(kwargs.get('args', [])) extra_args = mesonlib.stringlistify(flatten(kwargs.get('args', [])))
wrc_depend_files = extract_as_list(kwargs, 'depend_files', pop = True) wrc_depend_files = extract_as_list(kwargs, 'depend_files', pop = True)
wrc_depends = extract_as_list(kwargs, 'depends', pop = True) wrc_depends = extract_as_list(kwargs, 'depends', pop = True)
for d in wrc_depends: for d in wrc_depends:

@ -2,7 +2,8 @@ win = import('windows')
res = win.compile_resources('myres.rc', res = win.compile_resources('myres.rc',
depend_files: 'sample.ico', depend_files: 'sample.ico',
include_directories : inc) include_directories : inc,
args : [['-DFOO'], '-DBAR'])
# test that with MSVC tools, LIB/LINK invokes CVTRES with correct /MACHINE # test that with MSVC tools, LIB/LINK invokes CVTRES with correct /MACHINE
static_library('reslib', res, 'dummy.c') static_library('reslib', res, 'dummy.c')

Loading…
Cancel
Save