Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Walnut/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ project "Walnut"
"src",

"../vendor/imgui",
"../vendor/glfw/include",
"../vendor/GLFW/include",
"../vendor/stb_image",

"%{IncludeDir.VulkanSDK}",
Expand Down
21 changes: 21 additions & 0 deletions Walnut/src/Walnut/EntryPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,26 @@ int main(int argc, char** argv)
}

#endif // WL_DIST
#else // Linux/Mac

extern Walnut::Application* Walnut::CreateApplication(int argc, char** argv);
bool g_ApplicationRunning = true;

namespace Walnut {
int Main(int argc, char** argv)
{
while (g_ApplicationRunning)
{
Walnut::Application* app = Walnut::CreateApplication(argc, argv);
app->Run();
delete app;
}
return 0;
}
}

int main(int argc, char** argv)
{
return Walnut::Main(argc, argv);
}
#endif // WL_PLATFORM_WINDOWS
4 changes: 2 additions & 2 deletions WalnutExternal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Library["Vulkan"] = "%{LibraryDir.VulkanSDK}/vulkan-1.lib"

group "Dependencies"
include "vendor/imgui"
include "vendor/glfw"
include "vendor/GLFW"
group ""

group "Core"
include "Walnut"
group ""
group ""
10 changes: 9 additions & 1 deletion premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,12 @@ workspace "WalnutApp"
outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"

include "WalnutExternal.lua"
include "WalnutApp"
include "WalnutApp"

filter "system:windows"
systemversion "latest"
defines { "WL_PLATFORM_WINDOWS" }
links { "%{Library.Vulkan}" }

filter "system:linux"
links { "vulkan" }
Comment on lines +12 to +18
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify Vulkan link token definition and usage across premake files.
# Expected: detect Windows-specific token definition and unconditional usage sites.

rg -n -C2 'Library\["Vulkan"\]|vulkan-1\.lib' --type lua
rg -n -C2 '%{Library\.Vulkan}' --type lua
rg -n -C2 'filter\s*"system:(windows|linux)"|links\s*\{[^}]*"vulkan"[^}]*\}' --type lua

Repository: StudioCherno/Walnut

Length of output: 1280


🏁 Script executed:

# Search for Vulkan-related content in Walnut/premake5.lua specifically
fd -n "premake5.lua" | while read f; do
  echo "=== File: $f ==="
  rg -n "Vulkan|vulkan|Library" "$f" -C1
done

Repository: StudioCherno/Walnut

Length of output: 293


🏁 Script executed:

# Read the full Walnut/premake5.lua to see the complete context
cat -n Walnut/premake5.lua

Repository: StudioCherno/Walnut

Length of output: 1434


Move Vulkan linking to system-specific filters in Walnut/premake5.lua.

Walnut/premake5.lua unconditionally links %{Library.Vulkan} (line 27), which resolves to vulkan-1.lib from WalnutExternal.lua—a Windows-only library. This breaks Linux builds even though the root premake5.lua correctly filters Vulkan by system. Move the Vulkan link from the global links block to per-system filters:

Proposed fix
--- a/Walnut/premake5.lua
+++ b/Walnut/premake5.lua
@@ -24,8 +24,6 @@
    {
        "ImGui",
        "GLFW",
-
-       "%{Library.Vulkan}",
    }
 
    targetdir ("bin/" .. outputdir .. "/%{prj.name}")
@@ -33,6 +31,7 @@
    filter "system:windows"
       systemversion "latest"
       defines { "WL_PLATFORM_WINDOWS" }
+      links { "%{Library.Vulkan}" }
+
+   filter "system:linux"
+      links { "vulkan" }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@premake5.lua` around lines 12 - 18, The global links entry in
Walnut/premake5.lua is adding %{Library.Vulkan} (a Windows-only vulkan-1.lib)
unconditionally, breaking Linux builds; move the Vulkan linking into the system
filters instead: remove or stop linking %{Library.Vulkan} from the global links
block and add links { "%{Library.Vulkan}" } inside the filter "system:windows",
and ensure filter "system:linux" uses links { "vulkan" } (update the existing
filters "system:windows" and "system:linux" in premake5.lua accordingly).

2 changes: 1 addition & 1 deletion vendor/GLFW