restructure library location
This commit is contained in:
parent
bf5033c70d
commit
48955026c4
@ -1 +0,0 @@
|
||||
../include/version.h.in
|
10
meson.build
10
meson.build
@ -29,12 +29,4 @@ if docs_enabled
|
||||
endif
|
||||
endif
|
||||
|
||||
lib_enabled = get_option('lib')
|
||||
if lib_enabled
|
||||
subdir('lib')
|
||||
endif
|
||||
|
||||
bin_enabled = get_option('bin')
|
||||
if bin_enabled
|
||||
subdir('src')
|
||||
endif
|
||||
subdir('src')
|
||||
|
@ -1,13 +1,3 @@
|
||||
option('bin',
|
||||
type: 'boolean',
|
||||
value: true,
|
||||
description: 'Build the obelisk compiler'
|
||||
)
|
||||
option('lib',
|
||||
type: 'boolean',
|
||||
value: true,
|
||||
description: 'Build the obelisk library'
|
||||
)
|
||||
option('docs',
|
||||
type: 'boolean',
|
||||
value: true,
|
||||
|
27
src/lib/include/obelisk.h
Normal file
27
src/lib/include/obelisk.h
Normal file
@ -0,0 +1,27 @@
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
* @brief The obelisk namespace contains everything needed to compile obelisk.
|
||||
* code.
|
||||
*
|
||||
*/
|
||||
namespace obelisk
|
||||
{
|
||||
class Obelisk
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Get the obelisk version.
|
||||
*
|
||||
* @return std::string The version.
|
||||
*/
|
||||
std::string getVersion();
|
||||
|
||||
/**
|
||||
* @brief Get the obelisk library so version.
|
||||
*
|
||||
* @return int The version.
|
||||
*/
|
||||
int getLibVersion();
|
||||
};
|
||||
} // namespace obelisk
|
@ -7,14 +7,23 @@ configure_file(input : 'version.h.in',
|
||||
)
|
||||
|
||||
obelisk_lib_sources = files(
|
||||
'obelisk.cpp'
|
||||
)
|
||||
|
||||
sqlite3 = dependency('sqlite3')
|
||||
|
||||
library('obelisk',
|
||||
incdirs = include_directories(['.', 'include'])
|
||||
lib = library('obelisk',
|
||||
obelisk_lib_sources,
|
||||
include_directories: incdirs,
|
||||
dependencies : [sqlite3],
|
||||
version : meson.project_version(),
|
||||
soversion : project_version_lib,
|
||||
install : true
|
||||
)
|
||||
|
||||
libobelisk_dep = declare_dependency(
|
||||
include_directories : incdirs,
|
||||
link_with : lib,
|
||||
sources : obelisk_lib_sources
|
||||
)
|
14
src/lib/obelisk.cpp
Normal file
14
src/lib/obelisk.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
#include "include/obelisk.h"
|
||||
#include "version.h"
|
||||
|
||||
// TODO: Move the models to the library then link the compiler to the library
|
||||
|
||||
std::string obelisk::Obelisk::getVersion()
|
||||
{
|
||||
return obelisk::version;
|
||||
}
|
||||
|
||||
int obelisk::Obelisk::getLibVersion()
|
||||
{
|
||||
return obelisk::soVersion;
|
||||
}
|
@ -10,5 +10,7 @@ namespace obelisk
|
||||
* @brief The current library version of obelisk.
|
||||
*
|
||||
*/
|
||||
const std::string soVersion = "@so_version@";
|
||||
// clang-format off
|
||||
const int soVersion = @so_version@;
|
||||
// clang-format on
|
||||
} // namespace obelisk
|
@ -1,10 +1,4 @@
|
||||
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
|
||||
)
|
||||
subdir('lib')
|
||||
|
||||
obelisk_sources = files(
|
||||
'obelisk.cpp',
|
||||
@ -29,7 +23,7 @@ link_args = ' ' + r.stdout().replace('\n', ' ')
|
||||
|
||||
executable('obelisk',
|
||||
obelisk_sources,
|
||||
dependencies : [sqlite3],
|
||||
dependencies : [libobelisk_dep, sqlite3],
|
||||
cpp_args : cpp_args.split(),
|
||||
link_args : link_args.split(),
|
||||
install : true
|
||||
|
@ -1,8 +1,9 @@
|
||||
#include "knowledge_base.h"
|
||||
#include "lexer.h"
|
||||
#include "lib/include/obelisk.h"
|
||||
#include "lib/version.h"
|
||||
#include "obelisk.h"
|
||||
#include "parser.h"
|
||||
#include "version.h"
|
||||
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
@ -123,7 +124,7 @@ int main(int argc, char** argv)
|
||||
return EXIT_SUCCESS;
|
||||
break;
|
||||
case 'v' :
|
||||
std::cout << "obelisk " << obelisk::version << std::endl;
|
||||
std::cout << "obelisk " << (new obelisk::Obelisk())->getVersion() << std::endl;
|
||||
return EXIT_SUCCESS;
|
||||
break;
|
||||
default :
|
||||
|
@ -1 +0,0 @@
|
||||
../include/version.h.in
|
Loading…
Reference in New Issue
Block a user