Merge pull request #944 from premake/Cpp0x

C++0x dialect support
This commit is contained in:
Tom van Dijck 2017-11-30 08:54:32 -08:00 committed by GitHub
commit d2080dbd76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 6 deletions

View File

@ -357,11 +357,11 @@
end
function m.isCpp11(cfg)
return (cfg.cppdialect == 'gnu++11') or (cfg.cppdialect == 'C++11')
return (cfg.cppdialect == 'gnu++11') or (cfg.cppdialect == 'C++11') or (cfg.cppdialect == 'gnu++0x') or (cfg.cppdialect == 'C++0x')
end
function m.isCpp14(cfg)
return (cfg.cppdialect == 'gnu++14') or (cfg.cppdialect == 'C++14')
return (cfg.cppdialect == 'gnu++14') or (cfg.cppdialect == 'C++14') or (cfg.cppdialect == 'gnu++1y') or (cfg.cppdialect == 'C++1y')
end
function m.completion(cfg)

View File

@ -766,12 +766,18 @@
allowed = {
"Default",
"C++98",
"C++0x",
"C++11",
"C++1y",
"C++14",
"C++1z",
"C++17",
"gnu++98",
"gnu++0x",
"gnu++11",
"gnu++1y",
"gnu++14",
"gnu++1z",
"gnu++17",
}
}

View File

@ -135,13 +135,19 @@
},
cppdialect = {
["C++98"] = "-std=c++98",
["C++0x"] = "-std=c++0x",
["C++11"] = "-std=c++11",
["C++1y"] = "-std=c++1y",
["C++14"] = "-std=c++14",
["C++17"] = "-std=c++1z",
["C++1z"] = "-std=c++1z",
["C++17"] = "-std=c++17",
["gnu++98"] = "-std=gnu++98",
["gnu++0x"] = "-std=gnu++0x",
["gnu++11"] = "-std=gnu++11",
["gnu++1y"] = "-std=gnu++1y",
["gnu++14"] = "-std=gnu++14",
["gnu++17"] = "-std=gnu++1z",
["gnu++1z"] = "-std=gnu++1z",
["gnu++17"] = "-std=gnu++17",
},
rtti = {
Off = "-fno-rtti"

View File

@ -676,7 +676,7 @@
function suite.cxxflags_onCpp17()
cppdialect "C++17"
prepare()
test.contains({ "-std=c++1z" }, gcc.getcxxflags(cfg))
test.contains({ "-std=c++17" }, gcc.getcxxflags(cfg))
test.contains({ }, gcc.getcflags(cfg))
end
@ -704,6 +704,6 @@
function suite.cxxflags_onCppGnu17()
cppdialect "gnu++17"
prepare()
test.contains({ "-std=gnu++1z" }, gcc.getcxxflags(cfg))
test.contains({ "-std=gnu++17" }, gcc.getcxxflags(cfg))
test.contains({ }, gcc.getcflags(cfg))
end