summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel <dmoody256@gmail.com>2019-03-01 05:16:12 (GMT)
committerDaniel <dmoody256@gmail.com>2019-03-01 05:16:12 (GMT)
commit7b192e7b4c92606ffe1b07adbb82bda039a17975 (patch)
tree227314872baef39b662fb15749cc73c2a8526f69 /src
parent16d8a62b17ae8a3e026d192574a05bdb87140c59 (diff)
downloadSCons-7b192e7b4c92606ffe1b07adbb82bda039a17975.zip
SCons-7b192e7b4c92606ffe1b07adbb82bda039a17975.tar.gz
SCons-7b192e7b4c92606ffe1b07adbb82bda039a17975.tar.bz2
only use no-unistd option with MSVC environment
Diffstat (limited to 'src')
-rwxr-xr-xsrc/CHANGES.txt4
-rw-r--r--src/engine/SCons/Tool/lex.py10
-rw-r--r--src/engine/SCons/Tool/msvc.py4
3 files changed, 13 insertions, 5 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index bfea661..7393664 100755
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -21,7 +21,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
- Fixed bug which threw error when running SCons on windows system with no MSVC installed.
- Update link tool to convert target to node before accessing node member
- Update mingw tool to remove MSVC like nologo CCFLAG
- - Update lex tool to work in mingw environments
+ - Add default paths for lex tool on windows
+ - Add lex construction variable LEXUNISTD for turning off unix headers on windows
+ - Update lex tool to use win_flex on windows if available
From Mats Wichmann:
- Quiet open file ResourceWarnings on Python >= 3.6 caused by
diff --git a/src/engine/SCons/Tool/lex.py b/src/engine/SCons/Tool/lex.py
index 3506f7c..a63ddc9 100644
--- a/src/engine/SCons/Tool/lex.py
+++ b/src/engine/SCons/Tool/lex.py
@@ -75,7 +75,7 @@ def get_lex_path(env, append_paths=False):
"""
# save existing path to reset if we don't want to append any paths
envPath = env['ENV']['PATH']
- bins = ['win_flex', 'lex', 'flex']
+ bins = ['flex', 'lex', 'win_flex']
for prog in bins:
bin_path = SCons.Tool.find_program_path(
@@ -110,14 +110,16 @@ def generate(env):
cxx_file.add_action(".ll", LexAction)
cxx_file.add_emitter(".ll", lexEmitter)
+ env["LEXFLAGS"] = SCons.Util.CLVar("")
+
if sys.platform == 'win32':
get_lex_path(env, append_paths=True)
- env["LEX"] = env.Detect(['win_flex', 'lex', 'flex'])
- env["LEXUNISTD"] = SCons.Util.CLVar("--nounistd")
+ env["LEX"] = env.Detect(['flex', 'lex', 'win_flex'])
+ if not env.get("LEXUNISTD"):
+ env["LEXUNISTD"] = SCons.Util.CLVar("")
env["LEXCOM"] = "$LEX $LEXUNISTD $LEXFLAGS -t $SOURCES > $TARGET"
else:
env["LEX"] = env.Detect(["flex", "lex"])
- env["LEXFLAGS"] = SCons.Util.CLVar("")
env["LEXCOM"] = "$LEX $LEXFLAGS -t $SOURCES > $TARGET"
def exists(env):
diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py
index 9f3c1fa..2352088 100644
--- a/src/engine/SCons/Tool/msvc.py
+++ b/src/engine/SCons/Tool/msvc.py
@@ -271,6 +271,10 @@ def generate(env):
env['SHOBJPREFIX'] = '$OBJPREFIX'
env['SHOBJSUFFIX'] = '$OBJSUFFIX'
+ # MSVC probably wont support unistd.h so default
+ # without it for lex generation
+ env["LEXUNISTD"] = SCons.Util.CLVar("--nounistd")
+
# Set-up ms tools paths
msvc_setup_env_once(env)