forked from edo9300/edopro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpremake5.lua
98 lines (82 loc) · 2.44 KB
/
premake5.lua
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
newoption {
trigger = "no-direct3d",
description = "Disable DirectX options in irrlicht if the DirectX SDK isn't installed"
}
newoption {
trigger = "pics",
value = "url_template",
description = "Default URL for card images"
}
newoption {
trigger = "fields",
value = "url_template",
description = "Default URL for Field Spell backgrounds"
}
newoption {
trigger = "prebuilt-core",
value = "path",
description = "Path to library folder containing libocgcore"
}
newoption {
trigger = "vcpkg-root",
value = "path",
description = "Path to vcpkg installation"
}
workspace "ygo"
location "build"
language "C++"
objdir "obj"
startproject "ygopro"
staticruntime "on"
configurations { "Debug", "Release" }
filter "system:windows"
defines { "WIN32", "_WIN32", "NOMINMAX" }
filter "system:macosx"
includedirs { "/usr/local/include" }
libdirs { "/usr/local/lib" }
if _OPTIONS["vcpkg-root"] then
filter "system:linux"
includedirs { _OPTIONS["vcpkg-root"] .. "/installed/x64-linux/include" }
filter { "system:linux", "configurations:Debug" }
libdirs { _OPTIONS["vcpkg-root"] .. "/installed/x64-linux/debug/lib" }
filter { "system:linux", "configurations:Release" }
libdirs { _OPTIONS["vcpkg-root"] .. "/installed/x64-linux/lib" }
end
filter "action:vs*"
vectorextensions "SSE2"
buildoptions "-wd4996"
defines "_CRT_SECURE_NO_WARNINGS"
filter "action:not vs*"
buildoptions { "-fno-strict-aliasing", "-Wno-multichar" }
filter { "action:not vs*", "system:windows" }
buildoptions { "-static-libgcc" }
filter "configurations:Debug"
symbols "On"
defines "_DEBUG"
targetdir "bin/debug"
runtime "Debug"
filter { "configurations:Release*" , "action:not vs*" }
symbols "On"
defines "NDEBUG"
filter "configurations:Release"
optimize "Size"
targetdir "bin/release"
subproject = true
if not _OPTIONS["prebuilt-core"] then
include "ocgcore"
end
include "gframe"
if os.istarget("windows") then
include "freetype"
include "irrlicht"
end
local function vcpkgStaticTriplet(prj)
premake.w('<VcpkgTriplet Condition="\'$(Platform)\'==\'Win32\'">x86-windows-static</VcpkgTriplet>')
premake.w('<VcpkgTriplet Condition="\'$(Platform)\'==\'x64\'">x64-windows-static</VcpkgTriplet>')
end
require('vstudio')
premake.override(premake.vstudio.vc2010.elements, "globals", function(base, prj)
local calls = base(prj)
table.insertafter(calls, premake.vstudio.vc2010.targetPlatformVersionGlobal, vcpkgStaticTriplet)
return calls
end)