Skip to content

Commit

Permalink
Prevent GCC from writing to Windows install directory
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 committed Oct 22, 2023
1 parent 78d11a2 commit 1a73c01
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 1a73c01

Please sign in to comment.