-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpremake5.lua
109 lines (90 loc) · 2.36 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
workspace "CHIP-8"
configurations {"Debug", "Release"}
platforms {"x86", "x64"}
filter "platforms:x86"
kind "StaticLib"
architecture "x86"
filter "platforms:x64"
kind "StaticLib"
architecture "x64"
outputdir = "%{cfg.system}-%{cfg.buildcfg}-%{cfg.platform}"
project "CHIP-8"
location "CHIP-8"
kind "WindowedApp"
language "C++"
cppdialect "C++17"
targetdir ("%{prj.name}/".. outputdir .. "/bin")
objdir ("%{prj.name}/" .. outputdir .. "/obj")
files
{
"%{prj.name}/src/**.h",
"%{prj.name}/src/**.cpp",
"%{prj.name}/vendor/glad/src/glad.c",
"%{prj.name}/vendor/imgui/*.cpp",
"%{prj.name}/vendor/imgui/backends/*",
"%{prj.name}/vendor/nativefiledialog/*.h",
"%{prj.name}/vendor/nativefiledialog/nfd_common.c",
"%{prj.name}/vendor/nativefiledialog/include/nfd.h",
}
includedirs
{
"%{prj.name}/vendor/glad/include",
"%{prj.name}/vendor/sdl/include",
"%{prj.name}/vendor/imgui",
"%{prj.name}/vendor/nativefiledialog/include",
}
links
{
"SDL2",
"SDL2main",
}
filter "configurations:Debug"
defines "CH_DEBUG"
symbols "On"
filter "configurations:Release"
defines "CH_RELEASE"
optimize "On"
filter "system:windows"
files {"%{prj.name}/vendor/nativefiledialog/nfd_win.cpp"}
systemversion "latest"
filter "system:linux"
files {"%{prj.name}/vendor/nativefiledialog/nfd_gtk.c"}
buildoptions {"`pkg-config --cflags gtk+-3.0`"}
linkoptions {"`pkg-config --libs gtk+-3.0`", "-pthread", "-ldl"}
filter "system:macosx"
files {"%{prj.name}/vendor/nativefiledialog/nfd_cocoa.m"}
links {"Foundation.framework", "AppKit.framework"}
filter {"platforms:x86", "system:windows"}
libdirs
{
"%{prj.name}/vendor/sdl/lib/x86",
}
postbuildcommands
{
("{COPY} %{prj.location}/vendor/sdl/lib/%{cfg.platform}/SDL2.dll %{prj.location}/" .. outputdir .. "/bin")
}
filter {"platforms:x64", "system:windows"}
libdirs
{
"%{prj.name}/vendor/sdl/lib/x64",
}
postbuildcommands
{
("{COPY} %{prj.location}/vendor/sdl/lib/%{cfg.platform}/SDL2.dll %{prj.location}/" .. outputdir .. "/bin")
}
filter {"configurations:Release", "system:windows"}
linkoptions "/SUBSYSTEM:WINDOWS"
filter {"configurations:Debug", "system:windows"}
linkoptions "/SUBSYSTEM:CONSOLE"
--[[
newaction
{
trigger = "clean"
description = "Clean all output files"
execute = function ()
files_to_delete =
{
"Makefile",
}
}
--]]