diff options
author | 2019-09-29 15:30:18 +0200 | |
---|---|---|
committer | 2019-09-29 09:30:18 -0400 | |
commit | ed2b7e5ef1626c0d6318b6ea71897efbb4356277 (patch) | |
tree | 62a84a4a2c804922839dbfa60ec664b84beaaee0 /3rdparty/genie/src/actions/qbs/qbs_cpp.lua | |
parent | 1bd1288c9e17bdba9544d1e56be7618106fece7e (diff) |
Synced with GENie upstream revision e78d6c1 (#5631)
* Synced with GENie upstream revision e78d6c1
* Add Visual Studio 2019 support
* Fix hardcoded -m64
* Switch appveyor to Visual Studio 2019
* Fix genie being built as 32-bit
* MSVC build is known to be broken currently. Let it fail until all the known issues are fixed.
* Update the packages before building
* Build with 3 threads
Appveyor VMs have only 2 cores and 8 GB RAM.
* Enable caching of pacman cache
Diffstat (limited to '3rdparty/genie/src/actions/qbs/qbs_cpp.lua')
-rw-r--r-- | 3rdparty/genie/src/actions/qbs/qbs_cpp.lua | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/3rdparty/genie/src/actions/qbs/qbs_cpp.lua b/3rdparty/genie/src/actions/qbs/qbs_cpp.lua index 1dd1d109d3c..4d76e178728 100644 --- a/3rdparty/genie/src/actions/qbs/qbs_cpp.lua +++ b/3rdparty/genie/src/actions/qbs/qbs_cpp.lua @@ -31,9 +31,10 @@ function qbs.generate_project(prj) if prj.kind == "ConsoleApp" then _p(indent, 'CppApplication {') - _p(indent, 'consoleApplication: true') + _p(indent + 1, 'consoleApplication: true') elseif prj.kind == "WindowedApp" then _p(indent, 'CppApplication {') + _p(indent + 1, 'consoleApplication: false') elseif prj.kind == "StaticLib" then _p(indent, 'StaticLibrary {') elseif prj.kind == "SharedLib" then @@ -43,7 +44,6 @@ function qbs.generate_project(prj) indent = indent + 1 _p(indent, 'name: "' .. prj.name .. '"') - _p(indent, 'cpp.cxxLanguageVersion: "c++11"') -- _p(indent, 'cpp.enableReproducibleBuilds: true') _p(indent, 'Depends { name: "cpp" }') @@ -99,6 +99,26 @@ function qbs.generate_project(prj) -- , cc.getcppflags(cfg) -- ) + if cfg.flags.Cpp11 then + _p(indent, 'cpp.cxxLanguageVersion: "c++11"') + elseif cfg.flags.Cpp14 then + _p(indent, 'cpp.cxxLanguageVersion: "c++14"') + elseif cfg.flags.Cpp17 then + _p(indent, 'cpp.cxxLanguageVersion: "c++17"') + else + _p(indent, 'cpp.cxxLanguageVersion: "c++98"') + end + + if os.is("windows") then + if not cfg.flags.WinMain and (cfg.kind == 'ConsoleApp' or cfg.kind == 'WindowedApp') then + if cfg.flags.Unicode then + _p(indent, 'cpp.entryPoint: "wmainCRTStartup"') + else + _p(indent, 'cpp.entryPoint: "mainCRTStartup"') + end + end + end + qbs.list( indent , "cpp.commonCompilerFlags" @@ -199,18 +219,7 @@ function qbs.generate_project(prj) , cfg.defines ) - local sortedincdirs = {} - for _, includedir in ipairs(cfg.userincludedirs) do - if includedir ~= nil then - table.insert(sortedincdirs, includedir) - end - end - for _, includedir in ipairs(cfg.includedirs) do - if includedir ~= nil then - table.insert(sortedincdirs, includedir) - end - end - + local sortedincdirs = table.join(cfg.userincludedirs, cfg.includedirs, cfg.systemincludedirs) table.sort(sortedincdirs, includesort) qbs.list( indent @@ -243,6 +252,7 @@ function qbs.generate_project(prj) if path.iscfile(file) or path.iscppfile(file) or path.isobjcfile(file) + or path.isresourcefile(file) or path.iscppheader(file) then if not is_excluded(prj, cfg, file) then _p(indent+1, '"%s",', file) |