streamlined build to fit nixos packaging
parent
755d42537e
commit
568ad71ca6
|
@ -59,7 +59,7 @@ Mkfile.old
|
||||||
dkms.conf
|
dkms.conf
|
||||||
|
|
||||||
# binary files
|
# binary files
|
||||||
bin/
|
build/
|
||||||
# test files
|
# test files
|
||||||
assets/
|
assets/
|
||||||
# custom build tracking
|
# custom build tracking
|
||||||
|
|
31
SConstruct
31
SConstruct
|
@ -29,15 +29,26 @@ def add_kel_source_files(self, sources, filetype, lib_env=None, shared=False, ta
|
||||||
sources.append( self.StaticObject( target=target_name, source=path ) )
|
sources.append( self.StaticObject( target=target_name, source=path ) )
|
||||||
pass
|
pass
|
||||||
|
|
||||||
env=Environment(ENV=os.environ, CPPPATH=['#source/forstio','#source','#','#driver'],
|
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=['#source/forstio','#source','#','#driver'],
|
||||||
CXX='clang++',
|
CXX='clang++',
|
||||||
CPPDEFINES=['SAW_UNIX'],
|
CPPDEFINES=['SAW_UNIX'],
|
||||||
CXXFLAGS=['-std=c++20','-g','-Wall','-Wextra'],
|
CXXFLAGS=['-std=c++20','-g','-Wall','-Wextra'],
|
||||||
LIBS=['gnutls'])
|
LIBS=['gnutls'])
|
||||||
env.__class__.add_source_files = add_kel_source_files
|
env.__class__.add_source_files = add_kel_source_files
|
||||||
|
|
||||||
print(os.environ)
|
|
||||||
|
|
||||||
env.objects = []
|
env.objects = []
|
||||||
env.sources = []
|
env.sources = []
|
||||||
env.headers = []
|
env.headers = []
|
||||||
|
@ -58,11 +69,11 @@ env_library = env.Clone()
|
||||||
|
|
||||||
env.objects_shared = []
|
env.objects_shared = []
|
||||||
env_library.add_source_files(env.objects_shared, env.sources + env.driver_sources + env.tls_sources, shared=True)
|
env_library.add_source_files(env.objects_shared, env.sources + env.driver_sources + env.tls_sources, shared=True)
|
||||||
env.library_shared = env_library.SharedLibrary('#bin/forstio', [env.objects_shared])
|
env.library_shared = env_library.SharedLibrary('#build/forstio', [env.objects_shared])
|
||||||
|
|
||||||
env.objects_static = []
|
env.objects_static = []
|
||||||
env_library.add_source_files(env.objects_static, env.sources + env.driver_sources + env.tls_sources)
|
env_library.add_source_files(env.objects_static, env.sources + env.driver_sources + env.tls_sources)
|
||||||
env.library_static = env_library.StaticLibrary('#bin/forstio', [env.objects_static])
|
env.library_static = env_library.StaticLibrary('#build/forstio', [env.objects_static])
|
||||||
|
|
||||||
env.Alias('library', [env.library_shared, env.library_static])
|
env.Alias('library', [env.library_shared, env.library_static])
|
||||||
env.Alias('library_shared', env.library_shared)
|
env.Alias('library_shared', env.library_shared)
|
||||||
|
@ -89,9 +100,9 @@ env.Alias('format', env.format_actions)
|
||||||
|
|
||||||
env.Alias('all', ['format', 'library_shared', 'library_static', 'test'])
|
env.Alias('all', ['format', 'library_shared', 'library_static', 'test'])
|
||||||
|
|
||||||
env.Install('/usr/local/lib/', [env.library_shared, env.library_static])
|
env.Install('$prefix/lib/', [env.library_shared, env.library_static])
|
||||||
env.Install('/usr/local/include/forstio/', [env.headers])
|
env.Install('$prefix/include/forstio/', [env.headers])
|
||||||
env.Install('/usr/local/include/forstio/tls/', [env.tls_headers])
|
env.Install('$prefix/include/forstio/tls/', [env.tls_headers])
|
||||||
|
|
||||||
env.Install('/usr/local/include/forstio/test/', [env.test_headers])
|
env.Install('$prefix/include/forstio/test/', [env.test_headers])
|
||||||
env.Alias('install', '/usr/local/')
|
env.Alias('install', '$prefix')
|
||||||
|
|
|
@ -15,4 +15,4 @@ env.test_objects = []
|
||||||
env.test_sources.append(dir_path+'/suite/suite.cpp')
|
env.test_sources.append(dir_path+'/suite/suite.cpp')
|
||||||
env.test_headers = [dir_path + '/suite/suite.h']
|
env.test_headers = [dir_path + '/suite/suite.h']
|
||||||
|
|
||||||
env.test_program = env_test.Program('#bin/test', [env.test_sources, env.library_static])
|
env.test_program = env_test.Program('#build/test', [env.test_sources, env.library_static])
|
||||||
|
|
Loading…
Reference in New Issue