source: icGREP/icgrep-devel/icgrep/combine/pugixml/scripts/premake4.lua @ 5516

Last change on this file since 5516 was 5516, checked in by faldebey, 2 years ago

added combinatorial testing tool

File size: 2.3 KB
Line 
1-- Reset RNG seed to get consistent results across runs (i.e. XCode)
2math.randomseed(12345)
3
4local static = _ARGS[1] == 'static'
5local action = premake.action.current()
6
7if 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
31elseif _ACTION == "codeblocks" then
32        action.onsolution = nil
33
34        function action.onproject(prj)
35                premake.generate(prj, "%%_" .. _ACTION .. ".cbp", premake.codeblocks_cbp)
36        end
37elseif _ACTION == "codelite" then
38        action.onsolution = nil
39
40        function action.onproject(prj)
41                premake.generate(prj, "%%_" .. _ACTION .. ".project", premake.codelite_project)
42        end
43end
44
45solution "pugixml"
46        objdir(_ACTION)
47        targetdir(_ACTION)
48
49if 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
65else
66        if _ACTION == "xcode3" then
67                platforms "universal"
68        end
69
70        configurations { "Debug", "Release" }
71
72        configuration "Debug" targetsuffix "d"
73end
74
75project "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
82configuration "Debug"
83        defines { "_DEBUG" }
84
85configuration "Release"
86        defines { "NDEBUG" }
87        flags { "Optimize" }
88
89if static then
90    configuration "*"
91        flags { "StaticRuntime" }
92end
Note: See TracBrowser for help on using the repository browser.