comparison dep/pugixml/scripts/premake4.lua @ 367:8d45d892be88 default tip

*: instead of pugixml, use Qt XML features this means we have one extra Qt dependency though...
author Paper <paper@tflc.us>
date Sun, 17 Nov 2024 22:55:47 -0500
parents 886f66775f31
children
comparison
equal deleted inserted replaced
366:886f66775f31 367:8d45d892be88
1 -- Reset RNG seed to get consistent results across runs (i.e. XCode)
2 math.randomseed(12345)
3
4 local static = _ARGS[1] == 'static'
5 local action = premake.action.current()
6
7 if string.startswith(_ACTION, "vs") then
8 if action then
9 -- Disable solution generation
10 function action.onsolution(sln)
11 sln.vstudio_configs = premake.vstudio_buildconfigs(sln)
12 end
13
14 -- Rename output file
15 function action.onproject(prj)
16 local name = "%%_" .. _ACTION .. (static and "_static" or "")
17
18 if static then
19 for k, v in pairs(prj.project.__configs) do
20 v.objectsdir = v.objectsdir .. "Static"
21 end
22 end
23
24 if _ACTION == "vs2010" then
25 premake.generate(prj, name .. ".vcxproj", premake.vs2010_vcxproj)
26 else
27 premake.generate(prj, name .. ".vcproj", premake.vs200x_vcproj)
28 end
29 end
30 end
31 elseif _ACTION == "codeblocks" then
32 action.onsolution = nil
33
34 function action.onproject(prj)
35 premake.generate(prj, "%%_" .. _ACTION .. ".cbp", premake.codeblocks_cbp)
36 end
37 elseif _ACTION == "codelite" then
38 action.onsolution = nil
39
40 function action.onproject(prj)
41 premake.generate(prj, "%%_" .. _ACTION .. ".project", premake.codelite_project)
42 end
43 end
44
45 solution "pugixml"
46 objdir(_ACTION)
47 targetdir(_ACTION)
48
49 if string.startswith(_ACTION, "vs") then
50 if _ACTION ~= "vs2002" and _ACTION ~= "vs2003" then
51 platforms { "x32", "x64" }
52
53 configuration "x32" targetdir(_ACTION .. "/x32")
54 configuration "x64" targetdir(_ACTION .. "/x64")
55 end
56
57 configurations { "Debug", "Release" }
58
59 if static then
60 configuration "Debug" targetsuffix "sd"
61 configuration "Release" targetsuffix "s"
62 else
63 configuration "Debug" targetsuffix "d"
64 end
65 else
66 if _ACTION == "xcode3" then
67 platforms "universal"
68 end
69
70 configurations { "Debug", "Release" }
71
72 configuration "Debug" targetsuffix "d"
73 end
74
75 project "pugixml"
76 kind "StaticLib"
77 language "C++"
78 files { "../src/pugixml.hpp", "../src/pugiconfig.hpp", "../src/pugixml.cpp" }
79 flags { "NoPCH", "NoMinimalRebuild", "NoEditAndContinue", "Symbols" }
80 uuid "89A1E353-E2DC-495C-B403-742BE206ACED"
81
82 configuration "Debug"
83 defines { "_DEBUG" }
84
85 configuration "Release"
86 defines { "NDEBUG" }
87 flags { "Optimize" }
88
89 if static then
90 configuration "*"
91 flags { "StaticRuntime" }
92 end