Build with lalr and unittest-cpp moved into the src directory

This commit is contained in:
Charles Baker 2021-05-20 08:52:28 +12:00 • committed by Charles Baker
parent 4736c9d7a6
commit f165f76213
3 changed files with 21 additions and 11 deletions

View file

@ -1,8 +1,8 @@
local paths = { local paths = {
package.path; package.path;
root( 'lalr/?.lua' ); root( 'src/lalr/?.lua' );
root( 'lalr/?/init.lua' ); root( 'src/lalr/?/init.lua' );
}; };
package.path = table.concat( paths, ';' ); package.path = table.concat( paths, ';' );
@ -15,8 +15,8 @@ local cc = require 'forge.cc' {
lib = root( ('%s/lib'):format(variant) ); lib = root( ('%s/lib'):format(variant) );
obj = root( ('%s/obj'):format(variant) ); obj = root( ('%s/obj'):format(variant) );
include_directories = { include_directories = {
root( 'lalr' ); root( 'src' );
root( 'unittest-cpp' ); root( 'src/unittest-cpp' );
}; };
library_directories = { library_directories = {
root( ('%s/lib'):format(variant) ); root( ('%s/lib'):format(variant) );
@ -55,7 +55,7 @@ local cc = require 'forge.cc' {
}; };
-- Bump the C++ standard to c++14 when building on Windows as that is the -- Bump the C++ standard to c++14 when building on Windows as that is the
-- closest standard supported by Microsoft Visual C++. -- lowest standard supported by Microsoft Visual C++.
local settings = cc.settings; local settings = cc.settings;
if settings.platform == 'windows' then if settings.platform == 'windows' then
settings.standard = 'c++14'; settings.standard = 'c++14';
@ -64,11 +64,12 @@ end
local lalr = require 'forge.lalr'; local lalr = require 'forge.lalr';
cc:install( lalr ); cc:install( lalr );
buildfile 'lalr/lalr.forge'; buildfile 'src/lalr/lalr.forge';
buildfile 'unittest-cpp/unittest-cpp.forge'; buildfile 'src/unittest-cpp/unittest-cpp.forge';
cc:all { cc:all {
'lalr/lalrc/all', 'src/lalr/all',
'lalr/lalr_examples/all', 'src/lalr/lalrc/all',
'lalr/lalr_test/all' 'src/lalr/lalr_examples/all',
'src/lalr/lalr_test/all'
}; };

10
lalr.forge Normal file
View file

@ -0,0 +1,10 @@
buildfile 'src/lalr/lalr.forge';
for _, cc in toolsets('^cc.*') do
cc:all {
'src/lalr/all';
'src/lalr/lalrc/all';
'src/lalr/lalr_test/all';
};
end

View file

@ -1,5 +1,4 @@
buildfile 'lalr/lalr.forge';
buildfile 'lalrc/lalrc.forge'; buildfile 'lalrc/lalrc.forge';
buildfile 'lalr_examples/lalr_examples.forge'; buildfile 'lalr_examples/lalr_examples.forge';
buildfile 'lalr_test/lalr_test.forge'; buildfile 'lalr_test/lalr_test.forge';