bu5hm4n pushed a commit to branch feature/meson.

http://git.enlightenment.org/core/efl.git/commit/?id=b9a8396c79c41b0961e3fa623e4be62051c976ba

commit b9a8396c79c41b0961e3fa623e4be62051c976ba
Author: Marcel Hollerbach <[email protected]>
Date:   Sat Dec 23 14:49:26 2017 +0100

    meson: here comes ecore!
    
    but there needs to be ecore-XXX for the tests and examples
---
 meson.build                 |  17 ++--
 meson_options.txt           |  36 ++++++++
 src/lib/ecore/meson.build   | 202 ++++++++++++++++++++++++++++++++++++++++++++
 src/tests/ecore/meson.build |  30 +++++++
 src/tests/meson.build       |   3 +-
 5 files changed, 281 insertions(+), 7 deletions(-)

diff --git a/meson.build b/meson.build
index f6e6215aec..66fd88a4bd 100644
--- a/meson.build
+++ b/meson.build
@@ -80,18 +80,23 @@ subdir('header_checks')
 
 subprojects = [
 # name   | mod  | lib  | bin  | bench | name of static libs
-['eina'  ,  true,  true,  true,  true, []],
+['eina'  , false,  true,  true,  true, []],
 ['eolian', false,  true,  true, false, []],
 ['eo'    , false,  true, false,  true, []],
 ['efl'   , false,  true, false, false, []],
 ['emile' , false,  true, false, false, ['lz4', 'rg_etc']],
-['eet'   , false,  true,  true, false, []]
+['eet'   , false,  true,  true, false, []],
+['ecore' , false,  true, false, false, []],
 ]
 
 
 # We generate Efl_Config.h and config.h later, they will be available here
 config_dir += include_directories('.')
 
+#we have to do that first, eina modules are required by eina
+#the other modules require theire package
+subdir(join_paths(local_module, 'eina'))
+
 foreach package : subprojects
   package_name = package[0]
   package_version_name = package_name + '-' + version_major
@@ -101,13 +106,13 @@ foreach package : subprojects
   foreach static_lib : package[5]
     subdir(join_paths('src', 'static_libs', static_lib))
   endforeach
-  
-  if (package[1])
-     subdir(join_paths(local_module, package_name))
-  endif
+
   if (package[2])
      subdir(join_paths(local_lib, package_name))
   endif
+  if (package[1])
+     subdir(join_paths(local_module, package_name))
+  endif
   if (package[3])
      subdir(join_paths(local_bin, package_name))
   endif
diff --git a/meson_options.txt b/meson_options.txt
index 88e3c9e208..3806440f4c 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -32,3 +32,39 @@ option('crypto',
   choices : ['gnutls', 'openssl', 'none'],
   value : 'openssl'
 )
