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":
|
||||
ret.append("-DOS_POSIX=1")
|
||||
|
||||
ret.append({
|
||||
"Linux": "-DOS_LINUX=1",
|
||||
"Darwin": "-DOS_MACOSX=1",
|
||||
# TODO: Windows?
|
||||
}[platform.system()])
|
||||
system = platform.system()
|
||||
if system == "Linux":
|
||||
ret.append("-DOS_LINUX=1")
|
||||
elif system == "Darwin":
|
||||
ret.append("-DOS_MACOSX=1")
|
||||
else:
|
||||
raise Exception("Unknown platform")
|
||||
|
||||
return ret
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue