-
Notifications
You must be signed in to change notification settings - Fork 17
/
premake5.lua
84 lines (68 loc) · 2.13 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
newoption {
trigger = "include",
value = "path",
description = "The location of wren.h"
}
newoption {
trigger = "link",
value = "path",
description = "The location of the wren static lib"
}
workspace "wrenpp"
local project_location = ""
if _ACTION then
project_location = "build/" .._ACTION
end
configurations { "Debug", "Release", "Test" }
architecture "x86_64"
-- global configuration
filter "configurations:Debug"
defines { "DEBUG" }
symbols "On"
filter "configurations:Release"
defines { "NDEBUG" }
optimize "On"
filter "action:vs*"
defines { "_CRT_SECURE_NO_WARNINGS" }
filter "not action:vs*"
buildoptions { "-std=c++14" }
project "lib"
location(project_location)
kind "StaticLib"
language "C++"
targetdir "lib/%{cfg.buildcfg}"
targetname "wrenpp"
if _OPTIONS["include"] then
includedirs { _OPTIONS["include"] }
end
files { "Wren++.cpp", "Wren++.h" }
includedirs { "src" }
project "test"
location(project_location)
kind "ConsoleApp"
language "C++"
targetdir "bin/%{cfg.buildcfg}"
targetname "test"
files { "Wren++.cpp", "test/**.cpp", "test/***.h", "test/**.wren" }
includedirs { "./", "test" }
if _OPTIONS["include"] then
includedirs { _OPTIONS["include"] }
end
if _OPTIONS["link"] then
libdirs {
_OPTIONS["link"]
}
end
prebuildcommands { "{MKDIR} %{cfg.targetdir}" }
filter "files:**.wren"
buildcommands { "{COPY} %{file.abspath} %{cfg.targetdir}" }
buildoutputs { "%{cfg.targetdir}/%{file.name}" }
filter {}
filter "configurations:Debug"
debugdir "bin/%{cfg.buildcfg}"
filter { "action:vs*", "Debug" }
links { "lib", "wren_static_d" }
filter { "action:vs*", "Release"}
links { "lib", "wren_static" }
filter { "not action:vs*" }
links { "lib", "wren" }