@@ -142,7 +142,7 @@ def exit_with_error(msg):
142
142
exit_with_error ('unknown machine architecture: ' + machine )
143
143
144
144
# Don't saturate all cores to not steal the whole system, but be aggressive.
145
- CPU_CORES = int (os .environ . get ('EMSDK_NUM_CORES' , max (multiprocessing .cpu_count () - 1 , 1 )))
145
+ CPU_CORES = int (os .getenv ('EMSDK_NUM_CORES' , max (multiprocessing .cpu_count () - 1 , 1 )))
146
146
147
147
CMAKE_BUILD_TYPE_OVERRIDE = None
148
148
@@ -256,7 +256,7 @@ def is_exe(fpath):
256
256
257
257
def vswhere (version ):
258
258
try :
259
- program_files = os .environ . get ('ProgramFiles(x86)' )
259
+ program_files = os .getenv ('ProgramFiles(x86)' )
260
260
if not program_files :
261
261
program_files = os .environ ['ProgramFiles' ]
262
262
vswhere_path = os .path .join (program_files , 'Microsoft Visual Studio' , 'Installer' , 'vswhere.exe' )
@@ -1191,14 +1191,14 @@ def build_fastcomp(tool):
1191
1191
targets_to_build += ';'
1192
1192
targets_to_build += 'JSBackend'
1193
1193
args += ['-DLLVM_TARGETS_TO_BUILD=' + targets_to_build , '-DLLVM_INCLUDE_EXAMPLES=OFF' , '-DCLANG_INCLUDE_EXAMPLES=OFF' , '-DLLVM_INCLUDE_TESTS=' + tests_arg , '-DCLANG_INCLUDE_TESTS=' + tests_arg , '-DLLVM_ENABLE_ASSERTIONS=' + ('ON' if enable_assertions else 'OFF' )]
1194
- if os .environ . get ('LLVM_CMAKE_ARGS' ):
1194
+ if os .getenv ('LLVM_CMAKE_ARGS' ):
1195
1195
extra_args = os .environ ['LLVM_CMAKE_ARGS' ].split (',' )
1196
1196
print ('Passing the following extra arguments to LLVM CMake configuration: ' + str (extra_args ))
1197
1197
args += extra_args
1198
1198
1199
1199
# MacOS < 10.13 workaround for LLVM build bug https://github.com/kripken/emscripten/issues/5418:
1200
1200
# specify HAVE_FUTIMENS=0 in the build if building with target SDK that is older than 10.13.
1201
- if MACOS and (not os . environ . get ( 'LLVM_CMAKE_ARGS' ) or ' HAVE_FUTIMENS' not in os .environ . get ('LLVM_CMAKE_ARGS' )) and xcode_sdk_version () < ['10' , '13' ]:
1201
+ if MACOS and (' HAVE_FUTIMENS' not in os .getenv ('LLVM_CMAKE_ARGS' , ' ' )) and xcode_sdk_version () < ['10' , '13' ]:
1202
1202
print ('Passing -DHAVE_FUTIMENS=0 to LLVM CMake configure to workaround https://github.com/kripken/emscripten/issues/5418. Please update to macOS 10.13 or newer' )
1203
1203
args += ['-DHAVE_FUTIMENS=0' ]
1204
1204
@@ -1266,7 +1266,7 @@ def build_llvm(tool):
1266
1266
cmake_generator += ' Win64'
1267
1267
args += ['-Thost=x64' ]
1268
1268
1269
- if os .environ . get ('LLVM_CMAKE_ARGS' ):
1269
+ if os .getenv ('LLVM_CMAKE_ARGS' ):
1270
1270
extra_args = os .environ ['LLVM_CMAKE_ARGS' ].split (',' )
1271
1271
print ('Passing the following extra arguments to LLVM CMake configuration: ' + str (extra_args ))
1272
1272
args += extra_args
@@ -1617,7 +1617,7 @@ def load_dot_emscripten():
1617
1617
1618
1618
def generate_dot_emscripten (active_tools ):
1619
1619
cfg = 'import os\n '
1620
- cfg += "emsdk_path = os.path.dirname(os.environ.get ('EM_CONFIG')).replace('\\ \\ ', '/')\n "
1620
+ cfg += "emsdk_path = os.path.dirname(os.getenv ('EM_CONFIG')).replace('\\ \\ ', '/')\n "
1621
1621
1622
1622
# Different tools may provide the same activated configs; the latest to be
1623
1623
# activated is the relevant one.
@@ -1663,7 +1663,7 @@ def generate_dot_emscripten(active_tools):
1663
1663
print ('- This can be done for the current shell by running:' )
1664
1664
print (' source "%s"' % emsdk_env )
1665
1665
print ('- Configure emsdk in your shell startup scripts by running:' )
1666
- shell = os .environ . get ('SHELL' , '' )
1666
+ shell = os .getenv ('SHELL' , '' )
1667
1667
if 'zsh' in shell :
1668
1668
print (' echo \' source "%s"\' >> $HOME/.zprofile' % emsdk_env )
1669
1669
elif 'csh' in shell :
@@ -1673,8 +1673,8 @@ def generate_dot_emscripten(active_tools):
1673
1673
1674
1674
1675
1675
def find_msbuild_dir ():
1676
- program_files = os .environ . get ('ProgramFiles' , 'C:/Program Files' )
1677
- program_files_x86 = os .environ . get ('ProgramFiles(x86)' , 'C:/Program Files (x86)' )
1676
+ program_files = os .getenv ('ProgramFiles' , 'C:/Program Files' )
1677
+ program_files_x86 = os .getenv ('ProgramFiles(x86)' , 'C:/Program Files (x86)' )
1678
1678
MSBUILDX86_DIR = os .path .join (program_files_x86 , "MSBuild/Microsoft.Cpp/v4.0/Platforms" )
1679
1679
MSBUILD_DIR = os .path .join (program_files , "MSBuild/Microsoft.Cpp/v4.0/Platforms" )
1680
1680
if os .path .exists (MSBUILDX86_DIR ):
0 commit comments