From 9d9f4279ed63da1372d59bc033655eed502fe80e Mon Sep 17 00:00:00 2001 From: Adam Scott Date: Sat, 22 Jul 2023 08:46:14 -0400 Subject: [PATCH] Add platform macros --- tools/android.py | 2 ++ tools/ios.py | 2 ++ tools/javascript.py | 2 ++ tools/linux.py | 2 ++ tools/macos.py | 2 ++ tools/windows.py | 2 ++ 6 files changed, 12 insertions(+) diff --git a/tools/android.py b/tools/android.py index b9077f5d..4735345e 100644 --- a/tools/android.py +++ b/tools/android.py @@ -100,3 +100,5 @@ def generate(env): ) env.Append(CCFLAGS=arch_info["ccflags"]) env.Append(LINKFLAGS=["--target=" + arch_info["target"] + env["android_api_level"], "-march=" + arch_info["march"]]) + + env.Append(CPPDEFINES=["ANDROID_ENABLED", "UNIX_ENABLED"]) diff --git a/tools/ios.py b/tools/ios.py index 11d606b9..477e27a7 100644 --- a/tools/ios.py +++ b/tools/ios.py @@ -79,3 +79,5 @@ def generate(env): env.Append(CCFLAGS=["-isysroot", env["IOS_SDK_PATH"]]) env.Append(LINKFLAGS=["-isysroot", env["IOS_SDK_PATH"], "-F" + env["IOS_SDK_PATH"]]) + + env.Append(CPPDEFINES=["IOS_ENABLED", "UNIX_ENABLED"]) diff --git a/tools/javascript.py b/tools/javascript.py index 5a935848..42c601d2 100644 --- a/tools/javascript.py +++ b/tools/javascript.py @@ -43,3 +43,5 @@ def generate(env): env.Append(CCFLAGS=["-O0", "-g"]) elif env["target"] == "release": env.Append(CCFLAGS=["-O3"]) + + env.Append(CPPDEFINES=["WEB_ENABLED", "UNIX_ENABLED"]) diff --git a/tools/linux.py b/tools/linux.py index 099a0484..cb48ae58 100644 --- a/tools/linux.py +++ b/tools/linux.py @@ -32,3 +32,5 @@ def generate(env): elif env["arch"] == "rv64": env.Append(CCFLAGS=["-march=rv64gc"]) env.Append(LINKFLAGS=["-march=rv64gc"]) + + env.Append(CPPDEFINES=["LINUX_ENABLED", "UNIX_ENABLED"]) diff --git a/tools/macos.py b/tools/macos.py index 2e4bfc68..5718776b 100644 --- a/tools/macos.py +++ b/tools/macos.py @@ -48,3 +48,5 @@ def generate(env): "-Wl,-undefined,dynamic_lookup", ] ) + + env.Append(CPPDEFINES=["MACOS_ENABLED", "UNIX_ENABLED"]) diff --git a/tools/windows.py b/tools/windows.py index b8690c58..979b56eb 100644 --- a/tools/windows.py +++ b/tools/windows.py @@ -70,3 +70,5 @@ def generate(env): "-static-libstdc++", ] ) + + env.Append(CPPDEFINES=["WINDOWS_ENABLED"])