aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-12-04 20:38:07 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-12-07 13:05:31 +0100
commit500a36ba3d3d00ed292ed3e85bb9ac40a55bd2a9 (patch)
treed19bbb3272cf471ccda916cf4dc86e0250171392
parentmeson: enable cross compiling (diff)
downloadefl-500a36ba3d3d00ed292ed3e85bb9ac40a55bd2a9.tar.gz
meson: add inital support for windows compilation
Differential Revision: https://phab.enlightenment.org/D7416
-rw-r--r--header_checks/meson.build5
-rw-r--r--meson.build28
-rw-r--r--src/bin/elementary/meson.build60
-rw-r--r--src/lib/ecore/meson.build3
-rw-r--r--src/lib/ecore_audio/meson.build7
-rw-r--r--src/lib/eina/meson.build6
-rw-r--r--src/lib/elementary/meson.build7
-rw-r--r--src/lib/evil/meson.build69
-rw-r--r--src/lib/evil/regex/meson.build10
-rw-r--r--src/modules/ecore_evas/meson.build5
-rw-r--r--src/modules/emotion/generic/meson.build14
-rw-r--r--src/static_libs/draw/meson.build15
-rw-r--r--src/static_libs/rg_etc/meson.build7
13 files changed, 172 insertions, 64 deletions
diff --git a/header_checks/meson.build b/header_checks/meson.build
index 0b4ffe35fc..aebc163b2e 100644
--- a/header_checks/meson.build
+++ b/header_checks/meson.build
@@ -194,3 +194,8 @@ endif
config_h.set('SIZEOF_INT', cc.sizeof('int'))
config_h.set('SIZEOF_LONG', cc.sizeof('long'))
+
+if sys_windows == true
+ config_h.set('HAVE_DLSYM', '1')
+ config_h.set('HAVE_NOTIFY_WIN32', '1')
+endif
diff --git a/meson.build b/meson.build
index 82205daae5..96f11d3ad2 100644
--- a/meson.build
+++ b/meson.build
@@ -45,6 +45,17 @@ if host_machine.system() == 'darwin'
bin_linker_args = ['-pagezero_size', '10000', '-image_base', '100000000']
endif
+windows = ['windows', 'cygwin']
+#bsd for meson 0.46 and 0.47
+bsd = ['bsd', 'freebsd', 'dragonfly', 'netbsd']
+linux = ['linux']
+osx = ['darwin']
+
+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())
+
module_files = []
evas_loader_map = []
@@ -74,6 +85,11 @@ foreach lang : ['c', 'objc', 'cpp']
add_global_arguments('-DNEED_RUN_IN_TREE=1', language: lang)
add_global_arguments('-DEFL_BUILD=1', language: lang)
add_global_arguments('-DELM_INTERNAL_API_ARGESFSDFEFC=1', language: lang)
+ if sys_windows == true
+ add_global_arguments('-DWINVER=0x0601', language: lang)
+ add_global_arguments('-D_WIN32_WINNT=0x0601', language: lang)
+ endif
+
endforeach
config_h = configuration_data()
@@ -150,17 +166,6 @@ endif
config_dir = [include_directories('.')]
eolian_include_directories = []
-windows = ['windows', 'cygwin']
-#bsd for meson 0.46 and 0.47
-bsd = ['bsd', 'freebsd', 'dragonfly', 'netbsd']
-linux = ['linux']
-osx = ['darwin']
-
-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())
-
if sys_linux == true or sys_bsd == true
sys_lib_extension = 'so'
sys_exe_extension = ''
@@ -202,6 +207,7 @@ ecore_evas_wayland_engine_include_dir = []
subprojects = [
# name | option | mod | lib | bin | bench | tests | examples | pkg-config options | name of static libs
+['evil' ,[] , false, true, false, false, false, false, [], []],
['eina' ,[] , false, true, true, true, true, true, [], []],
['eolian' ,[] , false, true, true, false, true, false, ['eina'], []],
['eo' ,[] , false, true, false, true, true, false, ['eina'], []],
diff --git a/src/bin/elementary/meson.build b/src/bin/elementary/meson.build
index a4a8dc2d21..ddc778ba2c 100644
--- a/src/bin/elementary/meson.build
+++ b/src/bin/elementary/meson.build
@@ -155,6 +155,11 @@ elementary_test_src = [
'test.h'
]
+if sys_windows == false
+ link_args = '-rdynamic'
+else
+ link_args = []
+endif
elementary_test = executable('elementary_test',
elementary_test_src,
dependencies: [elementary] + elementary_deps + elementary_pub_deps,
@@ -164,7 +169,7 @@ elementary_test = executable('elementary_test',
'-Delementary_test_LIB_DIR="'+dir_lib+'"',
'-Delementary_test_DATA_DIR="'+join_paths(dir_data,'elementary')+'"'
],
- link_args: '-rdynamic'
+ link_args: link_args
)
elementary_config_src = [
@@ -176,20 +181,22 @@ elementary_config = executable('elementary_config',
dependencies: [elementary] + elementary_deps + elementary_pub_deps,
install: true,
c_args : package_c_args,
- link_args: '-rdynamic'
+ link_args: link_args
)
-elementary_quicklaunch_src = [
- 'quicklaunch.c'
-]
+if sys_windows == false
+ elementary_quicklaunch_src = [
+ 'quicklaunch.c'
+ ]
-elementary_quicklaunch = executable('elementary_quicklaunch',
- elementary_quicklaunch_src,
- dependencies: [elementary] + elementary_deps + elementary_pub_deps,
- install: true,
- c_args : package_c_args,
- link_args: '-rdynamic'
-)
+ elementary_quicklaunch = executable('elementary_quicklaunch',
+ elementary_quicklaunch_src,
+ dependencies: [elementary] + elementary_deps + elementary_pub_deps,
+ install: true,
+ c_args : package_c_args,
+ link_args: link_args
+ )
+endif
elementary_codegen_src = [
'elementary_codegen.c'
@@ -200,7 +207,7 @@ elementary_codegen = executable('elementary_codegen',
dependencies: [elementary] + elementary_deps + elementary_pub_deps,
install: true,
c_args : package_c_args,
- link_args: '-rdynamic'
+ link_args: link_args
)
elm_prefs_cc_src = [
@@ -217,7 +224,7 @@ elm_prefs_cc = executable('elm_prefs_cc',
dependencies: [elementary] + elementary_deps + elementary_pub_deps,
install: true,
c_args : package_c_args,
- link_args: '-rdynamic'
+ link_args: link_args
)
if meson.is_cross_build()
@@ -229,18 +236,19 @@ else
elm_prefs_cc_exe = [env, 'EFL_RUN_IN_TREE=1', elm_prefs_cc.full_path()]
endif
+if sys_windows == false
+ elementary_run_src = [
+ 'run.c'
+ ]
-elementary_run_src = [
- 'run.c'
-]
-
-elementary_run = executable('elementary_run',
- elementary_run_src,
- dependencies: [elementary] + elementary_deps + elementary_pub_deps,
- install: true,
- c_args : package_c_args,
- link_args: '-rdynamic'
-)
+ elementary_run = executable('elementary_run',
+ elementary_run_src,
+ dependencies: [elementary] + elementary_deps + elementary_pub_deps,
+ install: true,
+ c_args : package_c_args,
+ link_args: link_args
+ )
+endif
elementary_perf_src = [
'perf.c',
@@ -262,6 +270,6 @@ elementary_perf = executable('elementary_perf',
'-Delementary_test_LIB_DIR="'+dir_lib+'"',
'-Delementary_test_DATA_DIR="'+join_paths(dir_data,'elementary')+'"'
],
- link_args: '-rdynamic'
+ link_args: link_args
)
diff --git a/src/lib/ecore/meson.build b/src/lib/ecore/meson.build
index 3757bad5f3..b9536b07f4 100644
--- a/src/lib/ecore/meson.build
+++ b/src/lib/ecore/meson.build
@@ -180,11 +180,12 @@ ecore_src = [
if sys_windows == true
#nothing for now ... needs testing
+ ecore_src += ['ecore_exe_win32.c']
else
ecore_src += ['ecore_signal.c', 'ecore_exe_posix.c']
endif
-if get_option('glib') == true
+if get_option('glib') == true and sys_windows == false
ecore_deps += dependency('glib-2.0')
ecore_deps += dependency('gthread-2.0')
config_h.set('GLIB_INTEGRATION_ALWAYS', '1')
diff --git a/src/lib/ecore_audio/meson.build b/src/lib/ecore_audio/meson.build
index b73d53d81b..bc3215e62c 100644
--- a/src/lib/ecore_audio/meson.build
+++ b/src/lib/ecore_audio/meson.build
@@ -70,6 +70,13 @@ if get_option('pulseaudio')
config_h.set('HAVE_PULSE', '1')
endif
+if sys_windows == true
+ ecore_audio_src += [
+ 'ecore_audio_obj_out_wasapi.c'
+ ]
+ ecore_audio_deps += [cc.find_library('ksuser', required: true), cc.find_library('winmm', required: true)]
+endif
+
ecore_audio_lib = library('ecore_audio',
ecore_audio_src, pub_eo_file_target,
dependencies: ecore_audio_pub_deps + [m] + ecore_audio_deps,
diff --git a/src/lib/eina/meson.build b/src/lib/eina/meson.build
index 9535391619..a814673e24 100644
--- a/src/lib/eina/meson.build
+++ b/src/lib/eina/meson.build
@@ -1,6 +1,10 @@
eina_deps = [dl]
eina_pub_deps = [thread_dep]
+if sys_windows == true
+ eina_pub_deps += [evil]
+endif
+
public_sub_headers = [
'eina_promise.h',
'eina_safety_checks.h',
@@ -368,7 +372,7 @@ execinfo = cc.find_library('execinfo', required: false)
eina_lib = library('eina', sources,
include_directories : config_dir,
- dependencies: [m, rt, dl, execinfo, iconv, eina_deps, thread_dep, eina_mem_pools],
+ dependencies: [m, rt, dl, execinfo, iconv, eina_deps, thread_dep, eina_mem_pools, evil],
install: true,
version : meson.project_version()
)
diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build
index ac69f99905..335b8f581b 100644
--- a/src/lib/elementary/meson.build
+++ b/src/lib/elementary/meson.build
@@ -914,7 +914,12 @@ config_h.set_quoted('MODULES_PATH', join_paths(dir_lib, 'modules'))
config_h.set_quoted('ELEMENTARY_BASE_DIR', '.elementary')
config_h.set_quoted('ICON_DIR', join_paths(dir_lib, 'icons'))
-elm_options.set('ELM_UNIX', '1')
+if sys_windows == false
+ elm_options.set('ELM_UNIX', '1')
+else
+ elm_options.set('DLL_EXPORT', '1')
+endif
+
elm_options.set('ELM_ELOCATION', '1')
elm_options.set('ELM_EFREET', '1')
diff --git a/src/lib/evil/meson.build b/src/lib/evil/meson.build
new file mode 100644
index 0000000000..ff9630aa2b
--- /dev/null
+++ b/src/lib/evil/meson.build
@@ -0,0 +1,69 @@
+evil_deps = []
+evil_pub_deps = []
+if target_machine.system() == 'windows'
+ evil_header_src = [
+ 'Evil.h',
+ 'evil_dlfcn.h',
+ 'evil_fcntl.h',
+ 'evil_langinfo.h',
+ 'evil_locale.h',
+ 'evil_macro.h',
+ 'evil_macro_pop.h',
+ 'evil_macro_wrapper.h',
+ 'evil_main.h',
+ 'evil_stdio.h',
+ 'evil_stdlib.h',
+ 'evil_string.h',
+ 'evil_time.h',
+ 'evil_unistd.h',
+ 'evil_util.h',
+ 'dirent.h',
+ 'fnmatch.h',
+ 'pwd.h',
+ 'regex/regex.h'
+ ]
+ evil_header_sys_src = [join_paths('sys','mman.h')]
+
+ evil_src = [
+ 'evil_dlfcn.c',
+ 'evil_fcntl.c',
+ 'evil_fnmatch.c',
+ 'evil_fnmatch_list_of_states.c',
+ 'evil_langinfo.c',
+ 'evil_locale.c',
+ 'evil_main.c',
+ 'evil_mman.c',
+ 'evil_pwd.c',
+ 'evil_stdio.c',
+ 'evil_stdlib.c',
+ 'evil_string.c',
+ 'evil_time.c',
+ 'evil_unistd.c',
+ 'evil_util.c',
+ 'evil_private.h',
+ 'evil_fnmatch_private.h',
+ ]
+
+ subdir('regex')
+
+ psapi = cc.find_library('psapi')
+ ole32 = cc.find_library('ole32')
+ ws2_32 = cc.find_library('ws2_32')
+ secur32 = cc.find_library('secur32')
+ uuid = cc.find_library('uuid')
+ msvcr100 = cc.find_library('msvcr100')
+
+ evil_lib = library('evil', evil_src,
+ dependencies : [psapi, ole32, ws2_32, secur32, uuid, msvcr100],
+ include_directories : [config_dir, include_directories('regex')],
+ )
+
+ evil = declare_dependency(
+ include_directories: [config_dir, include_directories('regex'), include_directories('.')],
+ dependencies : [psapi, ole32, ws2_32, secur32, uuid, msvcr100],
+ link_with: evil_lib,
+ )
+else
+ evil = declare_dependency()
+ automatic_pkgfile = false
+endif
diff --git a/src/lib/evil/regex/meson.build b/src/lib/evil/regex/meson.build
new file mode 100644
index 0000000000..d04769b72d
--- /dev/null
+++ b/src/lib/evil/regex/meson.build
@@ -0,0 +1,10 @@
+evil_src += files([
+'regcomp.c',
+'regerror.c',
+'regexec.c',
+'regfree.c',
+'cclass.h',
+'cname.h',
+'regex2.h',
+'utils.h'
+])
diff --git a/src/modules/ecore_evas/meson.build b/src/modules/ecore_evas/meson.build
index 7fa4d1d305..75af136382 100644
--- a/src/modules/ecore_evas/meson.build
+++ b/src/modules/ecore_evas/meson.build
@@ -1,7 +1,6 @@
engines = [
['cocoa', ['cocoa']],
['drm', ['drm']],
-['extn', []],
['fb', ['fb']],
['sdl', ['sdl']],
['wayland', ['wl']],
@@ -9,6 +8,10 @@ engines = [
['x', ['x11']],
]
+if sys_windows == false
+ engines += [['extn', []]]
+endif
+
foreach engine_conf : engines
engine = engine_conf[0]
diff --git a/src/modules/emotion/generic/meson.build b/src/modules/emotion/generic/meson.build
index d0da87861b..4f62c7a43e 100644
--- a/src/modules/emotion/generic/meson.build
+++ b/src/modules/emotion/generic/meson.build
@@ -8,15 +8,17 @@ emotion_generic = declare_dependency(
dependencies: emotion,
)
-shared_module(emotion_loader,
+if sys_windows == false
+ shared_module(emotion_loader,
generic_src,
include_directories : config_dir,
- dependencies: [eina, evas, emotion, generic_deps],
+ dependencies: [eina, evas, emotion, generic_deps, rt],
install: true,
install_dir : mod_install_dir,
c_args : package_c_args,
-)
+ )
-install_headers('Emotion_Generic_Plugin.h',
- install_dir : dir_package_include,
-)
+ install_headers('Emotion_Generic_Plugin.h',
+ install_dir : dir_package_include,
+ )
+endif
diff --git a/src/static_libs/draw/meson.build b/src/static_libs/draw/meson.build
index 250e021fb7..c1b72c581d 100644
--- a/src/static_libs/draw/meson.build
+++ b/src/static_libs/draw/meson.build
@@ -9,7 +9,7 @@ draw_src = [
draw_opt_lib = [ ]
-if cpu_sse3 == true
+if cpu_sse3 == true and sys_windows == false
draw_opt = static_library('draw_opt',
sources: [ 'draw_main_sse2.c' ],
include_directories: config_dir + [include_directories(join_paths('..', '..', 'lib'))],
@@ -21,16 +21,9 @@ else
draw_src += [ 'draw_main_sse2.c' ]
endif
-draw_lib = static_library('draw',
- draw_src,
- dependencies : [eina, efl],
- include_directories : config_dir + [include_directories(join_paths('..', '..', 'lib'))],
- install: false,
- link_with: draw_opt_lib,
-)
-
draw = declare_dependency(
include_directories: [include_directories('.'), include_directories(join_paths('..', '..', 'lib'))],
- link_with: draw_lib,
- dependencies: [eina],
+ dependencies: [eina, efl],
+ sources : draw_src,
+ link_with : draw_opt_lib
)
diff --git a/src/static_libs/rg_etc/meson.build b/src/static_libs/rg_etc/meson.build
index 3dad342457..cd093daba9 100644
--- a/src/static_libs/rg_etc/meson.build
+++ b/src/static_libs/rg_etc/meson.build
@@ -5,12 +5,7 @@ rg_etc_src = [
'rg_etc2.c',
]
-rg_etc_lib = static_library('rg_etc', rg_etc_src,
- dependencies : eina,
- include_directories : config_dir,
-)
-
rg_etc = declare_dependency(
include_directories: include_directories('.'),
- link_with: rg_etc_lib
+ sources : rg_etc_src
)