Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
07b06d76
Commit
07b06d76
authored
Jul 19, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
{android,win32}/build.py: concatenate variables from the command line
parent
856fe2da
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
0 deletions
+37
-0
build.py
android/build.py
+4
-0
cmdline.py
python/build/cmdline.py
+29
-0
build.py
win32/build.py
+4
-0
No files found.
android/build.py
View file @
07b06d76
...
@@ -154,5 +154,9 @@ configure = [
...
@@ -154,5 +154,9 @@ configure = [
]
+
configure_args
]
+
configure_args
from
build.cmdline
import
concatenate_cmdline_variables
configure
=
concatenate_cmdline_variables
(
configure
,
set
((
'CFLAGS'
,
'CXXFLAGS'
,
'CPPFLAGS'
,
'LDFLAGS'
,
'LIBS'
)))
subprocess
.
check_call
(
configure
,
env
=
toolchain
.
env
)
subprocess
.
check_call
(
configure
,
env
=
toolchain
.
env
)
subprocess
.
check_call
([
'/usr/bin/make'
,
'--quiet'
,
'-j12'
],
env
=
toolchain
.
env
)
subprocess
.
check_call
([
'/usr/bin/make'
,
'--quiet'
,
'-j12'
],
env
=
toolchain
.
env
)
python/build/cmdline.py
0 → 100644
View file @
07b06d76
def
concatenate_cmdline_variables
(
src
,
names
):
"""Find duplicate variable declarations on the given source list, and
concatenate the values of those in the 'names' list."""
# the result list being constructed
dest
=
[]
# a map of variable name to destination list index
positions
=
{}
for
item
in
src
:
i
=
item
.
find
(
'='
)
if
i
>
0
:
# it's a variable
name
=
item
[:
i
]
if
name
in
names
:
# it's a known variable
if
name
in
positions
:
# already specified: concatenate instead of
# appending it
dest
[
positions
[
name
]]
+=
' '
+
item
[
i
+
1
:]
continue
else
:
# not yet seen: append it and remember the list
# index
positions
[
name
]
=
len
(
dest
)
dest
.
append
(
item
)
return
dest
win32/build.py
View file @
07b06d76
...
@@ -112,5 +112,9 @@ configure = [
...
@@ -112,5 +112,9 @@ configure = [
]
+
configure_args
]
+
configure_args
from
build.cmdline
import
concatenate_cmdline_variables
configure
=
concatenate_cmdline_variables
(
configure
,
set
((
'CFLAGS'
,
'CXXFLAGS'
,
'CPPFLAGS'
,
'LDFLAGS'
,
'LIBS'
)))
subprocess
.
check_call
(
configure
,
env
=
toolchain
.
env
)
subprocess
.
check_call
(
configure
,
env
=
toolchain
.
env
)
subprocess
.
check_call
([
'/usr/bin/make'
,
'--quiet'
,
'-j12'
],
env
=
toolchain
.
env
)
subprocess
.
check_call
([
'/usr/bin/make'
,
'--quiet'
,
'-j12'
],
env
=
toolchain
.
env
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment