-
Notifications
You must be signed in to change notification settings - Fork 8
/
premake5.lua
54 lines (45 loc) · 1.48 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
workspace("timewise")
configurations({ "Debug", "Release" })
architecture("x64")
-- TimeWise project
project("timewise")
kind("WindowedApp")
language("C++")
targetdir("bin/%{cfg.buildcfg}/timewise")
-- Common include directories
includedirs({ "lib/imgui", "lib/imgui/backends", "lib/imguidate/" })
-- Common files
files({
"src/**.h",
"src/**.cpp",
"lib/imgui/*.cpp",
"lib/imgui/backends/imgui_impl_glfw.cpp",
"lib/imgui/backends/imgui_impl_opengl3.cpp",
"lib/imguidate/ImGuiDatePicker.cpp",
})
filter("configurations:Debug")
defines({ "DEBUG" })
symbols("On")
filter("configurations:Release")
defines({ "NDEBUG" })
optimize("On")
-- Linux-specific setup
filter("action:gmake")
defines({ "LINUX" })
buildoptions({ "-std=c++20", "-g", "-Wall", "-Wformat" })
links({ "GL", "glfw", "ical" })
linkoptions({ "`pkg-config --static --libs glfw3`" })
includedirs({ "`pkg-config --cflags glfw3`" })
-- Post-build command to copy the res folder on Linux
postbuildcommands({
"{COPY} ./res %{cfg.targetdir}/res",
})
-- Windows-specific setup for Visual Studio
filter("action:vs2022")
defines({ "WINDOWS" })
buildoptions({ "/std:c++20" }) -- Visual Studio uses MSVC syntax for build options
links({ "opengl32", "glfw3", "gdi32", "imm32", "ical" })
includedirs({ "lib/imgui", "lib/imgui/backends", "deps/glfw/include", "src" }) -- Include source directories for Windows
libdirs({ "deps/glfw/lib" })
-- Reset filters to avoid affecting other projects
filter({})