Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C#: Let platforms signal if they support the mono module or not #88245

Merged
merged 1 commit into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions modules/mono/config.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# Prior to .NET Core, we supported these: ["windows", "macos", "linuxbsd", "android", "web", "ios"]
# Eventually support for each them should be added back.
supported_platforms = ["windows", "macos", "linuxbsd", "android", "ios"]


def can_build(env, platform):
if env["arch"].startswith("rv"):
return False
Expand All @@ -14,9 +9,10 @@ def can_build(env, platform):


def configure(env):
platform = env["platform"]
# Check if the platform has marked mono as supported.
supported = env.get("supported", [])

if platform not in supported_platforms:
if not "mono" in supported:
raise RuntimeError("This module does not currently support building for this platform")

env.add_module_version_string("mono")
Expand Down
1 change: 1 addition & 0 deletions platform/android/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def get_flags():
return [
("arch", "arm64"), # Default for convenience.
("target", "template_debug"),
("supported", ["mono"]),
]


Expand Down
1 change: 1 addition & 0 deletions platform/ios/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def get_flags():
("arch", "arm64"), # Default for convenience.
("target", "template_debug"),
("use_volk", False),
("supported", ["mono"]),
]


Expand Down
1 change: 1 addition & 0 deletions platform/linuxbsd/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def get_doc_path():
def get_flags():
return [
("arch", detect_arch()),
("supported", ["mono"]),
]


Expand Down
1 change: 1 addition & 0 deletions platform/macos/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def get_flags():
return [
("arch", detect_arch()),
("use_volk", False),
("supported", ["mono"]),
]


Expand Down
1 change: 1 addition & 0 deletions platform/windows/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ def get_flags():

return [
("arch", arch),
("supported", ["mono"]),
]


Expand Down
Loading