Skip to content

Commit

Permalink
build: Reuse some flags
Browse files Browse the repository at this point in the history
  • Loading branch information
lhmouse committed Nov 2, 2024
1 parent 0b6aa14 commit 38a67f9
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,19 @@ mcfgthread_version_o = import('windows').compile_resources(
args: [ '-I.', '-c65001' ],
depend_files: [ 'mcfgthread/version.h.in', 'mcfgthread/version.manifest' ])

lib_mcfgthread_dll_c_args = cc.get_supported_arguments(
'-D__MCF_BUILDING_DLL', '-mcmodel=small', '-ffreestanding',
'-fasynchronous-unwind-tables')

lib_mcfgthread_dll_link_args = cc.get_supported_link_arguments(
'-nostdlib', '-Wl,--gc-sections', '-Wl,--exclude-all-symbols', '-Wl,--kill-at',
'-Wl,--entry,__MCF_dll_startup@@Z', '-Wl,--enable-auto-image-base',
'-Wl,--subsystem,windows:6.1')

lib_mcfgthread_minimal_dll = shared_library('mcfgthread-minimal',
c_pch: 'mcfgthread/xprecompiled.h',
c_args: [ '-D__MCF_BUILDING_DLL', cc.get_supported_arguments('-mcmodel=small'),
'-ffreestanding', '-fasynchronous-unwind-tables' ],
link_args: [ '-nostdlib', '-Wl,--entry,__MCF_dll_startup@@Z',
'-Wl,--gc-sections', '-Wl,--exclude-all-symbols', '-Wl,--kill-at',
'-Wl,--enable-auto-image-base', '-Wl,--subsystem,windows:6.1' ],
c_args: lib_mcfgthread_dll_c_args,
link_args: lib_mcfgthread_dll_link_args,
sources: [ mcfgthread_src_min, mcfgthread_version_o ],
dependencies: [ dep_kernel32, dep_ntdll ],
soversion: ver.get('abi_major'),
Expand All @@ -338,11 +344,8 @@ lib_mcfgthread_minimal_dll = shared_library('mcfgthread-minimal',

lib_mcfgthread_dll = shared_library('mcfgthread',
c_pch: 'mcfgthread/xprecompiled.h',
c_args: [ '-D__MCF_BUILDING_DLL', cc.get_supported_arguments('-mcmodel=small'),
'-ffreestanding', '-fasynchronous-unwind-tables' ],
link_args: [ '-nostdlib', '-Wl,--entry,__MCF_dll_startup@@Z',
'-Wl,--gc-sections', '-Wl,--exclude-all-symbols', '-Wl,--kill-at',
'-Wl,--enable-auto-image-base', '-Wl,--subsystem,windows:6.1' ],
c_args: lib_mcfgthread_dll_c_args,
link_args: lib_mcfgthread_dll_link_args,
objects: lib_mcfgthread_minimal_dll.extract_objects(mcfgthread_src_min),
sources: [ mcfgthread_src_ex, mcfgthread_version_o ],
dependencies: [ dep_kernel32, dep_ntdll ],
Expand All @@ -356,7 +359,8 @@ if host_machine.system() == 'cygwin'
else
lib_mcfgthread_a = static_library('mcfgthread',
c_pch: 'mcfgthread/xprecompiled.h',
c_args: [ '-ffreestanding', '-fasynchronous-unwind-tables' ],
c_args: [ '-ffunction-sections', '-ffreestanding',
'-fasynchronous-unwind-tables' ],
sources: [ mcfgthread_src_min, mcfgthread_src_ex, ],
dependencies: [ dep_kernel32, dep_ntdll ],
install: true)
Expand Down

0 comments on commit 38a67f9

Please sign in to comment.