1. Shunichi Ikegami
  2. premake-dev

Commits

Shunichi Ikegami  committed 314d062 Merge

Merge with original premake-dev

  • Participants
  • Parent commits 5187e8c, e8e1296
  • Branches default

Comments (0)

Files changed (8)

File CHANGES.txt

View file
 * Added debug environment variable support for Visual Studio
 * Added debug environment variable support for Codeblocks using gdb
 * Bug: Visual Studio 2010 forces x86 when platform is Native
+* Patch 3351583: _PREMAKE_COMMAND variable (Konstantin Tokarev)
 * Added new global _WORKING_DIR
-* Patch 3351583: _PREMAKE_COMMAND variable (Konstantin Tokarev)
+* Patch 3451928: VS2008 trying to build *.h files in C projects
+* Patch 3429777: Support for DragonFly BSD (Joachim de Groot)
+* Patch 3445049: Build fix for FreeBSD (Konstantin Tokarev)
+* Bug 3121217: Test suite fails on Linux x86_64: os.findlib broken
 
 
 -------

File premake4.lua

View file
 		configuration "linux"
 			defines     { "LUA_USE_POSIX", "LUA_USE_DLOPEN" }
 			links       { "m", "dl" } 
+
+		configuration "bsd"
+			defines     { "LUA_USE_POSIX", "LUA_USE_DLOPEN" }
+			links       { "m" } 
 			
 		configuration "macosx"
 			defines     { "LUA_USE_MACOSX" }

File src/actions/vstudio/vs200x_vcproj.lua

View file
 						local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)
 						
 						local usePCH = (not prj.flags.NoPCH and prj.pchsource == node.cfg.name)
-						local useCompileAs = path.iscppfile(fname) and (path.iscfile(fname) ~= premake.project.iscproject(prj))
+						local isSourceCode = path.iscppfile(fname)
+						local needsCompileAs = (path.iscfile(fname) ~= premake.project.iscproject(prj))
 						
-						if usePCH or useCompileAs then
+						if usePCH or (isSourceCode and needsCompileAs) then
 							_p(depth, '<FileConfiguration')
 							_p(depth, '\tName="%s"', cfginfo.name)
 							_p(depth, '\t>')
 							_p(depth, '\t\tName="%s"', iif(cfg.system == "Xbox360", 
 							                                 "VCCLX360CompilerTool", 
 							                                 "VCCLCompilerTool"))
-
-							if useCompileAs then
+							if needsCompileAs then
 								_p(depth, '\t\tCompileAs="%s"', iif(path.iscfile(fname), 1, 2))
 							end
 							

File src/base/os.lua

View file
 				end
 			end
 			
-			table.insert(formats, "%s")	
-			path = (path or "") .. ":/lib:/usr/lib:/usr/local/lib"
+			table.insert(formats, "%s")
+			path = path or ""
+			if os.is64bit() then
+				path = path .. ":/lib64:/usr/lib64/:usr/local/lib64"
+			end
+			path = ":/lib:/usr/lib:/usr/local/lib"
 		end
 		
 		for _, fmt in ipairs(formats) do

File src/host/premake.h

View file
 #if defined(__linux__)
 #define PLATFORM_LINUX    (1)
 #define PLATFORM_STRING   "linux"
-#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
 #define PLATFORM_BSD      (1)
 #define PLATFORM_STRING   "bsd"
 #elif defined(__APPLE__) && defined(__MACH__)

File tests/actions/vstudio/vc200x/files.lua

