初始化仓库

This commit is contained in:
2026-08-26 14:01:35 +08:00
commit b5bd7fa1f5
6 changed files with 53 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
.idea/
.vs/
cmake-build*/
out/
+6
View File
@@ -0,0 +1,6 @@
[submodule "Libraries/glm"]
path = Libraries/glm
url = https://github.com/g-truc/glm
[submodule "Libraries/glfw"]
path = Libraries/glfw
url = https://github.com/glfw/glfw
+31
View File
@@ -0,0 +1,31 @@
cmake_minimum_required(VERSION 4.3)
project(VulkanTutorial)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
file(GLOB SOURCE_CODE ./src/*.cpp)
add_executable(${PROJECT_NAME}
${SOURCE_CODE}
)
# 1. 查找 Vulkan
find_package(Vulkan REQUIRED)
if(NOT Vulkan_FOUND)
message(FATAL_ERROR "Vulkan not found!")
endif()
# 设置 GLFW 不构建示例和文档,加快编译
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
add_subdirectory(Libraries/glfw) # GLFW
add_subdirectory(Libraries/glm) # GLM
# 链接依赖
target_link_libraries(${PROJECT_NAME}
PRIVATE
glfw # glfw 的 target 名称(由 add_subdirectory 提供)
Vulkan::Vulkan # 来自 find_package(Vulkan)
)
+1
Submodule Libraries/glfw added at 92dcf4ce74
Submodule
+1
Submodule Libraries/glm added at 6f14f4792a
+9
View File
@@ -0,0 +1,9 @@
//
// Created by atdunbg on 2026/8/25.
//
#include <iostream>
int main(int argc, char** argv) {
std::cout << "Hello World!" << std::endl;
}