forked from DavidColson/Polybox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpremake5.lua
113 lines (106 loc) · 3.57 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
local BUILD_DIR = path.join("Build", _ACTION)
if _OPTIONS["cc"] ~= nil then
BUILD_DIR = BUILD_DIR .. "_" .. _OPTIONS["cc"]
end
GAME_DIR = "Game/Source"
ENGINE_DIR = "Engine/Source"
-- Third party locations
local SDL_DIR = "Engine/Lib/SDL2-2.0.8"
local BGFX_DIR = "Engine/Source/ThirdParty/bgfx"
local BIMG_DIR = "Engine/Source/ThirdParty/bimg"
local BX_DIR = "Engine/Source/ThirdParty/bx"
local EABASE_DIR = "Engine/Source/ThirdParty/EABase"
local EASTL_DIR = "Engine/Source/ThirdParty/EASTL"
function setBxCompat()
filter "action:vs*"
includedirs { path.join(BX_DIR, "include/compat/msvc") }
filter { "system:windows", "action:gmake" }
includedirs { path.join(BX_DIR, "include/compat/mingw") }
filter { "system:macosx" }
includedirs { path.join(BX_DIR, "include/compat/osx") }
buildoptions { "-x objective-c++" }
end
solution "Polybox"
location(BUILD_DIR)
startproject "Polybox"
configurations { "Release", "Debug" }
platforms "x86_64"
architecture "x86_64"
filter "configurations:Release"
defines "NDEBUG"
optimize "Full"
filter "configurations:Debug*"
defines "_DEBUG"
optimize "Debug"
symbols "On"
filter "system:macosx"
xcodebuildsettings {
["MACOSX_DEPLOYMENT_TARGET"] = "10.9",
["ALWAYS_SEARCH_USER_PATHS"] = "YES", -- This is the minimum version of macos we'll be able to run on
};
dofile("Source/ThirdParty/bx.lua")
dofile("Source/ThirdParty/bimg.lua")
dofile("Source/ThirdParty/bgfx.lua")
dofile("Source/ThirdParty/FreeType.lua")
dofile("Source/ThirdParty/lua.lua")
project "Polybox"
kind "WindowedApp"
language "C++"
cppdialect "C++20"
exceptionhandling "Off"
rtti "Off"
debugdir ""
files
{
"Source/*.cpp",
"Source/*.h",
"Source/Core/**.cpp",
"Source/Core/**.h",
}
includedirs
{
"Source/",
"Source/ThirdParty/bgfx/include",
"Source/ThirdParty/bimg/include",
"Source/ThirdParty/bx/include",
"Source/ThirdParty/bgfx/tools",
"Source/ThirdParty/FreeType/include",
"Source/ThirdParty/lua/src",
"Lib/SDL2-2.0.8/include",
}
links
{
"bgfx",
"shaderc",
"bimg",
"bimg_decode",
"bx",
"FreeType",
"lua",
"SDL2",
"SDL2main",
}
defines
{
"WINDOWS_IGNORE_PACKING_MISMATCH",
"__STDC_LIMIT_MACROS",
"__STDC_FORMAT_MACROS",
"__STDC_CONSTANT_MACROS",
}
filter "platforms:x86_64"
libdirs { "Lib/SDL2-2.0.8/lib/x64" }
filter "platforms:x86"
libdirs { "Lib/SDL2-2.0.8/lib/x86" }
filter "system:windows"
links { "gdi32", "kernel32", "psapi" }
filter "system:linux"
links { "dl", "GL", "pthread", "X11" }
filter "system:macosx"
links { "QuartzCore.framework", "Metal.framework", "Cocoa.framework", "IOKit.framework", "CoreVideo.framework" }
includedirs { "Source/ThirdParty/bx/include/compat/osx" }
buildoptions { "-x objective-c++" }
filter "action:vs*"
defines "_CRT_SECURE_NO_WARNINGS"
includedirs { "Source/ThirdParty/bx/include/compat/msvc" }
filter { "system:windows", "action:gmake" }
includedirs { "Source/ThirdParty/bx/include/compat/mingw" }