From c3a900ea533b4fe77ad02b8484f86392d52facc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Sun, 2 Mar 2014 03:59:18 +0100 Subject: [PATCH] Change library suffix from _debug to D for debug build. And no suffix for a release build. --- SConstruct | 4 +++- src/SConscript | 4 ++-- test/SConscript | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/SConstruct b/SConstruct index 4a4e817..2afb480 100644 --- a/SConstruct +++ b/SConstruct @@ -74,6 +74,7 @@ assertions = GetOption('assertions') stack_protection = GetOption('stack_protection') test_xml = GetOption('test_xml') prefix = GetOption('prefix') +lib_suffix = '' if not (build_type in ['debug', 'release']): print "Error: expected 'debug' or 'release', found: " + build_type Exit(1) @@ -111,6 +112,7 @@ if build_type == 'release': env.Append(CPPDEFINES = ['NDEBUG']) elif build_type == 'debug': + lib_suffix = 'D' env.Append(CPPDEFINES = ['DEBUG']) if stack_protection: @@ -132,7 +134,7 @@ if stack_protection: subst_info['@build_host@'] = platform.node() -Export('env', 'build_type', 'prefix', 'version_info', 'test_xml', 'subst_info') +Export('env', 'build_type', 'prefix', 'lib_suffix', 'version_info', 'test_xml', 'subst_info') #put all .sconsign files in one place env.SConsignFile() diff --git a/src/SConscript b/src/SConscript index c11d3ac..1367097 100644 --- a/src/SConscript +++ b/src/SConscript @@ -1,6 +1,6 @@ import os -Import('env', 'build_type', 'prefix', 'subst_info') +Import('env', 'build_type', 'prefix', 'lib_suffix', 'subst_info') ucore_env = env.Clone() @@ -13,7 +13,7 @@ sources = ucore_env.Glob('*.c') #print 'sources:', sources[len(sources)-2] #Build library -ucore_lib = ucore_env.StaticLibrary(target='ucore_' + build_type , source=sources) +ucore_lib = ucore_env.StaticLibrary(target='ucore' + lib_suffix , source=sources) #install targets ucore_env.Alias('install', diff --git a/test/SConscript b/test/SConscript index 074db11..911dc9d 100644 --- a/test/SConscript +++ b/test/SConscript @@ -1,10 +1,10 @@ import platform -Import('env', 'build_type', 'prefix', 'version_info', 'test_xml') +Import('env', 'build_type', 'prefix', 'lib_suffix', 'version_info', 'test_xml') test_env = env.Clone() test_env.Append(LIBPATH = ['#build/src']); -test_env.Append(LIBS = ['ucore_' + build_type, 'check']) +test_env.Append(LIBS = ['ucore' + lib_suffix, 'check']) system = platform.system()