From b07ef4b573b9a4535df1bfe5a555598745defb9c Mon Sep 17 00:00:00 2001 From: Trevor Pounds Date: Sat, 31 Aug 2019 12:11:26 -0400 Subject: [PATCH 1/3] Add GitHub actions build config. --- .github/workflows/build.yml | 33 +++++++++++++++++++++++++++++++++ Build/NTEnvironment.py | 7 ++++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..4aaace3 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,33 @@ +name: Build +on: push +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + cxx: + - clang++ + - cl.exe + - g++ + include: + - os: ubuntu-18.04 + cxx: clang++ + run: "true" + - os: ubuntu-18.04 + cxx: g++ + run: "true" + - os: windows-2019 + cxx: cl.exe + run: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"' + name: ${{ matrix.os }} - ${{ matrix.cxx }} + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v1 + with: + python-version: 2.x + - run: pip install scons + - run: ${{ matrix.run }} + - run: scons + env: + CXX: ${{ matrix.cxx }} diff --git a/Build/NTEnvironment.py b/Build/NTEnvironment.py index 3e9a0a4..a047692 100644 --- a/Build/NTEnvironment.py +++ b/Build/NTEnvironment.py @@ -15,9 +15,14 @@ def __init__(self, **kw): def ConfigureCompiler(self): cxx = self.WhereIs(self['CXX']) - cxx_bin = os.path.basename(cxx).lower() + cxx = os.path.normpath(cxx) + cxx_bin = os.path.basename(cxx) cxx_dir = os.path.dirname(cxx) + print "XXX: " + cxx + print "XXX: " + cxx_bin + print "XXX: " + cxx_dir + if cxx_bin.startswith("cl"): common = cxx_dir + "\..\.." if os.path.exists(common + "\Common\IDE"): From 04fe3271c1e838da1c6cdd2c63ff37239043c541 Mon Sep 17 00:00:00 2001 From: Trevor Pounds Date: Sun, 1 Sep 2019 11:45:14 -0400 Subject: [PATCH 2/3] debug --- Build/NTEnvironment.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Build/NTEnvironment.py b/Build/NTEnvironment.py index a047692..ed4e802 100644 --- a/Build/NTEnvironment.py +++ b/Build/NTEnvironment.py @@ -30,24 +30,24 @@ def ConfigureCompiler(self): elif os.path.exists(common + "\Common7\IDE"): os.environ['PATH'] = common + "\Common7\IDE" + ";" + cxx_dir - proc = Popen(cxx_bin, stderr=STDOUT, stdout=PIPE) - proc.wait() - version = "".join(proc.stdout.readlines()) + # proc = Popen(cxx_bin, stderr=STDOUT, stdout=PIPE) + # proc.wait() + # version = "".join(proc.stdout.readlines()) - if re.search("Version 12\.00", version): - raise EnvironmentError("Microsoft Visual C++ (6.0) Unsupported!") - elif re.search("Version 13\.00", version): - print "Microsoft Visual C++ .NET 2002 (7.0) Detected" - elif re.search("Version 13\.10", version): - print "Microsoft Visual C++ .NET 2003 (7.1) Detected" - elif re.search("Version 14\.00", version): - print "Microsoft Visual C++ 2005 (8.0) Detected" - elif re.search("Version 15\.00", version): - print "Microsoft Visual C++ 2008 (9.0) Detected" - elif re.search("Version 16\.00", version): - print "Microsoft Visual C++ 2010 (10.0) Detected" - else: - raise EnvironmentError("Unknown Microsoft Visual C++ Detected!") + # if re.search("Version 12\.00", version): + # raise EnvironmentError("Microsoft Visual C++ (6.0) Unsupported!") + # elif re.search("Version 13\.00", version): + # print "Microsoft Visual C++ .NET 2002 (7.0) Detected" + # elif re.search("Version 13\.10", version): + # print "Microsoft Visual C++ .NET 2003 (7.1) Detected" + # elif re.search("Version 14\.00", version): + # print "Microsoft Visual C++ 2005 (8.0) Detected" + # elif re.search("Version 15\.00", version): + # print "Microsoft Visual C++ 2008 (9.0) Detected" + # elif re.search("Version 16\.00", version): + # print "Microsoft Visual C++ 2010 (10.0) Detected" + # else: + # raise EnvironmentError("Unknown Microsoft Visual C++ Detected!") # XXX: BOOST_ALL_NO_LIB prevents MSVC from auto-linking a non-existent library self.AppendUnique(CXXFLAGS = ['/EHsc', '/GR', '/DBOOST_ALL_NO_LIB']) From 75de0924ae76826e320809571b69398a5e6e9a5b Mon Sep 17 00:00:00 2001 From: Trevor Pounds Date: Sun, 1 Sep 2019 11:53:17 -0400 Subject: [PATCH 3/3] debug2 --- Build/BaseEnvironment.py | 12 ++++++++++++ Build/NTEnvironment.py | 21 +++++++++++---------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/Build/BaseEnvironment.py b/Build/BaseEnvironment.py index 0721a38..53391f6 100644 --- a/Build/BaseEnvironment.py +++ b/Build/BaseEnvironment.py @@ -3,6 +3,18 @@ import subprocess def Test(target, source, env): + print "YYY: " + str(source[0]) + print "YYY: " + str(source[0].abspath) + print "YYY: " + os.path.normpath(str(source[0])) + print "YYY: " + os.path.abspath(str(source[0])) + print "YYY: " + os.path.abspath('.') + + print "ZZZ: " + os.getcwd() + print "ZZZ: " + os.path.abspath(os.getcwd()) + print "ZZZ: " + " ".join(os.listdir('.')) + print "ZZZ: " + " ".join(os.listdir('test')) + print "ZZZ: " + " ".join(os.listdir('test\build')) + proc = subprocess.Popen(source[0].abspath) proc.wait() print "\n=============================" diff --git a/Build/NTEnvironment.py b/Build/NTEnvironment.py index ed4e802..9adedef 100644 --- a/Build/NTEnvironment.py +++ b/Build/NTEnvironment.py @@ -9,9 +9,9 @@ def __init__(self, **kw): self.ConfigureCompiler() - self['ENV']['INCLUDE'] = self['CPPPATH'] - self['ENV']['LIB'] = self['LIBPATH'] - self['ENV']['PATH'] = os.environ['PATH'] + # self['ENV']['INCLUDE'] = self['CPPPATH'] + # self['ENV']['LIB'] = self['LIBPATH'] + # self['ENV']['PATH'] = os.environ['PATH'] def ConfigureCompiler(self): cxx = self.WhereIs(self['CXX']) @@ -24,11 +24,12 @@ def ConfigureCompiler(self): print "XXX: " + cxx_dir if cxx_bin.startswith("cl"): - common = cxx_dir + "\..\.." - if os.path.exists(common + "\Common\IDE"): - os.environ['PATH'] = common + "\Common\IDE" + ";" + cxx_dir - elif os.path.exists(common + "\Common7\IDE"): - os.environ['PATH'] = common + "\Common7\IDE" + ";" + cxx_dir + # common = cxx_dir + "\..\.." + # if os.path.exists(common + "\Common\IDE"): + # os.environ['PATH'] = common + "\Common\IDE" + # elif os.path.exists(common + "\Common7\IDE"): + # os.environ['PATH'] = common + "\Common7\IDE" + # os.environ['PATH'] += ";" + cxx_dir # proc = Popen(cxx_bin, stderr=STDOUT, stdout=PIPE) # proc.wait() @@ -53,8 +54,8 @@ def ConfigureCompiler(self): self.AppendUnique(CXXFLAGS = ['/EHsc', '/GR', '/DBOOST_ALL_NO_LIB']) self['CXX'] = cxx_bin # self['LINK'] = "link.exe" - self['CPPPATH'] = os.path.abspath(cxx_dir + "\..\include") - self['LIBPATH'] = os.path.abspath(cxx_dir + "\..\lib") + # self['CPPPATH'] = os.path.abspath(cxx_dir + "\..\include") + # self['LIBPATH'] = os.path.abspath(cxx_dir + "\..\lib") sdk_dir = "" if os.getenv('MicrosoftPlatformSDK', None) != None: