Skip to content

Commit 2127a7d

Browse files
committed
Add platform macros
1 parent 1009da4 commit 2127a7d

File tree

8 files changed

+16
-0
lines changed

8 files changed

+16
-0
lines changed

tools/android.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,5 @@ def generate(env):
100100
)
101101
env.Append(CCFLAGS=arch_info["ccflags"])
102102
env.Append(LINKFLAGS=["--target=" + arch_info["target"] + env["android_api_level"], "-march=" + arch_info["march"]])
103+
104+
env.Append(CPPDEFINES=["ANDROID_ENABLED", "UNIX_ENABLED"])

tools/ios.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,5 @@ def generate(env):
7979

8080
env.Append(CCFLAGS=["-isysroot", env["IOS_SDK_PATH"]])
8181
env.Append(LINKFLAGS=["-isysroot", env["IOS_SDK_PATH"], "-F" + env["IOS_SDK_PATH"]])
82+
83+
env.Append(CPPDEFINES=["IOS_ENABLED", "UNIX_ENABLED", "COREAUDIO_ENABLED"])

tools/ios_osxcross.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ def generate(env):
2424
]
2525
)
2626
env.Append(CCFLAGS=["-stdlib=libc++"])
27+
28+
env.Append(CPPDEFINES=["IOS_ENABLED", "UNIX_ENABLED", "COREAUDIO_ENABLED"])

tools/javascript.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,5 @@ def generate(env):
4343
env.Append(CCFLAGS=["-O0", "-g"])
4444
elif env["target"] == "release":
4545
env.Append(CCFLAGS=["-O3"])
46+
47+
env.Append(CPPDEFINES=["WEB_ENABLED", "UNIX_ENABLED"])

tools/linux.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ def generate(env):
3232
elif env["arch"] == "rv64":
3333
env.Append(CCFLAGS=["-march=rv64gc"])
3434
env.Append(LINKFLAGS=["-march=rv64gc"])
35+
36+
env.Append(CPPDEFINES=["LINUX_ENABLED", "UNIX_ENABLED"])

tools/macos.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,5 @@ def generate(env):
4848
"-Wl,-undefined,dynamic_lookup",
4949
]
5050
)
51+
52+
env.Append(CPPDEFINES=["MACOS_ENABLED", "UNIX_ENABLED", "COREAUDIO_ENABLED", "COREMIDI_ENABLED"])

tools/macos_osxcross.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ def generate(env):
2626
if binpath not in env["ENV"]["PATH"]:
2727
# Add OSXCROSS bin folder to PATH (required for linking).
2828
env["ENV"]["PATH"] = "%s:%s" % (binpath, env["ENV"]["PATH"])
29+
30+
env.Append(CPPDEFINES=["MACOS_ENABLED", "UNIX_ENABLED", "COREAUDIO_ENABLED", "COREMIDI_ENABLED"])

tools/windows.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,5 @@ def generate(env):
7070
"-static-libstdc++",
7171
]
7272
)
73+
74+
env.Append(CPPDEFINES=["WINDOWS_ENABLED", "WASAPI_ENABLED", "WINMIDI_ENABLED"])

0 commit comments

Comments
 (0)