diff --git a/src/actions/make/make_cpp.lua b/src/actions/make/make_cpp.lua index 46a7b2f8..a15e4fa7 100644 --- a/src/actions/make/make_cpp.lua +++ b/src/actions/make/make_cpp.lua @@ -291,16 +291,13 @@ configs[cfg] = { objects={}, resources={} } end - -- for each file in the iterator below, keep track of which - -- configurations to which it belongs - local incfg = {} - -- now walk the list of files in the project local tr = project.getsourcetree(prj) premake.tree.traverse(tr, { onleaf = function(node, depth) -- figure out what configurations contain this file, and -- if it uses custom build rules + local incfg = {} local inall = true local custom = false for cfg in project.eachconfig(prj) do diff --git a/tests/actions/make/cpp/test_objects.lua b/tests/actions/make/cpp/test_objects.lua index 6091c20f..9caf5daa 100644 --- a/tests/actions/make/cpp/test_objects.lua +++ b/tests/actions/make/cpp/test_objects.lua @@ -63,7 +63,9 @@ OBJECTS := \ function suite.configFilesAreConditioned() configuration "Debug" - files { "src/hello.cpp" } + files { "src/hello_debug.cpp" } + configuration "Release" + files { "src/hello_release.cpp" } prepare() test.capture [[ OBJECTS := \ @@ -72,7 +74,13 @@ RESOURCES := \ ifeq ($(config),debug) OBJECTS += \ - $(OBJDIR)/hello.o \ + $(OBJDIR)/hello_debug.o \ + +endif + +ifeq ($(config),release) + OBJECTS += \ + $(OBJDIR)/hello_release.o \ endif