From a04edfb157cd8bd4f07abc9bafa9cb0e8c51e4d8 Mon Sep 17 00:00:00 2001 From: Gyeongjae Choi Date: Tue, 30 Aug 2022 05:57:51 +0000 Subject: [PATCH] Don't set toolchain file if CMAKE_TOOLCHAIN_FILE env variable is specified --- emcmake.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emcmake.py b/emcmake.py index b16f565c1..e7887f8f5 100755 --- a/emcmake.py +++ b/emcmake.py @@ -4,6 +4,7 @@ # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. +import os import sys from tools import shared from tools import config @@ -30,7 +31,7 @@ variables so that emcc etc. are used. Typical usage: return any(substr in s for s in args) # Append the Emscripten toolchain file if the user didn't specify one. - if not has_substr(args, '-DCMAKE_TOOLCHAIN_FILE'): + if not has_substr(args, '-DCMAKE_TOOLCHAIN_FILE') and not os.environ.get("CMAKE_TOOLCHAIN_FILE"): args.append('-DCMAKE_TOOLCHAIN_FILE=' + utils.path_from_root('cmake/Modules/Platform/Emscripten.cmake')) if not has_substr(args, '-DCMAKE_CROSSCOMPILING_EMULATOR'): -- 2.37.1