aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-12-03 22:43:23 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2018-12-03 23:33:25 -0300
commitbf19ce75ceb90d07f97c95b1477e9702e7e88041 (patch)
tree1424139cd6121b7ac3eab7cf6828a83ca42537df
parentcoro: Add fcontext coroutine implementation. (diff)
downloadefl-devs/lauromoura/coroutines.tar.gz
coro: Enable meson builddevs/lauromoura/coroutines
-rw-r--r--meson.build2
-rw-r--r--meson_options.txt7
-rw-r--r--src/lib/eina/meson.build14
-rw-r--r--src/static_libs/fcontext/meson.build12
-rw-r--r--src/tests/eina/meson.build3
-rw-r--r--src/tests/eo/suite/meson.build3
6 files changed, 37 insertions, 4 deletions
diff --git a/meson.build b/meson.build
index c40d30c185..433e6ec136 100644
--- a/meson.build
+++ b/meson.build
@@ -203,7 +203,7 @@ ecore_evas_wayland_engine_include_dir = []
subprojects = [
# name | option | mod | lib | bin | bench | tests | examples | pkg-config options | name of static libs
-['eina' ,[] , false, true, true, true, true, true, [], []],
+['eina' ,[] , false, true, true, true, true, true, [], ['fcontext']],
['eolian' ,[] , false, true, true, false, true, false, ['eina'], []],
['eo' ,[] , false, true, false, true, true, false, ['eina'], []],
['efl' ,[] , false, true, false, false, true, false, ['eo'], []],
diff --git a/meson_options.txt b/meson_options.txt
index 296b3b88d8..0dbca6f319 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -333,3 +333,10 @@ option('native-arch-optimization',
value: true,
description: 'Flag for enabling architecture native optimizations'
)
+
+option('coro',
+ type : 'combo',
+ choices : ['fcontext', 'thread'],
+ value : 'fcontext',
+ description : 'Which coroutine implementation to use'
+)
diff --git a/src/lib/eina/meson.build b/src/lib/eina/meson.build
index 9535391619..2217c490c8 100644
--- a/src/lib/eina/meson.build
+++ b/src/lib/eina/meson.build
@@ -101,6 +101,7 @@ public_sub_headers = [
'eina_freeq.h',
'eina_slstr.h',
'eina_vpath.h',
+'eina_coro.h',
]
public_headers = [
@@ -115,6 +116,7 @@ sources = [
'eina_binbuf.c',
'eina_binshare.c',
'eina_convert.c',
+'eina_coro.c',
'eina_counter.c',
'eina_cow.c',
'eina_cpu.c',
@@ -345,6 +347,15 @@ if sys_osx == true
endif
+eina_build_libs = []
+
+if get_option('coro') == 'fcontext'
+ eina_config.set('USE_CORO_FCONTEXT', 1)
+ eina_build_libs += fcontext_lib
+else
+ eina_config.set('USE_CORO_THREAD', 1)
+endif
+
eina_config_file = configure_file(
output: 'eina_config.h',
configuration: eina_config,
@@ -370,7 +381,8 @@ eina_lib = library('eina', sources,
include_directories : config_dir,
dependencies: [m, rt, dl, execinfo, iconv, eina_deps, thread_dep, eina_mem_pools],
install: true,
- version : meson.project_version()
+ version : meson.project_version(),
+ link_with : eina_build_libs
)
diff --git a/src/static_libs/fcontext/meson.build b/src/static_libs/fcontext/meson.build
new file mode 100644
index 0000000000..17f29b5dba
--- /dev/null
+++ b/src/static_libs/fcontext/meson.build
@@ -0,0 +1,12 @@
+
+fcontext_src = [
+ 'make_all_gas.S',
+ 'jump_all_gas.S'
+]
+
+if get_option('coro') == 'fcontext'
+ fcontext_lib = static_library('fcontext',
+ fcontext_src,
+ install: false
+ )
+endif
diff --git a/src/tests/eina/meson.build b/src/tests/eina/meson.build
index f111e3a12d..ffa9b1cac7 100644
--- a/src/tests/eina/meson.build
+++ b/src/tests/eina/meson.build
@@ -53,7 +53,8 @@ eina_test_src = files(
'eina_test_slice.c',
'eina_test_freeq.c',
'eina_test_slstr.c',
-'eina_test_vpath.c'
+'eina_test_vpath.c',
+'eina_test_coro.c'
)
diff --git a/src/tests/eo/suite/meson.build b/src/tests/eo/suite/meson.build
index 6e7f4ba6f7..6fd1b95e79 100644
--- a/src/tests/eo/suite/meson.build
+++ b/src/tests/eo/suite/meson.build
@@ -17,7 +17,8 @@ eo_suite_src = [
'eo_test_event.c',
'eo_test_threaded_calls.c',
'eo_test_init.c',
- 'eo_test_lifecycle.c'
+ 'eo_test_lifecycle.c',
+ 'eo_test_coro.c'
]
eo_suite = executable('eo_suite',