1
0

Make it work with gcc/Clang on windows

This commit is contained in:
2025-03-30 20:07:31 +02:00
parent 487e487fb3
commit f91fc8bf56
15 changed files with 64 additions and 82 deletions

12
.gitignore vendored
View File

@@ -1,8 +1,6 @@
.vscode .vscode
.vs bin
bin/ **.spv
libs/ **.filters
obj/ Makefile
**.vcxproj **/Makefile
**.sln
**.user

View File

@@ -0,0 +1,6 @@
project "HelloTriangle"
files {
"**.cpp",
"**.h"
}

View File

@@ -1,5 +0,0 @@
.vscode
bin
**.spv
**.filters

View File

@@ -1,15 +0,0 @@
CFLAGS = -std=c++17 -O2
LDFLAGS = -lglfw3 -lvulkan -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi
VulkanTest: main.cpp
g++ $(CFLAGS) -o ./bin/VulkanTest main.cpp $(LDFLAGS)
.PHONY: test clean
test: VulkanTest
./bin/VulkanTest
clean:
rm -f VulkanTest
# For information on Makefile's check
# https://makefiletutorial.com

View File

@@ -1,7 +0,0 @@
require("premake", ">=5.0-beta2")
project "HelloTriangle"
files{
"**.cpp",
"**.h"
}

View File

@@ -1,13 +0,0 @@
CFLAGS = -std=c++17 -O2
LDFLAGS = -lglfw3 -lvulkan -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi
VulkanTest: main.cpp
g++ $(CFLAGS) -o VulkanTest main.cpp $(LDFLAGS)
.PHONY: test clean
test: VulkanTest
./VulkanTest
clean:
rm -f VulkanTest

Binary file not shown.

View File

@@ -1,36 +1,53 @@
workspace "LearnVulkan" workspace "LearnVulkan"
kind "ConsoleApp" kind "ConsoleApp"
language "C++" language "C++"
cppdialect "C++17" cppdialect "C++17"
targetdir "%{prj.location}/bin/%{cfg.buildcfg}" architecture "x64"
configurations { "Debug", "Release" } targetdir "%{prj.location}/bin/%{cfg.buildcfg}"
include("Hello_vulkan/premake5.lua") configurations { "Debug", "Release" }
include("Hello_triangle/premake5.lua")
filter "configurations:Debug" filter "configurations:Debug"
defines { "DEBUG" } defines { "DEBUG" }
symbols "On" symbols "On"
filter "configurations:Release"
defines { "NDEBUG" }
optimize "On"
filter "system:windows" filter "configurations:Release"
libdirs{ defines { "NDEBUG" }
optimize "On"
filter "system:windows"
-- buildoptions {
-- "/MD"
-- }
linkoptions {
-- "/NODEFAULTLIB:library"
"-nodefaultlibs"
}
libdirs {
"C:/VulkanSDK/1.4.304.1/Lib",
"libs/GLFW", "libs/GLFW",
"C:/VulkanSDK/1.3.243.0/Lib" }
} includedirs {
includedirs { "C:/VulkanSDK/1.4.304.1/Include",
"C:/VulkanSDK/1.3.243.0/Include", "libs"
"libs/" }
}
links {"glfw3", "vulkan-1"}
architecture "x64"
links {
"msvcrt",
"user32",
"kernel32",
"libcmt",
"gdi32",
"glu32",
"shell32",
"opengl32",
"glfw3",
"vulkan-1"
}
filter "system:linux" filter "system:linux"
links { links {
"glfw3", "glfw3",
"vulkan", "vulkan",
"dl", "dl",
@@ -39,6 +56,7 @@ workspace "LearnVulkan"
"Xxf86vm", "Xxf86vm",
"Xrandr", "Xrandr",
"Xi" "Xi"
} }
include("HelloVulkan/premake5.lua")
include("HelloTriangle/premake5.lua")