Make it work with gcc/Clang on windows
This commit is contained in:
12
.gitignore
vendored
12
.gitignore
vendored
@@ -1,8 +1,6 @@
|
||||
.vscode
|
||||
.vs
|
||||
bin/
|
||||
libs/
|
||||
obj/
|
||||
**.vcxproj
|
||||
**.sln
|
||||
**.user
|
||||
bin
|
||||
**.spv
|
||||
**.filters
|
||||
Makefile
|
||||
**/Makefile
|
||||
|
||||
6
HelloTriangle/premake5.lua
Normal file
6
HelloTriangle/premake5.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
project "HelloTriangle"
|
||||
files {
|
||||
"**.cpp",
|
||||
"**.h"
|
||||
}
|
||||
|
||||
5
Hello_triangle/.gitignore
vendored
5
Hello_triangle/.gitignore
vendored
@@ -1,5 +0,0 @@
|
||||
.vscode
|
||||
bin
|
||||
**.spv
|
||||
**.filters
|
||||
|
||||
@@ -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
|
||||
@@ -1,7 +0,0 @@
|
||||
require("premake", ">=5.0-beta2")
|
||||
|
||||
project "HelloTriangle"
|
||||
files{
|
||||
"**.cpp",
|
||||
"**.h"
|
||||
}
|
||||
@@ -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.
36
premake5.lua
36
premake5.lua
@@ -2,32 +2,49 @@ workspace "LearnVulkan"
|
||||
kind "ConsoleApp"
|
||||
language "C++"
|
||||
cppdialect "C++17"
|
||||
architecture "x64"
|
||||
targetdir "%{prj.location}/bin/%{cfg.buildcfg}"
|
||||
configurations { "Debug", "Release" }
|
||||
|
||||
include("Hello_vulkan/premake5.lua")
|
||||
include("Hello_triangle/premake5.lua")
|
||||
configurations { "Debug", "Release" }
|
||||
|
||||
filter "configurations:Debug"
|
||||
defines { "DEBUG" }
|
||||
symbols "On"
|
||||
|
||||
filter "configurations:Release"
|
||||
defines { "NDEBUG" }
|
||||
optimize "On"
|
||||
|
||||
filter "system:windows"
|
||||
-- buildoptions {
|
||||
-- "/MD"
|
||||
-- }
|
||||
linkoptions {
|
||||
-- "/NODEFAULTLIB:library"
|
||||
"-nodefaultlibs"
|
||||
}
|
||||
libdirs {
|
||||
"C:/VulkanSDK/1.4.304.1/Lib",
|
||||
"libs/GLFW",
|
||||
"C:/VulkanSDK/1.3.243.0/Lib"
|
||||
}
|
||||
includedirs {
|
||||
"C:/VulkanSDK/1.3.243.0/Include",
|
||||
"libs/"
|
||||
"C:/VulkanSDK/1.4.304.1/Include",
|
||||
"libs"
|
||||
}
|
||||
links {"glfw3", "vulkan-1"}
|
||||
architecture "x64"
|
||||
|
||||
links {
|
||||
"msvcrt",
|
||||
"user32",
|
||||
"kernel32",
|
||||
"libcmt",
|
||||
"gdi32",
|
||||
"glu32",
|
||||
"shell32",
|
||||
"opengl32",
|
||||
"glfw3",
|
||||
"vulkan-1"
|
||||
|
||||
}
|
||||
|
||||
filter "system:linux"
|
||||
links {
|
||||
@@ -41,4 +58,5 @@ workspace "LearnVulkan"
|
||||
"Xi"
|
||||
}
|
||||
|
||||
|
||||
include("HelloVulkan/premake5.lua")
|
||||
include("HelloTriangle/premake5.lua")
|
||||
|
||||
Reference in New Issue
Block a user