meson: unify system properties

this unifies the system types into 4 boolean flags
This fixes the fact that meson changed the system string accross
versions.

Differential Revision: https://phab.enlightenment.org/D7144
This commit is contained in:
Marcel Hollerbach 2018-10-04 18:29:56 +02:00
parent 124fbd3fa3
commit 347dc66ba9
7 changed files with 22 additions and 17 deletions

View File

@ -108,15 +108,20 @@ bsd = ['bsd', 'freebsd', 'dragonfly', 'netbsd']
linux = ['linux']
osx = ['darwin']
if linux.contains(target_machine.system()) or bsd.contains(target_machine.system())
sys_linux = linux.contains(target_machine.system())
sys_bsd = bsd.contains(target_machine.system())
sys_windows = windows.contains(target_machine.system())
sys_osx = osx.contains(target_machine.system())
if sys_linux == true or sys_bsd == true
sys_lib_extension = 'so'
sys_exe_extension = ''
sys_mod_extension = 'so'
elif windows.contains(target_machine.system())
elif sys_windows == true
sys_lib_extension = 'dll'
sys_exe_extension = 'exe'
sys_mod_extension = 'dll'
elif osx.contains(target_machine.system())
elif sys_osx == true
sys_lib_extension = 'dylib'
sys_exe_extension = ''
sys_mod_extension = 'dylib'

View File

@ -165,7 +165,7 @@ ecore_src = [
'ecore_main_common.h'
]
if target_machine.system() == 'windows'
if sys_windows == true
#nothing for now ... needs testing
else
ecore_src += ['ecore_signal.c', 'ecore_exe_posix.c']

View File

@ -1,7 +1,7 @@
ecore_con_deps = []
ecore_con_pub_deps = [eina, eo, efl, ecore]
if target_machine.system() == 'windows' or target_machine.system() == 'cygwin'
if sys_windows == true
ipv6 = cc.compiles('''
#include <ws2tcpip.h>
struct ipv6_mreq tmp;
@ -68,7 +68,7 @@ pub_eo_files = [
'efl_net_ip_address.eo',
]
if target_machine.system() == 'windows'
if sys_windows == true
pub_eo_files += [
'efl_net_socket_windows.eo',
'efl_net_dialer_windows.eo',
@ -160,7 +160,7 @@ ecore_con_src = [
'efl_net_ip_address.c'
]
if target_machine.system() == 'windows'
if sys_windows == true
ecore_con_src += [
'efl_net_socket_windows.c',
'efl_net_dialer_windows.c',

View File

@ -9,7 +9,7 @@ ecore_file_src = [
'ecore_file_private.h'
]
if target_machine.system() == 'windows'
if sys_windows == true
ecore_file_src += [ 'ecore_file_monitor_win32.c']
elif cc.has_header('sys/inotify.h')
ecore_file_src += [ 'ecore_file_monitor_inotify.c']

View File

@ -185,7 +185,7 @@ sources = [
'eina_vpath_xdg.c'
]
if target_machine.system() == 'cygwin'
if sys_windows == true
sources += 'eina_file_win32.c'
else
sources += 'eina_file.c'
@ -273,7 +273,7 @@ if cc.has_header_symbol('pthread.h', 'pthread_barrier_init')
eina_config.set('EINA_HAVE_PTHREAD_BARRIER', '1')
endif
if target_machine.system() == 'linux'
if sys_linux == true
pthread_np_header_file = 'pthread.h'
pthread_setname_np_api = 'pthread_setname_np'
pthread_args = '-D_GNU_SOURCE'
@ -335,7 +335,7 @@ if cc.has_header_symbol('pthread.h', 'pthread_spin_init')
eina_config.set('EINA_HAVE_POSIX_SPINLOCK', '1')
endif
if target_machine.system() == 'darwin'
if sys_osx == true
if cc.has_header_symbol('libkern/OSAtomic.h', 'OSSpinLockTry')
eina_config.set('EINA_HAVE_OSX_SPINLOCK', 1)
endif

View File

@ -50,14 +50,14 @@ eio_src = [
linker_args = []
if target_machine.system() == 'windows'
if sys_windows == true
eio_src += ['eio_monitor_win32.c']
elif target_machine.system() == 'darwin'
elif sys_osx == true
eio_src += ['eio_monitor_cocoa.c']
linker_args = [['-framework', 'CoreServices']]
elif cc.has_header('sys/inotify.h')
elif sys_linux == true
eio_src += ['eio_monitor_inotify.c']
elif target_machine.system() == 'bsd'
elif sys_bsd == true
eio_src += ['eio_monitor_kevent.c']
endif

View File

@ -8,7 +8,7 @@ evas_src += files([
])
luajit = dependency('luajit')
if target_machine.system() == 'darwin'
if sys_osx == true
# luajit on macos is broken, this means we need to generate our own dependency with our arguments, a library later still needs to link to luajit for the pagesize argument thingy
luajit = declare_dependency(
include_directories: include_directories(luajit.get_pkgconfig_variable('includedir')),
@ -16,4 +16,4 @@ if target_machine.system() == 'darwin'
)
endif
evas_deps += luajit
evas_deps += luajit