Skip to content

Commit 064a6f3

Browse files
Changes in pull/327 were adding empty strigs to compile_args, link_args (#335)
This was breaking build on GNU toolchain. Adding clean-up routine to remove empty strings fixes it.
1 parent 30033c1 commit 064a6f3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@
6060
long_description = file.read()
6161

6262

63+
def remove_empty(li):
64+
return [el for el in li if el]
65+
66+
6367
def get_sdl_cflags():
6468
cflags = []
6569
if IS_LIN or IS_MAC:
@@ -71,7 +75,7 @@ def get_sdl_cflags():
7175
"-Wformat-security",
7276
]
7377
# Add cflags from environment
74-
cflags += os.getenv("CFLAGS", "").split(" ")
78+
cflags += remove_empty(os.getenv("CFLAGS", "").split(" "))
7579

7680
return cflags
7781

@@ -83,7 +87,7 @@ def get_sdl_ldflags():
8387
elif IS_WIN:
8488
ldflags = ["/NXCompat", "/DynamicBase"]
8589
# Add ldflags from environment
86-
ldflags += os.getenv("LDFLAGS", "").split(" ")
90+
ldflags += remove_empty(os.getenv("LDFLAGS", "").split(" "))
8791

8892
return ldflags
8993

0 commit comments

Comments
 (0)