Moved to CMake as a build system
This commit is contained in:
@@ -1,33 +1,11 @@
|
|||||||
cmake_minimum_required(VERSION 4.0)
|
cmake_minimum_required(VERSION 4.0)
|
||||||
|
|
||||||
set(CXX_STANDARD 17)
|
|
||||||
set(CXX_STANDARD_REQUIRED ON)
|
|
||||||
set(CMAKE_GENERATOR_PLATFORM x64)
|
set(CMAKE_GENERATOR_PLATFORM x64)
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_CXX_COMPILER clang)
|
||||||
project (LearnVulkan VERSION 1.0.0)
|
project (LearnVulkan VERSION 1.0.0)
|
||||||
|
|
||||||
# project 1
|
add_subdirectory(HelloTriangle)
|
||||||
add_executable(HelloTriangle)
|
add_subdirectory(HelloVulkan)
|
||||||
|
|
||||||
# linker settings
|
|
||||||
target_link_options(HelloTriangle PUBLIC nodefaultlibs)
|
|
||||||
target_link_directories( HelloTriangle PUBLIC )
|
|
||||||
target_link_libraries(HelloTriangle msvcrt user32 kernel32 libcmt gdi32 glu32 shell32 opengl32
|
|
||||||
glfw3 vulkan-1)
|
|
||||||
|
|
||||||
target_include_directories(HelloTriangle PUBLIC "c:/VulkanSDK/1.4.304.1/Include" "libs")
|
|
||||||
|
|
||||||
target_compile_definitions(HelloTriangle PUBLIC $<CONFIG:Release>:NDEBUG)
|
|
||||||
target_compile_definitions(HelloTriangle PUBLIC $<CONFIG:Debug>:DEBUG)
|
|
||||||
|
|
||||||
# project 2
|
|
||||||
add_executable(HelloVulkan)
|
|
||||||
|
|
||||||
# linker settings
|
|
||||||
target_link_options(HelloVulkan PUBLIC nodefaultlibs)
|
|
||||||
target_include_directories(HelloVulkan PUBLIC "c:/VulkanSDK/1.4.304.1/Include" "libs")
|
|
||||||
target_link_libraries(HelloVulkan msvcrt user32 kernel32 libcmt gdi32 glu32 shell32 opengl32
|
|
||||||
glfw3 vulkan-1)
|
|
||||||
|
|
||||||
target_compile_definitions(HelloVulkan PUBLIC $<CONFIG:Release>:NDEBUG)
|
|
||||||
target_compile_definitions(HelloVulkan PUBLIC $<CONFIG:Debug>:DEBUG)
|
|
||||||
|
|||||||
25
HelloTriangle/CMakeLists.txt
Normal file
25
HelloTriangle/CMakeLists.txt
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# project 1
|
||||||
|
add_executable(HelloTriangle main.cpp )
|
||||||
|
|
||||||
|
# linker settings
|
||||||
|
target_link_directories( HelloTriangle PUBLIC
|
||||||
|
"../libs/GLFW"
|
||||||
|
"../libs/glm"
|
||||||
|
"../libs/imgui"
|
||||||
|
"c:/VulkanSDK/1.4.304.1/Lib"
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(HelloTriangle PUBLIC
|
||||||
|
"c:/VulkanSDK/1.4.304.1/Include"
|
||||||
|
"../libs"
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(HelloTriangle
|
||||||
|
glfw3
|
||||||
|
vulkan-1
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
target_compile_definitions(HelloTriangle PUBLIC $<CONFIG:Release>:NDEBUG)
|
||||||
|
target_compile_definitions(HelloTriangle PUBLIC $<CONFIG:Debug>:DEBUG)
|
||||||
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"directory": "J:/git/Graphics API/LearnVulkan/HelloVulkan",
|
|
||||||
"file": "J:/git/Graphics API/LearnVulkan/HelloVulkan/main.cpp",
|
|
||||||
"command": "cc -MD -MP -DDEBUG -IC:/VulkanSDK/1.4.304.1/Include -I\"J:/git/Graphics API/LearnVulkan/libs\" -m64 -g -o J:/git/Graphics API/LearnVulkan/HelloVulkan/obj/Debug/main.o -MF J:/git/Graphics API/LearnVulkan/HelloVulkan/obj/Debug/main.d -c J:/git/Graphics API/LearnVulkan/HelloVulkan/main.cpp"
|
|
||||||
}
|
|
||||||
,
|
|
||||||
{
|
|
||||||
"directory": "J:/git/Graphics API/LearnVulkan/HelloTriangle",
|
|
||||||
"file": "J:/git/Graphics API/LearnVulkan/HelloTriangle/main.cpp",
|
|
||||||
"command": "cc -MD -MP -DDEBUG -IC:/VulkanSDK/1.4.304.1/Include -I\"J:/git/Graphics API/LearnVulkan/libs\" -m64 -g -o J:/git/Graphics API/LearnVulkan/HelloTriangle/obj/Debug/main.o -MF J:/git/Graphics API/LearnVulkan/HelloTriangle/obj/Debug/main.d -c J:/git/Graphics API/LearnVulkan/HelloTriangle/main.cpp"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
project "HelloTriangle"
|
|
||||||
files {
|
|
||||||
"**.cpp",
|
|
||||||
"**.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
23
HelloVulkan/CMakeLists.txt
Normal file
23
HelloVulkan/CMakeLists.txt
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# project 2
|
||||||
|
add_executable(HelloVulkan main.cpp)
|
||||||
|
|
||||||
|
# linker settings
|
||||||
|
target_link_directories( HelloVulkan PUBLIC
|
||||||
|
"../libs/GLFW"
|
||||||
|
"../libs/glm"
|
||||||
|
"../libs/imgui"
|
||||||
|
"c:/VulkanSDK/1.4.304.1/Lib"
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(HelloVulkan PUBLIC
|
||||||
|
"c:/VulkanSDK/1.4.304.1/Include"
|
||||||
|
"../libs"
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(HelloVulkan
|
||||||
|
glfw3
|
||||||
|
vulkan-1
|
||||||
|
)
|
||||||
|
|
||||||
|
target_compile_definitions(HelloVulkan PUBLIC $<CONFIG:Release>:NDEBUG)
|
||||||
|
target_compile_definitions(HelloVulkan PUBLIC $<CONFIG:Debug>:DEBUG)
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
project "HelloVulkan"
|
|
||||||
files {
|
|
||||||
"**.cpp",
|
|
||||||
"**.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
60
premake5.lua
60
premake5.lua
@@ -1,60 +0,0 @@
|
|||||||
require "../export-compile-commands"
|
|
||||||
|
|
||||||
workspace "LearnVulkan"
|
|
||||||
kind "ConsoleApp"
|
|
||||||
language "C++"
|
|
||||||
cppdialect "C++17"
|
|
||||||
architecture "x64"
|
|
||||||
targetdir "%{prj.location}/bin/%{cfg.buildcfg}"
|
|
||||||
|
|
||||||
configurations { "Debug", "Release" }
|
|
||||||
|
|
||||||
|
|
||||||
filter "configurations:Debug"
|
|
||||||
defines { "DEBUG" }
|
|
||||||
symbols "On"
|
|
||||||
|
|
||||||
filter "configurations:Release"
|
|
||||||
defines { "NDEBUG" }
|
|
||||||
optimize "On"
|
|
||||||
|
|
||||||
filter "system:windows"
|
|
||||||
linkoptions {
|
|
||||||
"-nodefaultlibs"
|
|
||||||
}
|
|
||||||
libdirs {
|
|
||||||
"C:/VulkanSDK/1.4.304.1/Lib",
|
|
||||||
"libs/GLFW",
|
|
||||||
}
|
|
||||||
includedirs {
|
|
||||||
"C:/VulkanSDK/1.4.304.1/Include",
|
|
||||||
"libs"
|
|
||||||
}
|
|
||||||
|
|
||||||
links {
|
|
||||||
"msvcrt",
|
|
||||||
"user32",
|
|
||||||
"kernel32",
|
|
||||||
"libcmt",
|
|
||||||
"gdi32",
|
|
||||||
"glu32",
|
|
||||||
"shell32",
|
|
||||||
"opengl32",
|
|
||||||
"glfw3",
|
|
||||||
"vulkan-1"
|
|
||||||
}
|
|
||||||
|
|
||||||
filter "system:linux"
|
|
||||||
links {
|
|
||||||
"glfw3",
|
|
||||||
"vulkan",
|
|
||||||
"dl",
|
|
||||||
"pthread",
|
|
||||||
"X11",
|
|
||||||
"Xxf86vm",
|
|
||||||
"Xrandr",
|
|
||||||
"Xi"
|
|
||||||
}
|
|
||||||
|
|
||||||
include("HelloVulkan/premake5.lua")
|
|
||||||
include("HelloTriangle/premake5.lua")
|
|
||||||
Reference in New Issue
Block a user