+
+option('glib',
+  type : 'boolean',
+  value : true,
+  description : 'use glib or not'
+)
+
+option('g-mainloop',
+  type : 'boolean',
+  value : false,
+  description : 'use glib mainloop or not'
+)
+
+option('gstreamer',
+  type : 'boolean',
+  value : true,
+  description : 'use gstreamer 1.0 support'
+)
+
+option('libuv',
+  type : 'boolean',
+  value : false,
+  description : 'use libuv'
+)
+
+option('systemd',
+  type : 'boolean',
+  value : true,
+  description : 'use systemd support'
+)
+
+option('avahi',
+  type : 'boolean',
+  value : false,
+  description : 'disable avahi support'
+)
diff --git a/src/lib/ecore/meson.build b/src/lib/ecore/meson.build
new file mode 100644
index 0000000000..96c78adfe7
--- /dev/null
+++ b/src/lib/ecore/meson.build
@@ -0,0 +1,202 @@
+pub_legacy_eo_files = [
+  'ecore_exe.eo',
+  'ecore_event_message.eo',
+  'ecore_event_message_handler.eo',
+  'efl_loop_timer.eo'
+]
+
+pub_eo_file_target = []
+foreach eo_file : pub_legacy_eo_files
+  pub_eo_file_target += custom_target('eolian_gen_' + eo_file,
+    input : eo_file,
+    output : [eo_file + '.h', eo_file + '.legacy.h',],
+    install : true,
+    install_dir : dir_package_include,
+    command : [eolian_gen, '-I', meson.current_source_dir(), 
eolian_include_directories,
+                           '-o', 'h:' + join_paths(meson.current_build_dir(), 
eo_file + '.h'),
+                           '-o', 'c:' + join_paths(meson.current_build_dir(), 
eo_file + '.c'),
+                           '-o', 'l:' + join_paths(meson.current_build_dir(), 
eo_file + '.legacy.h'),
+                           '-gchl', '@INPUT@'])
+
+endforeach
+
+pub_eo_files = [
+  'efl_loop.eo',
+  'efl_loop_consumer.eo',
+  'efl_loop_fd.eo',
+  'efl_loop_handler.eo',
+  'efl_loop_message.eo',
+  'efl_loop_message_handler.eo',
+  'efl_io_closer_fd.eo',
+  'efl_io_positioner_fd.eo',
+  'efl_io_reader_fd.eo',
+  'efl_io_sizer_fd.eo',
+  'efl_io_writer_fd.eo',
+  'efl_io_stdin.eo',
+  'efl_io_stdout.eo',
+  'efl_io_stderr.eo',
+  'efl_io_file.eo',
+  'efl_io_copier.eo',
+  'efl_io_buffered_stream.eo',
+  'efl_interpolator.eo',
+  'efl_interpolator_linear.eo',
+  'efl_interpolator_accelerate.eo',
+  'efl_interpolator_decelerate.eo',
+  'efl_interpolator_sinusoidal.eo',
+  'efl_interpolator_divisor.eo',
+  'efl_interpolator_bounce.eo',
+  'efl_interpolator_spring.eo',
+  'efl_interpolator_cubic_bezier.eo'
+]
+#split for later multilang eolian files stuff
+pub_eo_files += [
+  'efl_promise.eo',
+  'efl_model_item.eo',
+  'efl_model_container.eo',
+  'efl_model_container_item.eo',
+  'efl_model_composite_boolean.eo',
+  'efl_model_composite_boolean_children.eo',
+  'efl_model_composite_selection.eo',
+  'efl_model_composite_selection_children.eo'
+]
+
+foreach eo_file : pub_eo_files
+  pub_eo_file_target += custom_target('eolian_gen_' + eo_file,
+    input : eo_file,
+    output : [eo_file + '.h'],
+    install : true,
+    install_dir : dir_package_include,
+    command : [eolian_gen, '-I', meson.current_source_dir(), 
eolian_include_directories,
+                           '-o', 'h:' + join_paths(meson.current_build_dir(), 
eo_file + '.h'),
+                           '-o', 'c:' + join_paths(meson.current_build_dir(), 
eo_file + '.c'),
+                           '-gch', '@INPUT@'])
+endforeach
+
+eolian_include_directories += ['-I', meson.current_source_dir()]
+
+ecore_header_src = [
+  'Ecore.h',
+  'Ecore_Common.h',
+  'Ecore_Legacy.h',
+  'Ecore_Eo.h',
+  'Efl_Core.h',
+  'efl_general.h',
+  'Ecore_Getopt.h'
+]
+
+ecore_src = [
+  'ecore.c',
+  'ecore_alloc.c',
+  'ecore_anim.c',
+  'ecore_app.c',
+  'ecore_events.c',
+  'ecore_getopt.c',
+  'ecore_glib.c',
+  'ecore_idle_enterer.c',
+  'ecore_idle_exiter.c',
+  'ecore_idler.c',
+  'ecore_job.c',
+  'ecore_main.c',
+  'ecore_event_message.c',
+  'ecore_event_message_handler.c',
+  'efl_loop.c',
+  'efl_loop_consumer.c',
+  'efl_loop_fd.c',
+  'efl_loop_handler.c',
+  'efl_loop_message.c',
+  'efl_loop_message_handler.c',
+  'efl_io_closer_fd.c',
+  'efl_io_positioner_fd.c',
+  'efl_io_reader_fd.c',
+  'efl_io_sizer_fd.c',
+  'efl_io_writer_fd.c',
+  'efl_io_stdin.c',
+  'efl_io_stdout.c',
+  'efl_io_stderr.c',
+  'efl_io_file.c',
+  'efl_io_copier.c',
+  'efl_io_buffered_stream.c',
+  'efl_promise.c',
+  'efl_model_item.c',
+  'efl_model_container.c',
+  'efl_model_container_item.c',
+  'efl_model_container_private.h',
+  'efl_model_composite_boolean.c',
+  'efl_model_composite_selection.c',
+  'efl_model_accessor_view.c',
+  'efl_model_accessor_view_private.h',
+  'efl_interpolator.c',
+  'efl_interpolator_linear.c',
+  'efl_interpolator_accelerate.c',
+  'efl_interpolator_decelerate.c',
+  'efl_interpolator_sinusoidal.c',
+  'efl_interpolator_divisor.c',
+  'efl_interpolator_bounce.c',
+  'efl_interpolator_spring.c',
+  'efl_interpolator_cubic_bezier.c',
+  'ecore_main_timechanges.c',
+  'ecore_pipe.c',
+  'ecore_poller.c',
+  'ecore_time.c',
+  'ecore_timer.c',
+  'ecore_thread.c',
+  'ecore_throttle.c',
+  'ecore_exe.c',
+  'ecore_exe_private.h',
+  'ecore_private.h',
+  'ecore_internal.h',
+  'ecore_main_common.h'
+]
+
+if target_machine.system() == 'windows'
+  #nothing for now ... needs testing
+else
+  ecore_src += ['ecore_signal.c', 'ecore_exe_posix.c']
+endif
+
+ecore_deps = []
+
+if get_option('glib') == true
+  ecore_deps += dependency('glib-2.0')
+  ecore_deps += dependency('gthread-2.0')
+  config_h.set('GLIB_INTEGRATION_ALWAYS', '1')
+  config_h.set('HAVE_GLIB', '1')
+endif
+
+if get_option('g-mainloop') == true
+  config_h.set('USE_G_MAIN_LOOP', '1')
+endif
+
+if get_option('gstreamer') == true
+  ecore_deps += dependency('gstreamer-1.0')
+endif
+
+if get_option('systemd') == true
+  ecore_deps += systemd
+endif
+
+ecore_lib = library('ecore',
+    ecore_src, pub_eo_file_target,
+    dependencies: [eina, eo, efl, m, ecore_deps],
+    include_directories : config_dir + 
[include_directories(join_paths('..','..'))],
+    install: true,
+)
+
+ecore = declare_dependency(
+  include_directories: [include_directories('.')],
+  link_with: ecore_lib,
+  sources : pub_eo_file_target,
+  dependencies: [eina, eo, efl],
+)
+
+install_data(pub_eo_files,
+  install_dir: join_paths(eolian_include_dir, package_version_name)
+)
+
+install_headers(ecore_header_src,
+  install_dir : dir_package_include,
+)
+
+#TODO:
+# HAVE_TIZEN_CONFIGUREATION_MANAGER
+# avahi
diff --git a/src/tests/ecore/meson.build b/src/tests/ecore/meson.build
new file mode 100644
index 0000000000..ce9ab5a686
--- /dev/null
+++ b/src/tests/ecore/meson.build
@@ -0,0 +1,30 @@
+
+ecore_suite_src = [
+  'ecore_suite.c',
+  'ecore_test_ecore.c',
+  'ecore_test_ecore_imf.c',
+  'ecore_test_timer.c',
+  'ecore_test_ecore_evas.c',
+  'ecore_test_animator.c',
+  'ecore_test_ecore_thread_eina_thread_queue.c',
+  'ecore_test_ecore_input.c',
+  'ecore_test_ecore_file.c',
+  'ecore_test_promise.c',
+  'ecore_test_promise2.c',
+  'ecore_test_job.c',
+  'ecore_test_args.c',
+  'ecore_suite.h'
+]
+
+ecore_suite = executable('ecore_suite',
+  ecore_suite_src,
+  dependencies: [ecore, ecore_imf, ecore_evas, ecore_input, ecore_file, check],
+  c_args : [
+  '-DTESTS_BUILD_DIR="'+meson.current_build_dir()+'"',
+  '-DTESTS_SRC_DIR="'+meson.current_source_dir()+'"']
+)
+
+test('ecore-suite', ecore_suite, 
+  is_parallel: true,
+  timeout : 10*60,
+)
\ No newline at end of file
diff --git a/src/tests/meson.build b/src/tests/meson.build
index 4d8fb60cd1..0c01763c44 100644
--- a/src/tests/meson.build
+++ b/src/tests/meson.build
@@ -5,4 +5,5 @@ subdir('eo')
 #disabled for now we need ecore first
 #subdir('efl')
 subdir('emile')
-subdir('eet')
\ No newline at end of file
+subdir('eet')
+#subdir('ecore')

-- 


Reply via email to