diff options
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) |