---
--- tests/actions/vstudio/vc200x/files.lua
--- Validate generation of <files/> block in Visual Studio 200x projects.
--- Copyright (c) 2009-2011 Jason Perkins and the Premake project
---
-
-	T.vstudio_vs200x_files = { }
-	local suite = T.vstudio_vs200x_files
-	local vc200x = premake.vstudio.vc200x
-
-
---
--- Setup 
---
-
-	local sln, prj
-	
-	function suite.setup()
-		sln = test.createsolution()
-	end
-	
-	local function prepare()
-		premake.bake.buildconfigs()
-		prj = premake.solution.getproject(sln, 1)
-		sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
-		vc200x.Files(prj)
-	end
-
-
---
--- Test grouping and nesting
---
-
-	function suite.SimpleSourceFile()
-		files { "hello.cpp" }
-		prepare()
-		test.capture [[
-		<File
-			RelativePath="hello.cpp"
-			>
-		</File>
-		]]
-	end
-
-	function suite.SingleFolderLevel()
-		files { "src/hello.cpp" }
-		prepare()
-		test.capture [[
-		<Filter
-			Name="src"
-			Filter=""
-			>
-			<File
-				RelativePath="src\hello.cpp"
-				>
-			</File>
-		</Filter>
-		]]
-	end
-
-	function suite.MultipleFolderLevels()
-		files { "src/greetings/hello.cpp" }
-		prepare()
-		test.capture [[
-		<Filter
-			Name="src"
-			Filter=""
-			>
-			<Filter
-				Name="greetings"
-				Filter=""
-				>
-				<File
-					RelativePath="src\greetings\hello.cpp"
-					>
-				</File>
-			</Filter>
-		</Filter>
-		]]
-	end
-
-
---
--- Mixed language support
---
-
-	function suite.CompileAsC_InCppProject()
-		language "c++"
-		files { "hello.c" }
-		prepare()
-		test.capture [[
-		<File
-			RelativePath="hello.c"
-			>
-			<FileConfiguration
-				Name="Debug|Win32"
-				>
-				<Tool
-					Name="VCCLCompilerTool"
-					CompileAs="1"
-				/>
-			</FileConfiguration>
-			<FileConfiguration
-				Name="Release|Win32"
-				>
-				<Tool
-					Name="VCCLCompilerTool"
-					CompileAs="1"
-				/>
-			</FileConfiguration>
-		</File>
-		]]
-	end
-
-	function suite.CompileAsCpp_InCProject()
-		language "c"
-		files { "hello.cpp" }
-		prepare()
-		test.capture [[
-		<File
-			RelativePath="hello.cpp"
-			>
-			<FileConfiguration
-				Name="Debug|Win32"
-				>
-				<Tool
-					Name="VCCLCompilerTool"
-					CompileAs="2"
-				/>
-			</FileConfiguration>
-			<FileConfiguration
-				Name="Release|Win32"
-				>
-				<Tool
-					Name="VCCLCompilerTool"
-					CompileAs="2"
-				/>
-			</FileConfiguration>
-		</File>
-		]]
-	end
-
-
---
--- PCH support
---
-
-	function suite.OnPCH_OnWindows()
-		files { "afxwin.cpp" }
-		pchsource "afxwin.cpp"
-		prepare()
-		test.capture [[
-		<File
-			RelativePath="afxwin.cpp"
-			>
-			<FileConfiguration
-				Name="Debug|Win32"
-				>
-				<Tool
-					Name="VCCLCompilerTool"
-					UsePrecompiledHeader="1"
-				/>
-			</FileConfiguration>
-			<FileConfiguration
-				Name="Release|Win32"
-				>
-				<Tool
-					Name="VCCLCompilerTool"
-					UsePrecompiledHeader="1"
-				/>
-			</FileConfiguration>
-		</File>
-		]]
-	end
-	
-	function suite.Files_OnPCH_OnXbox360()
-		files { "afxwin.cpp" }
-		pchsource "afxwin.cpp"
-		platforms { "Xbox360" }
-		prepare()
-		test.capture [[
-		<File
-			RelativePath="afxwin.cpp"
-			>
-			<FileConfiguration
-				Name="Debug|Xbox 360"
-				>
-				<Tool
-					Name="VCCLX360CompilerTool"
-					UsePrecompiledHeader="1"
-				/>
-			</FileConfiguration>
-			<FileConfiguration
-				Name="Release|Xbox 360"
-				>
-				<Tool
-					Name="VCCLX360CompilerTool"
-					UsePrecompiledHeader="1"
-				/>
-			</FileConfiguration>
-		</File>
-		]]
-	end
-

File tests/actions/vstudio/vc200x/test_files.lua

