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/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 3e9a0a4..9adedef 100644 --- a/Build/NTEnvironment.py +++ b/Build/NTEnvironment.py @@ -9,47 +9,53 @@ 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']) - 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"): - 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() - 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']) 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: