-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpremake5.lua
More file actions
95 lines (74 loc) · 2.12 KB
/
premake5.lua
File metadata and controls
95 lines (74 loc) · 2.12 KB
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
dofile("pal_config.lua")
target_dir = "%{wks.location}/bin/%{cfg.buildcfg}"
obj_dir = "%{wks.location}/build"
local ucrt = os.getenv("UCRT64") or "C:/msys64/ucrt64"
newoption {
trigger = "compiler",
description = "Choose a C compiler",
value = "COMPILER",
allowed = {
{ "gcc", "GNU GCC" },
{ "clang", "Clang" },
{ "msvc", "MSVC" }
}
}
workspace "PAL_workspace"
if PAL_BUILD_TESTS then
startproject("tests")
end
if PAL_BUILD_STATIC then
staticruntime "on"
else
staticruntime "off"
end
configurations { "Debug", "Release" }
flags { "MultiProcessorCompile" }
filter {"system:windows", "configurations:*"}
architecture "x64"
systemversion "latest"
cdialect "C99"
filter {"system:linux", "configurations:*"}
architecture "x86_64"
cdialect "C99"
filter "configurations:Debug"
symbols "on"
runtime "Debug"
filter "configurations:Release"
symbols "off"
runtime "Release"
optimize "full"
filter {}
if (_ACTION == "gmake2") then
if (_OPTIONS["compiler"] == "clang") then
toolset("clang")
buildoptions {
"-target x86_64-w64-windows-gnu",
"-I" .. ucrt .. "/include",
"-I" .. ucrt .. "/ucrt/include",
"-I" .. ucrt .. "/mingw/include",
-- warnings
"-Wno-switch", -- for switch statements
"-Wno-switch-enum" -- for switch statements
}
linkoptions {
"-target x86_64-w64-windows-gnu",
"-L" .. ucrt .. "/lib",
"-L" .. ucrt .. "/mingw/lib"
}
end
end
if (_ACTION == "vs2022") then
if (_OPTIONS["compiler"] == "clang") then
toolset("clang")
end
defines {
"_CRT_SECURE_NO_WARNINGS"
}
disablewarnings {
"6387"
}
end
if (PAL_BUILD_TESTS) then
include "tests/tests.lua"
end
include "pal.lua"