diff options
author | Claudius Holeksa <mail@keldu.de> | 2023-05-03 20:34:02 +0200 |
---|---|---|
committer | Claudius Holeksa <mail@keldu.de> | 2023-05-03 20:34:02 +0200 |
commit | 2aa2af0007b7e969845642027c635cd3fd9c8aea (patch) | |
tree | e72a05a3c2bfe58442b160c0c8e98ce1d095f36f /src/codec/SConstruct | |
parent | 9b81a2585142260f89d47cbe1e592cec9e1f778f (diff) |
Moved dirs and added codec-json dir
Diffstat (limited to 'src/codec/SConstruct')
-rw-r--r-- | src/codec/SConstruct | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/src/codec/SConstruct b/src/codec/SConstruct new file mode 100644 index 0000000..0d7b7c6 --- /dev/null +++ b/src/codec/SConstruct @@ -0,0 +1,66 @@ +#!/usr/bin/env python3 + +import sys +import os +import os.path +import glob +import re + + +if sys.version_info < (3,): + def isbasestring(s): + return isinstance(s,basestring) +else: + def isbasestring(s): + return isinstance(s, (str,bytes)) + +def add_kel_source_files(self, sources, filetype, lib_env=None, shared=False, target_post=""): + + if isbasestring(filetype): + dir_path = self.Dir('.').abspath + filetype = sorted(glob.glob(dir_path+"/"+filetype)) + + for path in filetype: + target_name = re.sub( r'(.*?)(\.cpp|\.c\+\+)', r'\1' + target_post, path ) + if shared: + target_name+='.os' + sources.append( self.SharedObject( target=target_name, source=path ) ) + else: + target_name+='.o' + sources.append( self.StaticObject( target=target_name, source=path ) ) + pass + +def isAbsolutePath(key, dirname, env): + assert os.path.isabs(dirname), "%r must have absolute path syntax" % (key,) + +env_vars = Variables( + args=ARGUMENTS +) + +env_vars.Add('prefix', + help='Installation target location of build results and headers', + default='/usr/local/', + validator=isAbsolutePath +) + +env=Environment(ENV=os.environ, variables=env_vars, CPPPATH=[], + CPPDEFINES=['SAW_UNIX'], + CXXFLAGS=['-std=c++20','-g','-Wall','-Wextra'], + LIBS=['forstio-core']) +env.__class__.add_source_files = add_kel_source_files +env.Tool('compilation_db'); +env.cdb = env.CompilationDatabase('compile_commands.json'); + +env.objects = []; +env.sources = []; +env.headers = []; +env.targets = []; + +Export('env') +SConscript('SConscript') + +env.Alias('cdb', env.cdb); +env.Alias('all', [env.targets]); +env.Default('all'); + +env.Alias('install', '$prefix') |