mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Add profile targets for gcc and clang
This commit is contained in:
33
SConstruct
33
SConstruct
@@ -11,14 +11,17 @@
|
|||||||
all All available variants
|
all All available variants
|
||||||
debug All available debug variants
|
debug All available debug variants
|
||||||
release All available release variants
|
release All available release variants
|
||||||
|
profile All available profile variants
|
||||||
|
|
||||||
clang All clang variants
|
clang All clang variants
|
||||||
clang.debug clang debug variant
|
clang.debug clang debug variant
|
||||||
clang.release clang release variant
|
clang.release clang release variant
|
||||||
|
clang.profile clang profile variant
|
||||||
|
|
||||||
gcc All gcc variants
|
gcc All gcc variants
|
||||||
gcc.debug gcc debug variant
|
gcc.debug gcc debug variant
|
||||||
gcc.release gcc release variant
|
gcc.release gcc release variant
|
||||||
|
gcc.profile gcc profile variant
|
||||||
|
|
||||||
msvc All msvc variants
|
msvc All msvc variants
|
||||||
msvc.debug MSVC debug variant
|
msvc.debug MSVC debug variant
|
||||||
@@ -28,6 +31,11 @@
|
|||||||
|
|
||||||
count Show line count metrics
|
count Show line count metrics
|
||||||
|
|
||||||
|
Any individual target can also have ".nounity" appended for a classic,
|
||||||
|
non unity build. Example:
|
||||||
|
|
||||||
|
scons gcc.debug.nounity
|
||||||
|
|
||||||
If the clang toolchain is detected, then the default target will use it, else
|
If the clang toolchain is detected, then the default target will use it, else
|
||||||
the gcc toolchain will be used. On Windows environments, the MSVC toolchain is
|
the gcc toolchain will be used. On Windows environments, the MSVC toolchain is
|
||||||
also detected.
|
also detected.
|
||||||
@@ -250,7 +258,7 @@ def config_env(toolchain, variant, env):
|
|||||||
if variant == 'debug':
|
if variant == 'debug':
|
||||||
env.Append(CPPDEFINES=['DEBUG', '_DEBUG'])
|
env.Append(CPPDEFINES=['DEBUG', '_DEBUG'])
|
||||||
|
|
||||||
elif variant == 'release':
|
elif variant == 'release' or variant == 'profile':
|
||||||
env.Append(CPPDEFINES=['NDEBUG'])
|
env.Append(CPPDEFINES=['NDEBUG'])
|
||||||
|
|
||||||
if toolchain in Split('clang gcc'):
|
if toolchain in Split('clang gcc'):
|
||||||
@@ -268,6 +276,21 @@ def config_env(toolchain, variant, env):
|
|||||||
'-g' # generate debug symbols
|
'-g' # generate debug symbols
|
||||||
])
|
])
|
||||||
|
|
||||||
|
env.Append(LINKFLAGS=[
|
||||||
|
'-rdynamic',
|
||||||
|
'-g',
|
||||||
|
])
|
||||||
|
|
||||||
|
if variant == 'profile':
|
||||||
|
env.Append(CCFLAGS=[
|
||||||
|
'-p',
|
||||||
|
'-pg',
|
||||||
|
])
|
||||||
|
env.Append(LINKFLAGS=[
|
||||||
|
'-p',
|
||||||
|
'-pg',
|
||||||
|
])
|
||||||
|
|
||||||
if toolchain == 'clang':
|
if toolchain == 'clang':
|
||||||
env.Append(CCFLAGS=['-Wno-redeclared-class-member'])
|
env.Append(CCFLAGS=['-Wno-redeclared-class-member'])
|
||||||
env.Append(CPPDEFINES=['BOOST_ASIO_HAS_STD_ARRAY'])
|
env.Append(CPPDEFINES=['BOOST_ASIO_HAS_STD_ARRAY'])
|
||||||
@@ -331,10 +354,6 @@ def config_env(toolchain, variant, env):
|
|||||||
else:
|
else:
|
||||||
env.Append(LIBS=['rt'])
|
env.Append(LIBS=['rt'])
|
||||||
|
|
||||||
env.Append(LINKFLAGS=[
|
|
||||||
'-rdynamic'
|
|
||||||
])
|
|
||||||
|
|
||||||
if variant == 'release':
|
if variant == 'release':
|
||||||
env.Append(CCFLAGS=[
|
env.Append(CCFLAGS=[
|
||||||
'-O3',
|
'-O3',
|
||||||
@@ -481,7 +500,7 @@ base.Append(CPPPATH=[
|
|||||||
])
|
])
|
||||||
|
|
||||||
# Configure the toolchains, variants, default toolchain, and default target
|
# Configure the toolchains, variants, default toolchain, and default target
|
||||||
variants = ['debug', 'release']
|
variants = ['debug', 'release', 'profile']
|
||||||
all_toolchains = ['clang', 'gcc', 'msvc']
|
all_toolchains = ['clang', 'gcc', 'msvc']
|
||||||
if Beast.system.osx:
|
if Beast.system.osx:
|
||||||
toolchains = ['clang']
|
toolchains = ['clang']
|
||||||
@@ -552,6 +571,8 @@ msvc_configs = []
|
|||||||
for tu_style in ['classic', 'unity']:
|
for tu_style in ['classic', 'unity']:
|
||||||
for toolchain in all_toolchains:
|
for toolchain in all_toolchains:
|
||||||
for variant in variants:
|
for variant in variants:
|
||||||
|
if variant == 'profile' and toolchain == 'msvc':
|
||||||
|
continue
|
||||||
# Configure this variant's construction environment
|
# Configure this variant's construction environment
|
||||||
env = base.Clone()
|
env = base.Clone()
|
||||||
config_env(toolchain, variant, env)
|
config_env(toolchain, variant, env)
|
||||||
|
|||||||
Reference in New Issue
Block a user