Move public headers to a separate directory, make a library

This commit is contained in:
King_DuckZ 2020-04-30 22:50:46 +02:00
parent 7252a6e1ec
commit 0f0d149ad2
15 changed files with 22 additions and 11 deletions

View file

@ -5,6 +5,7 @@ project('wrentest', 'cpp',
) )
wren_dep = dependency('wren', version: '>=0.2.0', fallback: ['wren', 'wren_dep']) wren_dep = dependency('wren', version: '>=0.2.0', fallback: ['wren', 'wren_dep'])
public_incl = include_directories('include')
os = host_machine.system() os = host_machine.system()
if os == 'gnu' if os == 'gnu'
@ -36,9 +37,8 @@ project_config_file = configure_file(
configuration: conf configuration: conf
) )
executable(meson.project_name(), wrenpp = library(meson.project_name(),
project_config_file, project_config_file,
'src/main.cpp',
'src/wren/vm.cpp', 'src/wren/vm.cpp',
'src/wren/configuration.cpp', 'src/wren/configuration.cpp',
'src/wren/def_configuration.cpp', 'src/wren/def_configuration.cpp',
@ -47,5 +47,16 @@ executable(meson.project_name(),
'src/wren/handle.cpp', 'src/wren/handle.cpp',
'src/wren/vm_fun.cpp', 'src/wren/vm_fun.cpp',
dependencies: [wren_dep], dependencies: [wren_dep],
include_directories: public_incl,
install: true, install: true,
) )
wrenpp_dep = declare_dependency(
link_with: wrenpp,
include_directories: public_incl,
)
executable(meson.project_name(),
'src/main.cpp',
dependencies: wrenpp_dep,
install: false,
)

View file

@ -1,5 +1,5 @@
#include "wren/vm_fun.hpp" #include "wrenpp/vm_fun.hpp"
#include "wren/def_configuration.hpp" #include "wrenpp/def_configuration.hpp"
#include <iostream> #include <iostream>
#include <chrono> #include <chrono>
#include <thread> #include <thread>

View file

@ -1,4 +1,4 @@
#include "configuration.hpp" #include "wrenpp/configuration.hpp"
#include <wren.hpp> #include <wren.hpp>
namespace wren { namespace wren {

View file

@ -1,4 +1,4 @@
#include "def_configuration.hpp" #include "wrenpp/def_configuration.hpp"
#include <iostream> #include <iostream>
namespace wren { namespace wren {

View file

@ -1,5 +1,5 @@
#include "handle.hpp" #include "wrenpp/handle.hpp"
#include "vm.hpp" #include "wrenpp/vm.hpp"
#include <cassert> #include <cassert>
namespace wren { namespace wren {

View file

@ -1,5 +1,5 @@
#include "vm.hpp" #include "wrenpp/vm.hpp"
#include "configuration.hpp" #include "wrenpp/configuration.hpp"
#include "dynafunc_maker.hpp" #include "dynafunc_maker.hpp"
#include <wren.hpp> #include <wren.hpp>
#include <cassert> #include <cassert>

View file

@ -1,4 +1,4 @@
#include "vm_fun.hpp" #include "wrenpp/vm_fun.hpp"
#include <cassert> #include <cassert>
#include <iterator> #include <iterator>
#include <utility> #include <utility>