Jason Perkins avatar Jason Perkins committed 1b6243d

Fixed a (stupid) typo in makefile include dirs list (h/t gogoprog)

Comments (0)

Files changed (3)

src/actions/make/make_cpp.lua

 
 	function cpp.flags(cfg, toolset)
 		_p('  DEFINES   += %s', table.concat(toolset.getdefines(cfg.defines), " "))
-		_p('  INCLUDES  += %s', table.concat(make.esc(toolset.getincludedirs(cfg, cfg.includedirs), " ")))
+		
+		local includes = make.esc(toolset.getincludedirs(cfg, cfg.includedirs))
+		_p('  INCLUDES  += %s', table.concat(includes, " "))
+		
 		_p('  CPPFLAGS  += %s $(DEFINES) $(INCLUDES)', table.concat(toolset.getcppflags(cfg), " "))
 		_p('  CFLAGS    += $(CPPFLAGS) $(ARCH) %s', table.concat(table.join(toolset.getcflags(cfg), cfg.buildoptions), " "))
 		_p('  CXXFLAGS  += $(CFLAGS) %s', table.concat(toolset.getcxxflags(cfg), " "))

tests/actions/make/cpp/test_flags.lua

+--
+-- tests/actions/make/cpp/test_flags.lua
+-- Tests compiler and linker flags for Makefiles.
+-- Copyright (c) 2012 Jason Perkins and the Premake project
+--
+	
+	T.make_flags = {}
+	local suite = T.make_flags
+	local make = premake.make
+	local cpp = premake.make.cpp
+	local project = premake5.project
+
+
+--
+-- Setup
+--
+	
+	local sln, prj, cfg
+
+	function suite.setup()
+		sln = test.createsolution()
+	end
+
+	local function prepare()
+		prj = premake.solution.getproject_ng(sln, 1)
+		cfg = project.getconfig(prj, "Debug")
+		cpp.flags(cfg, premake.tools.gcc)
+	end
+	
+
+--
+-- Include directories should be relative and space separated.
+--
+
+	function suite.includeDirs()
+		includedirs { "src/include", "../include" }
+		prepare()
+		test.capture [[
+  DEFINES   += 
+  INCLUDES  += -Isrc/include -I../include
+		]]
+	end

tests/premake4.lua

 	
 	-- Makefile C/C++ projects
 	dofile("actions/make/cpp/test_file_rules.lua")
+	dofile("actions/make/cpp/test_flags.lua")
 	dofile("actions/make/cpp/test_make_pch.lua")
 	dofile("actions/make/cpp/test_make_linking.lua")
 	dofile("actions/make/cpp/test_objects.lua")
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.