forked from Euclideon/udcore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpremake5.lua
99 lines (84 loc) · 3.01 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
99
require "vstudio"
require "emscripten"
newoption {
trigger = "coverage",
description = "Configures project to emit test coverage information"
}
filter { "options:coverage" }
location "."
buildoptions { "-fprofile-arcs", "-ftest-coverage" }
linkoptions { "-fprofile-arcs" }
optimize "Off"
filter {}
table.insert(premake.option.get("os").allowed, { "android", "Google Android" })
table.insert(premake.option.get("os").allowed, { "ios", "Apple iOS" })
table.insert(premake.option.get("os").allowed, { "emscripten", "Emscripten" })
-- iOS stuff
filter { "system:ios" }
systemversion "10.3"
links { "Foundation.framework" }
filter { "system:ios", "action:xcode4" }
xcodebuildsettings {
["CODE_SIGN_IDENTITY[sdk=iphoneos*]"] = "iPhone Developer",
['IPHONEOS_DEPLOYMENT_TARGET'] = '10.3',
['SDKROOT'] = 'iphoneos',
['ARCHS'] = 'arm64',
['TARGETED_DEVICE_FAMILY'] = "1,2",
['DEVELOPMENT_TEAM'] = "452P989JPT",
['ENABLE_BITCODE'] = "NO",
}
filter {}
solution "udCore"
-- This hack just makes the VS project and also the makefile output their configurations in the idiomatic order
if (_ACTION == "gmake" or _ACTION == "gmake2") and os.target() == premake.LINUX then
configurations { "Release", "Debug", "DebugOpt", "ReleaseClang", "DebugClang", "DebugOptClang" }
toolset "gcc"
filter { "configurations:*Clang" }
toolset "clang"
filter { }
elseif os.target() == premake.MACOSX or os.target() == premake.IOS or os.target() == premake.ANDROID then
configurations { "Release", "Debug", "DebugOpt" }
if os.target() == premake.MACOSX or os.target() == premake.IOS then
toolset "clang"
end
else
configurations { "Debug", "DebugOpt", "Release" }
end
if os.target() == premake.IOS or os.target() == premake.ANDROID then
platforms { "x64", "arm64" }
elseif os.target() == "emscripten" then
platforms { "Emscripten" }
buildoptions { "-s USE_PTHREADS=1", "-s PTHREAD_POOL_SIZE=8", "-s ABORTING_MALLOC=0", "-s FETCH=1", "-s PROXY_TO_PTHREAD=1", "-s WASM=1", "-s TOTAL_MEMORY=1073741824" }
linkoptions { "-s USE_PTHREADS=1", "-s PTHREAD_POOL_SIZE=8", "-s ABORTING_MALLOC=0", "-s FETCH=1", "-s PROXY_TO_PTHREAD=1", "-s WASM=1", "-s TOTAL_MEMORY=1073741824" }
targetextension ".bc"
filter { "kind:*App" }
targetextension ".js"
filter { "files:**.cpp" }
buildoptions { "-std=c++14" }
filter {}
else
platforms { "x64" }
end
pic "On"
editorintegration "on"
cppdialect "C++14"
startproject "udTest"
-- CI defines
if os.getenv("CI_COMMIT_REF_NAME") then
defines { "GIT_BRANCH=\"" .. os.getenv("CI_COMMIT_REF_NAME") .. "\"" }
end
if os.getenv("CI_COMMIT_SHA") then
defines { "GIT_REF=\"" .. os.getenv("CI_COMMIT_SHA") .. "\"" }
end
if os.getenv("CI_PIPELINE_ID") then
defines { "GIT_BUILD=" .. os.getenv("CI_PIPELINE_ID") }
end
group "libs"
if os.target() ~= premake.IOS and os.target() ~= premake.ANDROID then
dofile "3rdParty/googletest/project.lua"
end
group ""
dofile "project.lua"
if os.target() ~= premake.IOS and os.target() ~= premake.ANDROID then
dofile "udTest/project.lua"
end