meson: make consistent usage of host_os
Small main meson.build refactoring.
This commit is contained in:
parent
bd12bf23e7
commit
cc3f44f0a8
49
meson.build
49
meson.build
|
@ -12,10 +12,6 @@ else
|
||||||
build_root = meson.build_root()
|
build_root = meson.build_root()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if host_machine.system() == 'darwin'
|
|
||||||
add_languages('objc')
|
|
||||||
endif
|
|
||||||
|
|
||||||
pkgconfig = import('pkgconfig')
|
pkgconfig = import('pkgconfig')
|
||||||
|
|
||||||
version_arr = meson.project_version().split('.')
|
version_arr = meson.project_version().split('.')
|
||||||
|
@ -28,6 +24,12 @@ version_name = 'v-' + version_major + '.' + version_minor
|
||||||
cc = meson.get_compiler('c')
|
cc = meson.get_compiler('c')
|
||||||
host_os = host_machine.system()
|
host_os = host_machine.system()
|
||||||
|
|
||||||
|
sys_linux = ['linux'].contains(host_os)
|
||||||
|
sys_bsd = ['bsd', 'freebsd', 'dragonfly', 'netbsd', 'openbsd'].contains(host_os)
|
||||||
|
sys_windows = ['windows', 'cygwin'].contains(host_os)
|
||||||
|
sys_osx = ['darwin'].contains(host_os)
|
||||||
|
sys_sun = ['sunos'].contains(host_os)
|
||||||
|
|
||||||
if host_os == 'linux'
|
if host_os == 'linux'
|
||||||
if cc.has_header_symbol('features.h', '__UCLIBC__')
|
if cc.has_header_symbol('features.h', '__UCLIBC__')
|
||||||
host_os = 'linux-uclibc'
|
host_os = 'linux-uclibc'
|
||||||
|
@ -38,24 +40,15 @@ if host_os == 'linux'
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#prepare a special linker args flag for binaries on macos
|
if sys_osx
|
||||||
bin_linker_args = []
|
add_languages('objc')
|
||||||
if host_machine.system() == 'darwin'
|
|
||||||
bin_linker_args = ['-pagezero_size', '10000', '-image_base', '100000000']
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
windows = ['windows', 'cygwin']
|
#prepare a special linker args flag for binaries on macos
|
||||||
#bsd for meson 0.46 and 0.47
|
bin_linker_args = []
|
||||||
bsd = ['bsd', 'freebsd', 'dragonfly', 'netbsd', 'openbsd']
|
if sys_osx
|
||||||
linux = ['linux']
|
bin_linker_args = ['-pagezero_size', '10000', '-image_base', '100000000']
|
||||||
osx = ['darwin']
|
endif
|
||||||
sun = ['sunos']
|
|
||||||
|
|
||||||
sys_linux = linux.contains(host_machine.system())
|
|
||||||
sys_bsd = bsd.contains(host_machine.system())
|
|
||||||
sys_windows = windows.contains(host_machine.system())
|
|
||||||
sys_osx = osx.contains(host_machine.system())
|
|
||||||
sys_sun = sun.contains(host_machine.system())
|
|
||||||
|
|
||||||
module_files = []
|
module_files = []
|
||||||
evas_loader_map = []
|
evas_loader_map = []
|
||||||
|
@ -69,14 +62,14 @@ dir_include = join_paths(dir_prefix, get_option('includedir'))
|
||||||
dir_lib = join_paths(dir_prefix, get_option('libdir'))
|
dir_lib = join_paths(dir_prefix, get_option('libdir'))
|
||||||
|
|
||||||
#local paths
|
#local paths
|
||||||
local_lib = join_paths('src', 'lib')
|
local_lib = join_paths('src', 'lib')
|
||||||
local_bindings = join_paths('src', 'bindings')
|
local_bindings = join_paths('src', 'bindings')
|
||||||
local_bin = join_paths('src', 'bin')
|
local_bin = join_paths('src', 'bin')
|
||||||
local_module = join_paths('src', 'modules')
|
local_module = join_paths('src', 'modules')
|
||||||
local_tests = join_paths('src', 'tests')
|
local_tests = join_paths('src', 'tests')
|
||||||
local_benchmark = join_paths('src', 'benchmarks')
|
local_benchmark = join_paths('src', 'benchmarks')
|
||||||
local_examples = join_paths('src', 'examples')
|
local_examples = join_paths('src', 'examples')
|
||||||
local_scripts = join_paths('src', 'scripts')
|
local_scripts = join_paths('src', 'scripts')
|
||||||
|
|
||||||
dev_cflags = []
|
dev_cflags = []
|
||||||
dev_cflags_try = [
|
dev_cflags_try = [
|
||||||
|
@ -224,7 +217,7 @@ elif sys_osx
|
||||||
sys_mod_extension = 'so'
|
sys_mod_extension = 'so'
|
||||||
config_h.set('environ', '(*_NSGetEnviron())')
|
config_h.set('environ', '(*_NSGetEnviron())')
|
||||||
else
|
else
|
||||||
error('System ' + host_machine.system() + ' not known')
|
error('System ' + host_os + ' not known')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if sys_linux or sys_bsd or sys_sun
|
if sys_linux or sys_bsd or sys_sun
|
||||||
|
|
Loading…
Reference in New Issue