Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Core Modules
dune-common
Commits
004eb3c1
Commit
004eb3c1
authored
3 years ago
by
Andreas Dedner
Browse files
Options
Downloads
Patches
Plain Diff
[Python] parse env variable for cmake flags to use when generating dune-py
parent
9fd59291
No related branches found
No related tags found
1 merge request
!1066
[python] dynamically print progress during build
Pipeline
#41889
passed
3 years ago
Stage: test
Stage: downstream
Pipeline: Dune Nightly Test
#41890
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
python/dune/generator/cmakebuilder.py
+3
-2
3 additions, 2 deletions
python/dune/generator/cmakebuilder.py
python/dune/packagemetadata.py
+12
-7
12 additions, 7 deletions
python/dune/packagemetadata.py
with
15 additions
and
9 deletions
python/dune/generator/cmakebuilder.py
+
3
−
2
View file @
004eb3c1
...
...
@@ -13,7 +13,8 @@ import dune
from
dune.packagemetadata
import
(
getDunePyDir
,
Description
,
getBuildMetaData
,
getCMakeFlags
,
getExternalPythonModules
getBuildMetaData
,
getCMakeFlags
,
envCMakeFlags
,
getExternalPythonModules
)
from
dune.common
import
comm
...
...
@@ -119,7 +120,7 @@ class Builder:
outfile
.
write
(
env
.
get_template
(
relative_template_file
).
render
(
**
context
))
# configure dune-py
Builder
.
callCMake
([
"
cmake
"
,
"
.
"
],
Builder
.
callCMake
([
"
cmake
"
]
+
envCMakeFlags
()
+
[
"
.
"
],
cwd
=
dunepy_dir
,
infoTxt
=
"
Configuring dune-py with CMake
"
,
active
=
True
,
# print details anyway
...
...
This diff is collapsed.
Click to expand it.
python/dune/packagemetadata.py
+
12
−
7
View file @
004eb3c1
...
...
@@ -274,6 +274,15 @@ def cmakeArguments(cmakeArgs):
else
:
raise
ValueError
(
'
definitions must be a list or a dictionary.
'
)
def
envCMakeFlags
(
flags
=
[]):
cmakeFlags
=
os
.
environ
.
get
(
'
DUNE_CMAKE_FLAGS
'
)
# split cmakeFlags and add them to flags
if
cmakeFlags
is
not
None
:
flags
+=
shlex
.
split
(
cmakeFlags
)
cmakeFlags
=
os
.
environ
.
get
(
'
CMAKE_FLAGS
'
)
if
cmakeFlags
is
not
None
:
flags
+=
shlex
.
split
(
cmakeFlags
)
return
flags
def
defaultCMakeFlags
():
# defaults
...
...
@@ -290,13 +299,7 @@ def defaultCMakeFlags():
# flags['DUNE_PYTHON_VIRTUALENV_PATH'] = sys.prefix
flags
=
cmakeArguments
(
flags
)
# make cmake command line out of dict
# test environment for additional flags
cmakeFlags
=
os
.
environ
.
get
(
'
DUNE_CMAKE_FLAGS
'
)
# split cmakeFlags and add them to flags
if
cmakeFlags
is
not
None
:
flags
+=
shlex
.
split
(
cmakeFlags
)
cmakeFlags
=
os
.
environ
.
get
(
'
CMAKE_FLAGS
'
)
if
cmakeFlags
is
not
None
:
flags
+=
shlex
.
split
(
cmakeFlags
)
flags
=
envCMakeFlags
(
flags
)
return
flags
...
...
@@ -554,6 +557,7 @@ def _extractCMakeFlags():
stdout
,
_
=
proc
.
communicate
()
cmakeArgs
=
shlex
.
split
(
stdout
.
decode
(
'
utf-8
'
))
"""
# check environment variable
cmakeArgs += shlex.split(os.environ.get(
'
CMAKE_FLAGS
'
,
''
))
...
...
@@ -565,6 +569,7 @@ def _extractCMakeFlags():
cmakeFlags[k] = v.strip()
except ValueError: # no
'
=
'
in line
pass
"""
# try to unify 'ON' and 'OFF' values
for
k
,
v
in
cmakeFlags
.
items
():
...
...
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