View file
+--
+-- tests/actions/vstudio/vc200x/test_files.lua
+-- Validate generation of <files/> block in Visual Studio 200x projects.
+-- Copyright (c) 2009-2011 Jason Perkins and the Premake project
+--
+
+	T.vstudio_vs200x_files = { }
+	local suite = T.vstudio_vs200x_files
+	local vc200x = premake.vstudio.vc200x
+
+
+--
+-- Setup 
+--
+
+	local sln, prj
+	
+	function suite.setup()
+		sln = test.createsolution()
+	end
+	
+	local function prepare()
+		premake.bake.buildconfigs()
+		prj = premake.solution.getproject(sln, 1)
+		sln.vstudio_configs = premake.vstudio.buildconfigs(sln)
+		vc200x.Files(prj)
+	end
+
+
+--
+-- Test grouping and nesting
+--
+
+	function suite.SimpleSourceFile()
+		files { "hello.cpp" }
+		prepare()
+		test.capture [[
+		<File
+			RelativePath="hello.cpp"
+			>
+		</File>
+		]]
+	end
+
+	function suite.SingleFolderLevel()
+		files { "src/hello.cpp" }
+		prepare()
+		test.capture [[
+		<Filter
+			Name="src"
+			Filter=""
+			>
+			<File
+				RelativePath="src\hello.cpp"
+				>
+			</File>
+		</Filter>
+		]]
+	end
+
+	function suite.MultipleFolderLevels()
+		files { "src/greetings/hello.cpp" }
+		prepare()
+		test.capture [[
+		<Filter
+			Name="src"
+			Filter=""
+			>
+			<Filter
+				Name="greetings"
+				Filter=""
+				>
+				<File
+					RelativePath="src\greetings\hello.cpp"
+					>
+				</File>
+			</Filter>
+		</Filter>
+		]]
+	end
+
+
+--
+-- Non-source code files, such as header files and documentation, should
+-- be marked as such, so the compiler won't attempt to build them.
+--
+
+	function suite.file_markedAsNonBuildable_onSupportFiles()
+		language "c"
+		files { "hello.lua" }
+		prepare()
+		test.capture [[
+		<File
+			RelativePath="hello.lua"
+			>
+		</File>
+		]]
+	end
+
+
+--
+-- Mixed language support
+--
+
+	function suite.CompileAsC_InCppProject()
+		language "c++"
+		files { "hello.c" }
+		prepare()
+		test.capture [[
+		<File
+			RelativePath="hello.c"
+			>
+			<FileConfiguration
+				Name="Debug|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					CompileAs="1"
+				/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="Release|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					CompileAs="1"
+				/>
+			</FileConfiguration>
+		</File>
+		]]
+	end
+
+	function suite.CompileAsCpp_InCProject()
+		language "c"
+		files { "hello.cpp" }
+		prepare()
+		test.capture [[
+		<File
+			RelativePath="hello.cpp"
+			>
+			<FileConfiguration
+				Name="Debug|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					CompileAs="2"
+				/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="Release|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					CompileAs="2"
+				/>
+			</FileConfiguration>
+		</File>
+		]]
+	end
+
+
+--
+-- PCH support
+--
+
+	function suite.OnPCH_OnWindows()
+		files { "afxwin.cpp" }
+		pchsource "afxwin.cpp"
+		prepare()
+		test.capture [[
+		<File
+			RelativePath="afxwin.cpp"
+			>
+			<FileConfiguration
+				Name="Debug|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					UsePrecompiledHeader="1"
+				/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="Release|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					UsePrecompiledHeader="1"
+				/>
+			</FileConfiguration>
+		</File>
+		]]
+	end
+	
+	function suite.Files_OnPCH_OnXbox360()
+		files { "afxwin.cpp" }
+		pchsource "afxwin.cpp"
+		platforms { "Xbox360" }
+		prepare()
+		test.capture [[
+		<File
+			RelativePath="afxwin.cpp"
+			>
+			<FileConfiguration
+				Name="Debug|Xbox 360"
+				>
+				<Tool
+					Name="VCCLX360CompilerTool"
+					UsePrecompiledHeader="1"
+				/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="Release|Xbox 360"
+				>
+				<Tool
+					Name="VCCLX360CompilerTool"
+					UsePrecompiledHeader="1"
+				/>
+			</FileConfiguration>
+		</File>
+		]]
+	end
+

File tests/premake4.lua

View file
 	-- Visual Studio 2002-2008 C/C++ projects
 	dofile("actions/vstudio/vc200x/debugdir.lua")
 	dofile("actions/vstudio/vc200x/header.lua")
-	dofile("actions/vstudio/vc200x/files.lua")
+	dofile("actions/vstudio/vc200x/test_files.lua")
 	dofile("actions/vstudio/vc200x/test_filters.lua")
 
 	-- Visual Studio 2010 C/C++ projects