fix: meson.build
This commit is contained in:
parent
28e9f44dee
commit
9a1b5deeef
1 changed files with 10 additions and 4 deletions
14
meson.build
14
meson.build
|
|
@ -24,7 +24,8 @@ project (
|
||||||
'default_library=static',
|
'default_library=static',
|
||||||
'cpp_eh=none',
|
'cpp_eh=none',
|
||||||
'b_vscrt=static_from_buildtype',
|
'b_vscrt=static_from_buildtype',
|
||||||
'b_lto=true'
|
'b_lto=true',
|
||||||
|
'b_lundef=false',
|
||||||
],
|
],
|
||||||
meson_version: '>=0.56.0')
|
meson_version: '>=0.56.0')
|
||||||
|
|
||||||
|
|
@ -34,7 +35,7 @@ find_program ('hostname', required: true)
|
||||||
|
|
||||||
cpp = meson.get_compiler ('cpp')
|
cpp = meson.get_compiler ('cpp')
|
||||||
sys = host_machine.system ()
|
sys = host_machine.system ()
|
||||||
target = host_machine.cpu_family ()
|
target = build_machine.cpu_family ()
|
||||||
version = meson.project_version ()
|
version = meson.project_version ()
|
||||||
count = run_command ('git', 'rev-list', '--count', 'HEAD').stdout ().strip ()
|
count = run_command ('git', 'rev-list', '--count', 'HEAD').stdout ().strip ()
|
||||||
|
|
||||||
|
|
@ -96,7 +97,7 @@ if clang or gcc
|
||||||
|
|
||||||
if optmize
|
if optmize
|
||||||
if (clang or gcc) and not mac
|
if (clang or gcc) and not mac
|
||||||
if not aarch64
|
if not aarch64 and not (clang and win32)
|
||||||
ccflags += [
|
ccflags += [
|
||||||
'-fdata-sections',
|
'-fdata-sections',
|
||||||
'-ffunction-sections'
|
'-ffunction-sections'
|
||||||
|
|
@ -108,7 +109,7 @@ if clang or gcc
|
||||||
ldflags += '-flto-partition=none'
|
ldflags += '-flto-partition=none'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if not aarch64
|
if not aarch64 and not (clang and win32)
|
||||||
ldflags += [
|
ldflags += [
|
||||||
'-Wl,--version-script=../ldscript.lds',
|
'-Wl,--version-script=../ldscript.lds',
|
||||||
'-Wl,--gc-sections'
|
'-Wl,--gc-sections'
|
||||||
|
|
@ -219,6 +220,11 @@ elif win32 and (clang or gcc)
|
||||||
'-luser32',
|
'-luser32',
|
||||||
'-lws2_32'
|
'-lws2_32'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if clang
|
||||||
|
ldflags += '-Wl,/MACHINE:X86'
|
||||||
|
ccflags += '-Wl,/MACHINE:X86'
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
add_global_arguments (ccflags, language: 'cpp')
|
add_global_arguments (ccflags, language: 'cpp')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue