Skip to content

Commit

Permalink
Merge fb60084 into c1a8460
Browse files Browse the repository at this point in the history
  • Loading branch information
srz-zumix committed Oct 31, 2020
2 parents c1a8460 + fb60084 commit cd36cba
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 3 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ for:
before_build:
cmd: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\vsdevcmd.bat"'
build_script:
cmd: cd test && nmake minimum_tests && minimum_tests.exe --spec
cmd: cd test && nmake showcxxmacros && nmake minimum_tests && minimum_tests.exe --spec
test_script:
cmd: nmake test
# Prefast
Expand Down
9 changes: 7 additions & 2 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# make run_$(TARGET) - makes the given target and run.
# make clean - removes all files generated by make.

PATH=$(PATH);$(MAKEDIR)\..\tools\VisualStudio

#
# Config
#
Expand Down Expand Up @@ -49,9 +51,9 @@ TARGETS = $(BUILD_TARGETS)
NAMESPACETESTS_TEST_SRCS = $(ALLTESTS_TEST_SRCS:.cpp=.ns.cpp)
NAMESPACETESTS_SRCS = main.cpp $(NAMESPACETESTS_TEST_SRCS)

SRCS = $(BUILD_TARGETS:_tests=_tests.cpp)
SRCS = $(BUILD_TARGETS:_tests=_tests.cpp)
RUNNER_ = $(RUN_TARGETS:_tests=_tests_run)
RUNNER = $(RUNNER_:./=)
RUNNER = $(RUNNER_:./=)


# build targets.
Expand All @@ -73,6 +75,9 @@ test : $(BUILD_ONLY) $(RUNNER)
showcxxversion:
-$(CXX)

showcxxmacros: ## show compiler predefined macros
$(CXX) /Bxcl-dME.bat main.cpp

$(RUNNER) : $(@:_tests_run=_tests)
@echo $@
!ifdef OUTPUTXML
Expand Down
7 changes: 7 additions & 0 deletions tools/VisualStudio/cl-dME.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@echo off

echo %MSC_CMD_FLAGS%
echo %MSC_IDE_FLAGS%

python --version
python %~dp0\cl-dME.py %*
39 changes: 39 additions & 0 deletions tools/VisualStudio/cl-dME.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env python
#
# cl-dME.py
#
# usage:
# cl /B1cl-dME.bat main.cpp
# cl /BXcl-dME.bat main.cpp

import os
from argparse import ArgumentParser
from argparse import SUPPRESS


class DefinePrinter:
def __init__(self):
self.parser = ArgumentParser(add_help=False)
self.parser.add_argument(
'-D',
dest='defs',
action='append',
default=[],
help=SUPPRESS
)

def print(self, key):
if key in os.environ:
opts, args = self.parser.parse_known_args(os.environ[key])
for d in opts.defs:
print(d)


def main():
printer = DefinePrinter()
printer.print('MSC_CMD_FLAGS')
printer.print('MSC_IDE_FLAGS')


if __name__ == "__main__":
main()

0 comments on commit cd36cba

Please sign in to comment.