aboutsummaryrefslogtreecommitdiff
path: root/premake5.lua
diff options
context:
space:
mode:
Diffstat (limited to 'premake5.lua')
-rw-r--r--premake5.lua49
1 files changed, 38 insertions, 11 deletions
diff --git a/premake5.lua b/premake5.lua
index 2d2b0c6..22e1a1d 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -243,7 +243,18 @@ project "ImGui"
"ext/imgui/imgui_draw.cpp",
"ext/imgui/imgui_tables.cpp",
"ext/imgui/imgui_widgets.cpp",
- "ext/imgui/imgui_demo.cpp"
+ "ext/imgui/imgui_demo.cpp",
+
+ -- the platform/renderer backends live here, not in the app, so they aren't
+ -- held to the app's -Wall -Wextra -Werror -pedantic.
+ "ext/imgui/backends/imgui_impl_glfw.cpp",
+ "ext/imgui/backends/imgui_impl_opengl3.cpp"
+ }
+
+ includedirs
+ {
+ "%{IncludeDir.imgui}",
+ "%{IncludeDir.glfw}"
}
filter "system:windows"
@@ -255,6 +266,10 @@ project "ImGui"
systemversion "latest"
cppdialect "C++17"
+ filter "system:macosx"
+ files { "ext/imgui/backends/imgui_impl_vulkan.cpp" } -- Vulkan via MoltenVK, macOS only
+ externalincludedirs { "/opt/homebrew/include" }
+
filter "configurations:Debug"
runtime "Debug"
symbols "on"
@@ -335,9 +350,6 @@ project "Donut"
"src/**.h",
"src/**.cpp",
- "ext/imgui/backends/imgui_impl_glfw.cpp",
- "ext/imgui/backends/imgui_impl_opengl3.cpp",
-
"assets/fonts/inter/static/Inter_18pt-Regular.ttf",
"assets/fonts/inter/static/Inter_18pt-Bold.ttf",
"assets/fonts/inter/static/Inter_18pt-Light.ttf"
@@ -345,8 +357,13 @@ project "Donut"
includedirs
{
- "src",
+ "src"
+ }
+ -- vendored deps are external: -isystem so their warnings don't trip our
+ -- -Werror, and we aren't on the hook for making glm/imgui/toml11 -pedantic.
+ externalincludedirs
+ {
"%{IncludeDir.glm}",
"%{IncludeDir.glfw}",
"%{IncludeDir.glad}",
@@ -357,6 +374,18 @@ project "Donut"
"%{IncludeDir.nlohmann}",
"%{IncludeDir.stb}",
}
+ externalwarnings "Off"
+
+ -- our own code is held to strict warnings (clang/gcc only; MSVC uses /W).
+ filter { "system:macosx or system:linux" }
+ buildoptions { "-Wall", "-Wextra", "-Werror", "-pedantic" }
+ filter {}
+
+ -- Vulkan create-info structs use aggregate init (VkFoo{ TYPE }); pNext etc.
+ -- are zero-initialised, so -Wmissing-field-initializers is just noise there.
+ filter { "system:macosx or system:linux", "files:src/platform/vulkan/**" }
+ buildoptions { "-Wno-missing-field-initializers" }
+ filter {}
links
{
@@ -375,12 +404,10 @@ project "Donut"
}
filter "system:macosx"
- -- Objective-C++ (Metal) sources + the ImGui Vulkan backend compile only
- -- on macOS (Vulkan headers come from Homebrew there).
+ -- Objective-C++ (Metal) sources compile only on macOS.
files
{
- "src/**.mm",
- "ext/imgui/backends/imgui_impl_vulkan.cpp"
+ "src/**.mm"
}
-- Compile the Slang shaders to assets/shaders/generated/ before building.
@@ -391,8 +418,8 @@ project "Donut"
}
-- Vulkan (via MoltenVK) from Homebrew; see tools/vulkan-env.sh for runtime.
- includedirs { "/opt/homebrew/include" }
- libdirs { "/opt/homebrew/lib" }
+ externalincludedirs { "/opt/homebrew/include" }
+ libdirs { "/opt/homebrew/lib" }
links
{