summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Gilleron <marc.gilleron@gmail.com>2020-03-30 22:58:20 +0100
committerMarc Gilleron <marc.gilleron@gmail.com>2020-06-02 19:44:56 +0100
commitdb941344e32590142eadebe7d0ec362e71528ec1 (patch)
tree6d3711fa44e709f64e9d21c963f8f8e7f830c538
parentc2f765e49c7dd0c86729e6ba17f87c039203bce0 (diff)
downloadredot-cpp-db941344e32590142eadebe7d0ec362e71528ec1.tar.gz
Fix default value of `bits` misnaming resulting library
-rw-r--r--SConstruct28
1 files changed, 13 insertions, 15 deletions
diff --git a/SConstruct b/SConstruct
index 881b44d..43887bd 100644
--- a/SConstruct
+++ b/SConstruct
@@ -68,6 +68,17 @@ else:
'platform=<platform>'
)
+env = Environment(ENV = os.environ)
+
+is64 = sys.maxsize > 2**32
+if (
+ env['TARGET_ARCH'] == 'amd64' or
+ env['TARGET_ARCH'] == 'emt64' or
+ env['TARGET_ARCH'] == 'x86_64' or
+ env['TARGET_ARCH'] == 'arm64-v8a'
+):
+ is64 = True
+
opts = Variables([], ARGUMENTS)
opts.Add(EnumVariable(
'platform',
@@ -79,8 +90,8 @@ opts.Add(EnumVariable(
opts.Add(EnumVariable(
'bits',
'Target platform bits',
- 'default',
- ('default', '32', '64')
+ '64' if is64 else '32',
+ ('32', '64')
))
opts.Add(BoolVariable(
'use_llvm',
@@ -145,22 +156,9 @@ opts.Add(
os.environ.get("ANDROID_NDK_ROOT", None)
)
-env = Environment(ENV = os.environ)
opts.Update(env)
Help(opts.GenerateHelpText(env))
-is64 = sys.maxsize > 2**32
-if (
- env['TARGET_ARCH'] == 'amd64' or
- env['TARGET_ARCH'] == 'emt64' or
- env['TARGET_ARCH'] == 'x86_64' or
- env['TARGET_ARCH'] == 'arm64-v8a'
-):
- is64 = True
-
-if env['bits'] == 'default':
- env['bits'] = '64' if is64 else '32'
-
# This makes sure to keep the session environment variables on Windows.
# This way, you can run SCons in a Visual Studio 2017 prompt and it will find
# all the required tools