Make it work with gcc/Clang on windows
This commit is contained in:
12
.gitignore
vendored
12
.gitignore
vendored
@@ -1,8 +1,6 @@
|
|||||||
.vscode
|
.vscode
|
||||||
.vs
|
bin
|
||||||
bin/
|
**.spv
|
||||||
libs/
|
**.filters
|
||||||
obj/
|
Makefile
|
||||||
**.vcxproj
|
**/Makefile
|
||||||
**.sln
|
|
||||||
**.user
|
|
||||||
|
|||||||
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"
|
kind "ConsoleApp"
|
||||||
language "C++"
|
language "C++"
|
||||||
cppdialect "C++17"
|
cppdialect "C++17"
|
||||||
|
architecture "x64"
|
||||||
targetdir "%{prj.location}/bin/%{cfg.buildcfg}"
|
targetdir "%{prj.location}/bin/%{cfg.buildcfg}"
|
||||||
configurations { "Debug", "Release" }
|
|
||||||
|
|
||||||
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"
|
filter "configurations:Release"
|
||||||
defines { "NDEBUG" }
|
defines { "NDEBUG" }
|
||||||
optimize "On"
|
optimize "On"
|
||||||
|
|
||||||
filter "system:windows"
|
filter "system:windows"
|
||||||
|
-- buildoptions {
|
||||||
|
-- "/MD"
|
||||||
|
-- }
|
||||||
|
linkoptions {
|
||||||
|
-- "/NODEFAULTLIB:library"
|
||||||
|
"-nodefaultlibs"
|
||||||
|
}
|
||||||
libdirs {
|
libdirs {
|
||||||
|
"C:/VulkanSDK/1.4.304.1/Lib",
|
||||||
"libs/GLFW",
|
"libs/GLFW",
|
||||||
"C:/VulkanSDK/1.3.243.0/Lib"
|
|
||||||
}
|
}
|
||||||
includedirs {
|
includedirs {
|
||||||
"C:/VulkanSDK/1.3.243.0/Include",
|
"C:/VulkanSDK/1.4.304.1/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 {
|
||||||
@@ -41,4 +58,5 @@ workspace "LearnVulkan"
|
|||||||
"Xi"
|
"Xi"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
include("HelloVulkan/premake5.lua")
|
||||||
|
include("HelloTriangle/premake5.lua")
|
||||||
|
|||||||
Reference in New Issue
Block a user