Skip to content

Commit 6577be0

Browse files
authored
Don't set toolchain file if CMAKE_TOOLCHAIN_FILE env variable is specified (#17757)
1 parent e98554f commit 6577be0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

emcmake.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# University of Illinois/NCSA Open Source License. Both these licenses can be
55
# found in the LICENSE file.
66

7+
import os
78
import sys
89
from tools import shared
910
from tools import config
@@ -30,7 +31,7 @@ def has_substr(args, substr):
3031
return any(substr in s for s in args)
3132

3233
# Append the Emscripten toolchain file if the user didn't specify one.
33-
if not has_substr(args, '-DCMAKE_TOOLCHAIN_FILE'):
34+
if not has_substr(args, '-DCMAKE_TOOLCHAIN_FILE') and 'CMAKE_TOOLCHAIN_FILE' not in os.environ:
3435
args.append('-DCMAKE_TOOLCHAIN_FILE=' + utils.path_from_root('cmake/Modules/Platform/Emscripten.cmake'))
3536

3637
if not has_substr(args, '-DCMAKE_CROSSCOMPILING_EMULATOR'):

0 commit comments

Comments
 (0)