Trick-17 / clang-build

Clang-based cross platform build system written in Python
https://clang-build.readthedocs.io
MIT License
8 stars 3 forks source link

Improve parsing of flags with parameters (i.e. non-switch flags) #97

Closed GPMueller closed 5 years ago

GPMueller commented 5 years ago

Removing flags that appear multiple times makes sense. However, this currently prevents e.g. link = ["-framework", "Cocoa", "-framework", "IOKit"], because the second appearance of -framework is eliminated.

We should be able to parse flags in the form of link = ["-framework Cocoa", "-framework IOKit"], which currently giver errors such as error: unknown argument: '-framework Cocoa'. IMO this is a bug in clang-build.

GPMueller commented 5 years ago

This does the trick:

# Split strings containing spaces
self.compile_flags = list(str(' '.join(self.compile_flags)).split())
self.link_flags    = list(str(' '.join(self.link_flags)).split())