From f6e93a1b6702b8ee900d4b6f65278b5581755552 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Thu, 16 Feb 2023 01:16:57 -0300 Subject: [PATCH] add the obelisk library source --- doc/doxygen.conf.in | 6 ++++-- include/version.h.in | 14 ++++++++++++++ lib/meson.build | 20 ++++++++++++++++++++ lib/version.h.in | 1 + meson.build | 3 +++ src/meson.build | 1 + src/version.h.in | 9 +-------- 7 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 include/version.h.in create mode 100644 lib/meson.build create mode 120000 lib/version.h.in mode change 100644 => 120000 src/version.h.in diff --git a/doc/doxygen.conf.in b/doc/doxygen.conf.in index 684e675..d268ea0 100644 --- a/doc/doxygen.conf.in +++ b/doc/doxygen.conf.in @@ -864,7 +864,7 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = @TOP_SRCDIR@/src +INPUT = @TOP_SRCDIR@/src @TOP_SRCDIR@/lib @TOP_SRCDIR@/include # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -2237,7 +2237,9 @@ SEARCH_INCLUDES = YES INCLUDE_PATH = @TOP_SRCDIR@/src \ @TOP_SRCDIR@/src/ast \ - @TOP_SRCDIR@/src/models + @TOP_SRCDIR@/src/models \ + @TOP_SRCDIR@/lib \ + @TOP_SRCDIR@/include # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the diff --git a/include/version.h.in b/include/version.h.in new file mode 100644 index 0000000..1841178 --- /dev/null +++ b/include/version.h.in @@ -0,0 +1,14 @@ +namespace obelisk +{ + /** + * @brief The current version of obelisk. + * + */ + const std::string version = "@version@"; + + /** + * @brief The current library version of obelisk. + * + */ + const std::string soVersion = "@so_version@"; +} // namespace obelisk diff --git a/lib/meson.build b/lib/meson.build new file mode 100644 index 0000000..0e17871 --- /dev/null +++ b/lib/meson.build @@ -0,0 +1,20 @@ +conf_data = configuration_data() +conf_data.set('version', meson.project_version()) +conf_data.set('so_version', project_version_lib) +configure_file(input : 'version.h.in', + output : 'version.h', + configuration : conf_data +) + +obelisk_lib_sources = files( +) + +sqlite3 = dependency('sqlite3') + +library('obelisk', + obelisk_lib_sources, + dependencies : [sqlite3], + version : meson.project_version(), + soversion : project_version_lib, + install : true +) diff --git a/lib/version.h.in b/lib/version.h.in new file mode 120000 index 0000000..5c3fee4 --- /dev/null +++ b/lib/version.h.in @@ -0,0 +1 @@ +../include/version.h.in \ No newline at end of file diff --git a/meson.build b/meson.build index b8b534f..381f03d 100644 --- a/meson.build +++ b/meson.build @@ -9,6 +9,8 @@ project('obelisk', ] ) +project_version_lib = '0' + llvm = dependency('llvm', version: '>= 14.0.0', modules : ['core', 'target', 'mcjit', 'nativecodegen'], required : true, method: 'config-tool') cdata = configuration_data() @@ -27,4 +29,5 @@ if docs_enabled endif endif +subdir('lib') subdir('src') diff --git a/src/meson.build b/src/meson.build index 81adf96..051321b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,5 +1,6 @@ conf_data = configuration_data() conf_data.set('version', meson.project_version()) +conf_data.set('so_version', project_version_lib) configure_file(input : 'version.h.in', output : 'version.h', configuration : conf_data diff --git a/src/version.h.in b/src/version.h.in deleted file mode 100644 index 7e82845..0000000 --- a/src/version.h.in +++ /dev/null @@ -1,8 +0,0 @@ -namespace obelisk -{ - /** - * @brief The current version of obelisk. - * - */ - std::string version = "@version@"; -} // namespace obelisk diff --git a/src/version.h.in b/src/version.h.in new file mode 120000 index 0000000..5c3fee4 --- /dev/null +++ b/src/version.h.in @@ -0,0 +1 @@ +../include/version.h.in \ No newline at end of file