Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hammer
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vyrus
hammer
Commits
c36a22b2
Commit
c36a22b2
authored
8 years ago
by
Andrea Shepard
Browse files
Options
Downloads
Patches
Plain Diff
Make debug build unoptimized and keep -O2 from llvm-config out of it
parent
4cbee7f0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SConstruct
+1
-1
1 addition, 1 deletion
SConstruct
src/SConscript
+16
-2
16 additions, 2 deletions
src/SConscript
with
17 additions
and
3 deletions
SConstruct
+
1
−
1
View file @
c36a22b2
...
@@ -80,7 +80,7 @@ AddOption("--in-place",
...
@@ -80,7 +80,7 @@ AddOption("--in-place",
dbg
=
env
.
Clone
(
VARIANT
=
'
debug
'
)
dbg
=
env
.
Clone
(
VARIANT
=
'
debug
'
)
dbg
.
Append
(
CCFLAGS
=
[
'
-g
'
]
)
dbg
.
MergeFlags
(
"
-g -O0
"
)
opt
=
env
.
Clone
(
VARIANT
=
'
opt
'
)
opt
=
env
.
Clone
(
VARIANT
=
'
opt
'
)
opt
.
Append
(
CCFLAGS
=
[
"
-O3
"
])
opt
.
Append
(
CCFLAGS
=
[
"
-O3
"
])
...
...
This diff is collapsed.
Click to expand it.
src/SConscript
+
16
−
2
View file @
c36a22b2
# -*- python -*-
# -*- python -*-
import
os.path
import
os.path
from
distutils.version
import
LooseVersion
from
distutils.version
import
LooseVersion
import
re
import
subprocess
import
subprocess
Import
(
'
env testruns
'
)
Import
(
'
env testruns
'
)
...
@@ -79,7 +80,20 @@ ctests = ['t_benchmark.c',
...
@@ -79,7 +80,20 @@ ctests = ['t_benchmark.c',
'
t_misc.c
'
,
'
t_misc.c
'
,
'
t_regression.c
'
]
'
t_regression.c
'
]
env
.
ParseConfig
(
'
%s --cflags --ldflags
'
%
env
[
"
LLVM_CONFIG
"
])
# llvm-config 'helpfully' supplies -g and -O flags; educate it with this
# custom ParseConfig function arg
def
llvm_config_sanitize
(
env
,
cmd
,
unique
=
1
):
# cmd is output from llvm-config
flags
=
cmd
.
split
()
# match -g or -O flags
p
=
re
.
compile
(
"
^-[gO].*$
"
)
filtered_flags
=
[
flag
for
flag
in
flags
if
not
p
.
match
(
flag
)]
filtered_cmd
=
'
'
.
join
(
filtered_flags
)
# print "llvm_config_sanitize: \"%s\" => \"%s\"" % (cmd, filtered_cmd)
env
.
MergeFlags
(
filtered_cmd
,
unique
)
env
.
ParseConfig
(
'
%s --cflags --ldflags
'
%
env
[
"
LLVM_CONFIG
"
],
function
=
llvm_config_sanitize
)
libhammer_shared
=
env
.
SharedLibrary
(
'
hammer
'
,
parsers
+
backends
+
misc_hammer_parts
)
libhammer_shared
=
env
.
SharedLibrary
(
'
hammer
'
,
parsers
+
backends
+
misc_hammer_parts
)
libhammer_static
=
env
.
StaticLibrary
(
'
hammer
'
,
parsers
+
backends
+
misc_hammer_parts
)
libhammer_static
=
env
.
StaticLibrary
(
'
hammer
'
,
parsers
+
backends
+
misc_hammer_parts
)
Default
(
libhammer_shared
,
libhammer_static
)
Default
(
libhammer_shared
,
libhammer_static
)
...
@@ -102,7 +116,7 @@ else:
...
@@ -102,7 +116,7 @@ else:
testenv_llvm_system_libs_flag
=
""
testenv_llvm_system_libs_flag
=
""
testenv
.
ParseConfig
(
'
%s --cflags --ldflags --libs %s core executionengine mcjit analysis x86codegen x86info
'
%
\
testenv
.
ParseConfig
(
'
%s --cflags --ldflags --libs %s core executionengine mcjit analysis x86codegen x86info
'
%
\
(
env
[
"
LLVM_CONFIG
"
],
testenv_llvm_system_libs_flag
))
(
env
[
"
LLVM_CONFIG
"
],
testenv_llvm_system_libs_flag
)
,
function
=
llvm_config_sanitize
)
testenv
.
Append
(
LIBS
=
[
'
stdc++
'
],
LIBPATH
=
[
'
.
'
])
testenv
.
Append
(
LIBS
=
[
'
stdc++
'
],
LIBPATH
=
[
'
.
'
])
ctestexec
=
testenv
.
Program
(
'
test_suite
'
,
ctests
+
[
'
test_suite.c
'
],
LINKFLAGS
=
"
--coverage
"
if
testenv
.
GetOption
(
"
coverage
"
)
else
None
)
ctestexec
=
testenv
.
Program
(
'
test_suite
'
,
ctests
+
[
'
test_suite.c
'
],
LINKFLAGS
=
"
--coverage
"
if
testenv
.
GetOption
(
"
coverage
"
)
else
None
)
ctest
=
Alias
(
'
testc
'
,
[
ctestexec
],
""
.
join
([
"
env LD_LIBRARY_PATH=
"
,
os
.
path
.
dirname
(
ctestexec
[
0
].
path
),
"
"
,
ctestexec
[
0
].
path
]))
ctest
=
Alias
(
'
testc
'
,
[
ctestexec
],
""
.
join
([
"
env LD_LIBRARY_PATH=
"
,
os
.
path
.
dirname
(
ctestexec
[
0
].
path
),
"
"
,
ctestexec
[
0
].
path
]))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment