forked from mkinyon/SDL3_GPU_Example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpremake5.lua
More file actions
90 lines (74 loc) Β· 2.48 KB
/
premake5.lua
File metadata and controls
90 lines (74 loc) Β· 2.48 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
workspace "SDL3_GPU_Example"
configurations { "Debug", "Release" }
architecture "x64"
startproject "SDL3App"
OutputDir = "%{cfg.system}-%{cfg.architecture}/%{cfg.buildcfg}"
local sdl3_root = path.getabsolute("vendor/SDL3")
local sdl3_build = path.join(sdl3_root, "build")
local cmakeExe = path.getabsolute("vendor/cmake/bin/cmake.exe")
-- SDL_shadercross
project "SDL_shadercross"
kind "StaticLib"
language "C++"
cppdialect "C++17"
staticruntime "on"
targetdir ("Binaries/" .. OutputDir .. "/%{prj.name}")
objdir ("Binaries/Intermediates/" .. OutputDir .. "/%{prj.name}")
dependson { "SDL3" }
files {
"vendor/SDL_shadercross/src/SDL_shadercross.c",
"vendor/SDL_shadercross/external/SPIRV-Cross/*.cpp"
}
includedirs {
"vendor/SDL3/include",
"vendor/SDL_shadercross/include",
"vendor/SDL_shadercross/external/SPIRV-Headers/include",
"vendor/SDL_shadercross/external/SPIRV-Cross",
"vendor/SDL_shadercross/external/SPIRV-Tools/include",
"vendor/SDL_shadercross/external/DirectXShaderCompiler/include"
}
libdirs {
"%{wks.location}/vendor/SDL3/build/%{cfg.buildcfg}"
}
links { "SDL3" }
filter "system:windows"
systemversion "latest"
postbuildcommands {
"{COPY} \"vendor/SDL3/build/Debug/SDL3.dll\" \"%{cfg.targetdir}\""
}
filter "configurations:Debug"
runtime "Debug"; symbols "On"
filter "configurations:Release"
runtime "Release"; optimize "On"
-- SDL3App
project "SDL3App"
kind "ConsoleApp"
language "C++"
cppdialect "C++20"
staticruntime "on"
targetdir ("Binaries/" .. OutputDir .. "/%{prj.name}")
objdir ("Binaries/Intermediates/" .. OutputDir .. "/%{prj.name}")
dependson { "SDL3", "SDL_shadercross" }
files { "src/**.h", "src/**.cpp" }
includedirs {
"vendor/SDL3/include",
"vendor/SDL3/build/include-config-debug",
"vendor/SDL_shadercross/include",
"vendor/SDL_shadercross/external/SPIRV-Headers/include",
}
libdirs {
"%{wks.location}/vendor/SDL3/build/%{cfg.buildcfg}"
}
links {
"SDL3",
"SDL_shadercross"
}
filter "system:windows"
systemversion "latest"
postbuildcommands {
"{COPY} \"vendor/SDL3/build/Debug/SDL3.dll\" \"%{cfg.targetdir}\""
}
filter "configurations:Debug"
runtime "Debug"; symbols "On"
filter "configurations:Release"
runtime "Release"; optimize "On"