From: Michal Sojka Date: Sun, 14 Oct 2018 21:50:10 +0000 (+0200) Subject: Add Meson buildsystem support X-Git-Url: https://rtime.felk.cvut.cz/gitweb/orte.git/commitdiff_plain/82c138a2087b72c78058a9eec2eff9c8c92a9627 Add Meson buildsystem support Tested only on Linux. Build works, but many things are still missing. For example: shape demo, config options, support for other platforms, etc. --- diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..6c683e0 --- /dev/null +++ b/meson.build @@ -0,0 +1,3 @@ +project('orte', 'c') + +subdir('orte') diff --git a/orte/examples/hello/meson.build b/orte/examples/hello/meson.build new file mode 100644 index 0000000..2ba7781 --- /dev/null +++ b/orte/examples/hello/meson.build @@ -0,0 +1,4 @@ +executable('h_publisher', 'h_publisher.c', + dependencies: liborte_dep) +executable('h_subscriber', 'h_subscriber.c', + dependencies: liborte_dep) diff --git a/orte/examples/meson.build b/orte/examples/meson.build new file mode 100644 index 0000000..44cec83 --- /dev/null +++ b/orte/examples/meson.build @@ -0,0 +1,9 @@ +subdir('ping') +subdir('multicast') +subdir('spy') +subdir('hello') +subdir('reliable') +subdir('schneider') +subdir('mpo') +subdir('type') +#subdir('rtems-shell') diff --git a/orte/examples/mpo/meson.build b/orte/examples/mpo/meson.build new file mode 100644 index 0000000..e69de29 diff --git a/orte/examples/multicast/meson.build b/orte/examples/multicast/meson.build new file mode 100644 index 0000000..f999f42 --- /dev/null +++ b/orte/examples/multicast/meson.build @@ -0,0 +1,2 @@ +executable('m_subscriber', 'm_subscriber.c', + dependencies: liborte_dep) diff --git a/orte/examples/ping/meson.build b/orte/examples/ping/meson.build new file mode 100644 index 0000000..9067e89 --- /dev/null +++ b/orte/examples/ping/meson.build @@ -0,0 +1,2 @@ +executable('orteping', 'orteping.c', + dependencies: liborte_dep) diff --git a/orte/examples/reliable/meson.build b/orte/examples/reliable/meson.build new file mode 100644 index 0000000..88451d7 --- /dev/null +++ b/orte/examples/reliable/meson.build @@ -0,0 +1,6 @@ +executable('r_publisher', 'r_publisher.c', + dependencies: liborte_dep) +executable('r_subscriber_reliable', 'r_subscriber_reliable.c', + dependencies: liborte_dep) +executable('r_subscriber_besteffort', 'r_subscriber_besteffort.c', + dependencies: liborte_dep) diff --git a/orte/examples/robot/meson.build b/orte/examples/robot/meson.build new file mode 100644 index 0000000..e69de29 diff --git a/orte/examples/schneider/meson.build b/orte/examples/schneider/meson.build new file mode 100644 index 0000000..d68dfe4 --- /dev/null +++ b/orte/examples/schneider/meson.build @@ -0,0 +1,2 @@ +executable('schneider_subscriber', 'schneider_subscriber.c', + dependencies: liborte_dep) diff --git a/orte/examples/spy/meson.build b/orte/examples/spy/meson.build new file mode 100644 index 0000000..e7f4b5c --- /dev/null +++ b/orte/examples/spy/meson.build @@ -0,0 +1,2 @@ +executable('ortespy', 'ortespy.c', + dependencies: liborte_dep) diff --git a/orte/examples/type/meson.build b/orte/examples/type/meson.build new file mode 100644 index 0000000..74d390c --- /dev/null +++ b/orte/examples/type/meson.build @@ -0,0 +1,2 @@ +gen_src = gen_orte_idl.process('ThreeTypes.idl', 'test-any.idl') +#library('type', gen_src) diff --git a/orte/idl-compiler/meson.build b/orte/idl-compiler/meson.build new file mode 100644 index 0000000..647ea44 --- /dev/null +++ b/orte/idl-compiler/meson.build @@ -0,0 +1,24 @@ +orte_idl = executable( + 'orte-idl', + [ + 'orte-idl-main.c', + 'orte-idl-driver.c', + 'orte-idl-utils.c', + 'orte-idl-c-backend.c', + 'orte-idl-c-headers.c', + 'orte-idl-c-impls.c', + 'orte-idl-c-utils.c', + ], + dependencies: [ + dependency('popt'), + dependency('libIDL-2.0'), + ], + install: true, +) + +# TODO: Add support for output directory to orte-idl +gen_orte_idl = generator( + orte_idl, + output: ['@BASENAME@.c', '@BASENAME@.h'], + arguments : ['@INPUT@'], +) diff --git a/orte/include/meson.build b/orte/include/meson.build new file mode 100644 index 0000000..d92381e --- /dev/null +++ b/orte/include/meson.build @@ -0,0 +1,14 @@ + +install_headers( + 'orte.h', +) +install_headers( + 'orte/basic_types.h', + 'orte/cdr.h', + 'orte/defines_api.h', + 'orte/protos_api.h', + 'orte/typedefs_api.h', + 'orte/typedefs_defines_rtps.h', + subdir: 'orte', +) +# TODO: rename config and install it to orte/orte_config.h diff --git a/orte/liborte/meson.build b/orte/liborte/meson.build new file mode 100644 index 0000000..be371b7 --- /dev/null +++ b/orte/liborte/meson.build @@ -0,0 +1,71 @@ +liborte_args = [] + +if (host_machine.system() == 'windows') + liborte_args += ['-include', 'orte/orte_config_omk_win32.h'] +elif (host_machine.system() == 'linux') + liborte_args += ['-include', 'orte/orte_config_omk_linux.h'] +else + liborte_args += ['-include', 'orte/orte_config_omk_linux.h'] +endif + + + +liborte = library( + 'orte', + [ + 'conv.c', + 'debug.c', + 'event.c', + 'fnmatch.c', + 'htimerNtp.c', + 'objectEntry.c', + 'objectEntryTimer.c', + 'objectUtils.c', + 'ORTEAppRecvThread.c', + 'ORTEAppSendThread.c', + 'ORTEDomainApp.c', + 'ORTEPublication.c', + 'ORTEPublicationTimer.c', + 'ORTESubscription.c', + 'ORTEDomain.c', + 'ORTEDomainMgr.c', + 'ORTEInit.c', + 'ORTEThreadUtils.c', + 'ORTETypeRegister.c', + 'ORTEVerbosity.c', + 'ORTEPattern.c', + 'ORTEMisc.c', + 'parameter.c', + 'RTPSAck.c', + 'RTPSCSTReader.c', + 'RTPSCSTReaderTimer.c', + 'RTPSCSTReaderProc.c', + 'RTPSCSTWriter.c', + 'RTPSCSTWriterTimer.c', + 'RTPSGap.c', + 'RTPSHeader.c', + 'RTPSHeardBeat.c', + 'RTPSInfoDST.c', + 'RTPSInfoREPLY.c', + 'RTPSInfoSRC.c', + 'RTPSInfoTS.c', + 'RTPSPad.c', + 'RTPSUtils.c', + 'RTPSVar.c', + 'RTPSIssue.c', + 'sock.c', + 'ul_gavl.c', + 'ul_gavlprim.c', + 'cdr.c', + ], + dependencies: dependency('threads'), + include_directories: include_directories('../include'), + c_args: [ '-DHAVE_CONFIG_H', liborte_args ], + install: true, +) + +liborte_dep = declare_dependency( + link_with: liborte, + include_directories: include_directories('../include'), + compile_args: [ '-DHAVE_CONFIG_H' ] + liborte_args, +) diff --git a/orte/manager/meson.build b/orte/manager/meson.build new file mode 100644 index 0000000..8259e1c --- /dev/null +++ b/orte/manager/meson.build @@ -0,0 +1,5 @@ +executable( + 'ortemanager', [ 'ortemanager.c' ], + dependencies: [ liborte_dep ], + install: true, +) diff --git a/orte/meson.build b/orte/meson.build new file mode 100644 index 0000000..a1f9a50 --- /dev/null +++ b/orte/meson.build @@ -0,0 +1,8 @@ +# subdir('contrib') +subdir('idl-compiler') +subdir('include') +# subdir('java') +# subdir('libjorte') +subdir('liborte') +subdir('manager') +subdir('examples')