summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-07-17 12:12:39 +0200
committerGitHub <noreply@github.com>2019-07-17 12:12:39 +0200
commitd087a9e3283528792634de84b55a607d9b9b5137 (patch)
treed74801a88a94fd4a6ebd93d0fcf71f97a6315d98
parent4d99e739672733d4d32c9b5bd75bd621cad6dd5c (diff)
parentb07e46c59f5f326ffa18c2e43ae8c64961e033ac (diff)
Merge pull request #30647 from Calinou/add-scons-platform-list
Add a `platform=list` SCons argument to list platforms
-rw-r--r--SConstruct16
1 files changed, 13 insertions, 3 deletions
diff --git a/SConstruct b/SConstruct
index 7b0c644aea..92dc4d9da2 100644
--- a/SConstruct
+++ b/SConstruct
@@ -422,7 +422,7 @@ if selected_platform in platform_list:
if (can_build):
config.configure(env)
env.module_list.append(x)
-
+
# Get doc classes paths (if present)
try:
doc_classes = config.get_doc_classes()
@@ -522,13 +522,23 @@ if selected_platform in platform_list:
env.AppendUnique(CPPDEFINES=[header[1]])
elif selected_platform != "":
+ if selected_platform == "list":
+ print("The following platforms are available:\n")
+ else:
+ print('Invalid target platform "' + selected_platform + '".')
+ print("The following platforms were detected:\n")
- print("Invalid target platform: " + selected_platform)
- print("The following platforms were detected:")
for x in platform_list:
print("\t" + x)
+
print("\nPlease run SCons again and select a valid platform: platform=<string>")
+ if selected_platform == "list":
+ # Exit early to suppress the rest of the built-in SCons messages
+ sys.exit(0)
+ else:
+ sys.exit(255)
+
# The following only makes sense when the env is defined, and assumes it is
if 'env' in locals():
screen = sys.stdout