Travis testing c++11 and gcc5
Modify testflags.py to control the -std= option passed to gcc Install new boost for c++11 with gcc5 testing
This commit is contained in:
parent
5a282f3ac3
commit
f815209c7d
2 changed files with 31 additions and 12 deletions
|
|
@ -1,6 +1,10 @@
|
|||
#!/usr/bin/env python
|
||||
c_common = "-fdiagnostics-show-option -std=gnu89 -Wno-long-long -Wreturn-type -Wdeclaration-after-statement"
|
||||
cflags = {
|
||||
|
||||
def get_cflags(language, std):
|
||||
if std == None or len(std) == 0:
|
||||
std = "gnu89"
|
||||
c_common = "-fdiagnostics-show-option -std=" + std + " -Wno-long-long -Wreturn-type -Wdeclaration-after-statement"
|
||||
cflags = {
|
||||
"csharp":"-Werror " + c_common,
|
||||
"d":"-Werror " + c_common,
|
||||
"go":"-Werror " + c_common,
|
||||
|
|
@ -15,10 +19,18 @@ cflags = {
|
|||
"ruby":"-Werror " + c_common,
|
||||
"scilab":"-Werror " + c_common,
|
||||
"tcl":"-Werror " + c_common,
|
||||
}
|
||||
}
|
||||
|
||||
cxx_common = "-fdiagnostics-show-option -std=c++98 -Wno-long-long -Wreturn-type"
|
||||
cxxflags = {
|
||||
if language not in cflags:
|
||||
raise RuntimeError("{} is not a supported language".format(language))
|
||||
|
||||
return cflags[language]
|
||||
|
||||
def get_cxxflags(language, std):
|
||||
if std == None or len(std) == 0:
|
||||
std = "c++98"
|
||||
cxx_common = "-fdiagnostics-show-option -std=" + std + " -Wno-long-long -Wreturn-type"
|
||||
cxxflags = {
|
||||
"csharp":"-Werror " + cxx_common,
|
||||
"d":"-Werror " + cxx_common,
|
||||
"go":"-Werror " + cxx_common,
|
||||
|
|
@ -33,7 +45,12 @@ cxxflags = {
|
|||
"ruby":"-Werror " + cxx_common,
|
||||
"scilab": cxx_common,
|
||||
"tcl":"-Werror " + cxx_common,
|
||||
}
|
||||
}
|
||||
|
||||
if language not in cxxflags:
|
||||
raise RuntimeError("{} is not a supported language".format(language))
|
||||
|
||||
return cxxflags[language]
|
||||
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser(description="Display CFLAGS or CXXFLAGS to use for testing the SWIG examples and test-suite.")
|
||||
|
|
@ -41,12 +58,13 @@ parser.add_argument('-l', '--language', required=True, help='set language to sho
|
|||
flags = parser.add_mutually_exclusive_group(required=True)
|
||||
flags.add_argument('-c', '--cflags', action='store_true', default=False, help='show CFLAGS')
|
||||
flags.add_argument('-x', '--cxxflags', action='store_true', default=False, help='show CXXFLAGS')
|
||||
parser.add_argument('-s', '--std', required=False, help='language standard flags for the -std= option')
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.cflags:
|
||||
print("{}".format(cflags[args.language]))
|
||||
print("{}".format(get_cflags(args.language, args.std)))
|
||||
elif args.cxxflags:
|
||||
print("{}".format(cxxflags[args.language]))
|
||||
print("{}".format(get_cxxflags(args.language, args.std)))
|
||||
else:
|
||||
parser.print_help()
|
||||
exit(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue