summaryrefslogtreecommitdiff
path: root/scripts/premake4.lua
blob: 873497cee277bba66117f34f40427505b1e42f95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
if string.startswith(_ACTION, "vs") then
	-- We need debugging symbols for all configurations, but runtime library depends on official Symbols flag, so hack it
	function premake.vs200x_vcproj_symbols(cfg)
		return 3
	end

	local action = premake.action.current()

	if action then
		-- Disable solution generation
		function action.onsolution(sln)
			sln.vstudio_configs = premake.vstudio_buildconfigs(sln)
		end

		-- Rename output file
		function action.onproject(prj)
			premake.generate(prj, "%%_" .. _ACTION .. ".vcproj", premake.vs200x_vcproj)
		end
	end
end

solution "pugixml"
	objdir(_ACTION)
	targetdir(_ACTION)

if string.startswith(_ACTION, "vs") then
	if _ACTION ~= "vs2002" and _ACTION ~= "vs2003" then
		platforms { "x32", "x64" }

		configuration "x32" targetdir(_ACTION .. "/x32")
		configuration "x64" targetdir(_ACTION .. "/x64")
	end

	configurations { "Debug", "Release", "DebugStatic", "ReleaseStatic" }

	configuration "DebugStatic" targetsuffix "_sd"
	configuration "ReleaseStatic" targetsuffix "_s"
	configuration "Debug" targetsuffix "_d"
else
	configurations { "Debug", "Release" }

	configuration "Debug" targetsuffix "_d"
end

project "pugixml"
	kind "StaticLib"
	language "C++"
	files { "../src/pugixml.hpp", "../src/pugiconfig.hpp", "../src/pugixml.cpp", "../src/pugixpath.cpp" }
	flags { "NoPCH", "NoMinimalRebuild" }
	uuid "89A1E353-E2DC-495C-B403-742BE206ACED"

configuration "Debug*"
	defines { "_DEBUG" }
	flags { "Symbols" }

configuration "Release*"
	defines { "NDEBUG" }
	flags { "Optimize" }

configuration "*Static"
	flags { "StaticRuntime" }