Skip to content

Commit

Permalink
Prevent GCC from writing to Windows install directory (#3819)
Browse files Browse the repository at this point in the history
On certain gcc distribuitions, if TEMP/TMP are unset, it defaults to writing to the root Windows OS directory (C:/Windows)

msys2/MSYS2-packages#235
  • Loading branch information
lututui authored Oct 23, 2023
1 parent e170a23 commit 5edf17c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ READLINE_LIB = 'readline'
perlconfig = {}
env = Environment()
if win32:
env = Environment(ENV = {'PATH' : os.environ['PATH']}, tools = ['mingw', 'gcc', 'cc', 'g++', 'c++'])
env = Environment(
ENV = {
'PATH' : os.environ['PATH'],
'TEMP' : os.environ['TEMP'],
'TMP' : os.environ['TMP'],
},
tools = ['mingw', 'gcc', 'cc', 'g++', 'c++'],
)

if darwin:
env['LIBPATH'] = DARWIN_LIBRARY_DIRECTORIES
Expand Down

0 comments on commit 5edf17c

Please sign in to comment.