mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Convert platform dictionary to if-else
Makes it more extendible.
This commit is contained in:
parent
9eea2be09e
commit
cfc27b3df5
1 changed files with 7 additions and 5 deletions
|
@ -135,11 +135,13 @@ def platform_dependent_defines():
|
||||||
if os.name == "posix":
|
if os.name == "posix":
|
||||||
ret.append("-DOS_POSIX=1")
|
ret.append("-DOS_POSIX=1")
|
||||||
|
|
||||||
ret.append({
|
system = platform.system()
|
||||||
"Linux": "-DOS_LINUX=1",
|
if system == "Linux":
|
||||||
"Darwin": "-DOS_MACOSX=1",
|
ret.append("-DOS_LINUX=1")
|
||||||
# TODO: Windows?
|
elif system == "Darwin":
|
||||||
}[platform.system()])
|
ret.append("-DOS_MACOSX=1")
|
||||||
|
else:
|
||||||
|
raise Exception("Unknown platform")
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue