From 157f40cdac6baf10b7398fa0132896b43f760752 Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Sat, 29 Aug 2020 16:39:23 +0200 Subject: [PATCH 1/2] Fix sysincludedirs for codelite. --- modules/codelite/codelite_project.lua | 7 ++++--- modules/codelite/tests/test_codelite_config.lua | 9 +++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/codelite/codelite_project.lua b/modules/codelite/codelite_project.lua index 1eb2ae1f23..7c5a2283c4 100755 --- a/modules/codelite/codelite_project.lua +++ b/modules/codelite/codelite_project.lua @@ -196,9 +196,10 @@ end local toolset = m.getcompiler(cfg) + local sysincludedirs = toolset.getincludedirs(cfg, {}, cfg.sysincludedirs) local forceincludes = toolset.getforceincludes(cfg) - local cxxflags = table.concat(table.join(toolset.getcxxflags(cfg), forceincludes, cfg.buildoptions), ";") - local cflags = table.concat(table.join(toolset.getcflags(cfg), forceincludes, cfg.buildoptions), ";") + local cxxflags = table.concat(table.join(sysincludedirs, toolset.getcxxflags(cfg), forceincludes, cfg.buildoptions), ";") + local cflags = table.concat(table.join(sysincludedirs, toolset.getcflags(cfg), forceincludes, cfg.buildoptions), ";") local asmflags = "" local pch = "" @@ -241,7 +242,7 @@ local options = table.concat(cfg.resoptions, ";") _x(3, '', defines, options) - for _, includepath in ipairs(table.join(cfg.includedirs, cfg.resincludedirs)) do + for _, includepath in ipairs(table.join(cfg.sysincludedirs, cfg.includedirs, cfg.resincludedirs)) do _x(4, '', project.getrelative(cfg.project, includepath)) end _p(3, '') diff --git a/modules/codelite/tests/test_codelite_config.lua b/modules/codelite/tests/test_codelite_config.lua index 7d1c37e58b..e1bfe946b0 100644 --- a/modules/codelite/tests/test_codelite_config.lua +++ b/modules/codelite/tests/test_codelite_config.lua @@ -57,11 +57,12 @@ end function suite.OnProjectCfg_Includes() + sysincludedirs { "sysdir", "sysdir2/"} includedirs { "dir/", "dir2" } prepare() codelite.project.compiler(cfg) test.capture [[ - + @@ -126,12 +127,16 @@ function suite.OnProjectCfg_ResInclude() files { "x.rc" } - resincludedirs { "dir/" } + includedirs { "dir/" } + sysincludedirs { "sysdir/" } + resincludedirs { "resdir/" } prepare() codelite.project.resourceCompiler(cfg) test.capture [[ + + ]] end From f91def371d6e0f321f052e296af353100ec90a3a Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Sun, 30 Aug 2020 11:25:06 +0200 Subject: [PATCH 2/2] Split UTs according to review. --- .../codelite/tests/test_codelite_config.lua | 42 ++++++++++++++++--- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/modules/codelite/tests/test_codelite_config.lua b/modules/codelite/tests/test_codelite_config.lua index e1bfe946b0..bece03d453 100644 --- a/modules/codelite/tests/test_codelite_config.lua +++ b/modules/codelite/tests/test_codelite_config.lua @@ -57,18 +57,28 @@ end function suite.OnProjectCfg_Includes() - sysincludedirs { "sysdir", "sysdir2/"} includedirs { "dir/", "dir2" } prepare() codelite.project.compiler(cfg) test.capture [[ - + ]] end + function suite.OnProjectCfg_SysIncludes() + sysincludedirs { "sysdir", "sysdir2/"} + prepare() + codelite.project.compiler(cfg) + test.capture [[ + + + ]] + end + + function suite.OnProjectCfg_Defines() defines { "TEST", "DEF", "VAL=1", "ESCAPE=\"WITH SPACE\"" } prepare() @@ -127,16 +137,36 @@ function suite.OnProjectCfg_ResInclude() files { "x.rc" } - includedirs { "dir/" } + resincludedirs { "dir/" } + prepare() + codelite.project.resourceCompiler(cfg) + test.capture [[ + + + + ]] + end + + function suite.OnProjectCfg_ResRegularInclude() + files { "x.rc" } + includedirs { "regulardir/" } + prepare() + codelite.project.resourceCompiler(cfg) + test.capture [[ + + + + ]] + end + + function suite.OnProjectCfg_ResSysInclude() + files { "x.rc" } sysincludedirs { "sysdir/" } - resincludedirs { "resdir/" } prepare() codelite.project.resourceCompiler(cfg) test.capture [[ - - ]] end