swift: Support swift_args

Fixes #12533
pull/12672/head
Sergey Vlasov 11 months ago committed by Dylan Baker
parent f1035e0cd0
commit 5ff6049945
  1. 1
      mesonbuild/backend/ninjabackend.py
  2. 1
      test cases/swift/8 extra args/main.swift
  3. 18
      test cases/swift/8 extra args/meson.build

@ -2172,6 +2172,7 @@ class NinjaBackend(backends.Backend):
srctreedir = os.path.normpath(os.path.join(self.environment.get_build_dir(), self.build_to_src, expdir))
sargs = swiftc.get_include_args(srctreedir, False)
compile_args += sargs
compile_args += target.get_extra_args('swift')
link_args = swiftc.get_output_args(os.path.join(self.environment.get_build_dir(), self.get_target_filename(target)))
link_args += self.build.get_project_link_args(swiftc, target.subproject, target.for_machine)
link_args += self.build.get_global_link_args(swiftc, target.for_machine)

@ -0,0 +1,18 @@
project('extra args', 'swift')
trace_fname = 'trace.json'
lib = static_library('main',
'main.swift',
swift_args: [
'-emit-loaded-module-trace',
'-emit-loaded-module-trace-path', '../' + trace_fname
],
)
custom_target('trace_check',
output: trace_fname,
command: ['cat', '@OUTPUT@'],
depends: lib,
build_always: true,
)
Loading…
Cancel
Save