diff --git a/modules/gmake2/gmake2_workspace.lua b/modules/gmake2/gmake2_workspace.lua index fc37fdc1..dccfa472 100644 --- a/modules/gmake2/gmake2_workspace.lua +++ b/modules/gmake2/gmake2_workspace.lua @@ -183,7 +183,8 @@ for prj in p.workspace.eachproject(wks) do local deps = project.getdependencies(prj) deps = table.extract(deps, "name") - _p('%s:%s', p.esc(prj.name), gmake2.list(deps)) + + _p('%s:%s', p.esc(prj.name), gmake2.list(p.esc(deps))) local cfgvar = gmake2.tovar(prj.name) _p('ifneq (,$(%s_config))', cfgvar) diff --git a/modules/gmake2/tests/_tests.lua b/modules/gmake2/tests/_tests.lua index 448be95d..19b2ff36 100644 --- a/modules/gmake2/tests/_tests.lua +++ b/modules/gmake2/tests/_tests.lua @@ -13,4 +13,5 @@ return { "test_gmake2_perfile_flags.lua", "test_gmake2_target_rules.lua", "test_gmake2_tools.lua", + "test_gmake2_wks.lua" } diff --git a/modules/gmake2/tests/test_gmake2_wks.lua b/modules/gmake2/tests/test_gmake2_wks.lua new file mode 100644 index 00000000..32ca0f8b --- /dev/null +++ b/modules/gmake2/tests/test_gmake2_wks.lua @@ -0,0 +1,70 @@ +local suite = test.declare("gmake2_wks") + +local p = premake +local gmake2 = premake.modules.gmake2 + +local wks, prj, cfg + +function suite.setup() + p.escaper(gmake2.esc) + wks = workspace("MyWorkspace") + configurations { "Debug", "Release" } +end + + +local function prepare() + wks = test.getWorkspace(wks) + prj = test.getproject(wks, 1) + + gmake2.projectrules(wks) +end + + +function suite.projectwithspace() + project "My Project" + + prepare() + +test.capture [[ +My\ Project: +]] +end + + +function suite.projectwithdependencywithspace() + project "Dependency with Space" + project "My Project" + dependson { "Dependency With Space" } + + prepare() + +test.capture [[ +Dependency\ with\ Space: +ifneq (,$(Dependency_with_Space_config)) + @echo "==== Building Dependency with Space ($(Dependency_with_Space_config)) ====" + @${MAKE} --no-print-directory -C . -f Dependency\ with\ Space.make config=$(Dependency_with_Space_config) +endif + +My\ Project: Dependency\ with\ Space +]] +end + + +function suite.projectwithdependencywithspaceinlocation() + project "Dependency with Space" + location "Location With Space" + project "My Project" + dependson { "Dependency With Space" } + + prepare() + +test.capture [[ +Dependency\ with\ Space: +ifneq (,$(Dependency_with_Space_config)) + @echo "==== Building Dependency with Space ($(Dependency_with_Space_config)) ====" + @${MAKE} --no-print-directory -C Location\ With\ Space -f Makefile config=$(Dependency_with_Space_config) +endif + +My\ Project: Dependency\ with\ Space +]] +end \ No newline at end of file