添加exe文件图标
This commit is contained in:
+17
-2
@@ -28,8 +28,8 @@ find_package(glm REQUIRED)
|
|||||||
find_package(nlohmann_json REQUIRED)
|
find_package(nlohmann_json REQUIRED)
|
||||||
find_package(spdlog REQUIRED)
|
find_package(spdlog REQUIRED)
|
||||||
|
|
||||||
# 添加可执行文件
|
# 设置通用源文件
|
||||||
add_executable(${TARGET}
|
set(SOURCES
|
||||||
src/main.cpp
|
src/main.cpp
|
||||||
src/engine/audio/audio_player.cpp
|
src/engine/audio/audio_player.cpp
|
||||||
src/engine/core/game_app.cpp
|
src/engine/core/game_app.cpp
|
||||||
@@ -92,6 +92,16 @@ add_executable(${TARGET}
|
|||||||
src/game/data/session_data.cpp
|
src/game/data/session_data.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# 根据平台向"通用源文件"追加平台专属的文件
|
||||||
|
if(WIN32)
|
||||||
|
# 如果是 Windows 平台, 将资源文件追加到源文件列表
|
||||||
|
list(APPEND SOURCES resources.rc)
|
||||||
|
endif()
|
||||||
|
# TODO: MacOS 和 Linux 平台
|
||||||
|
|
||||||
|
# 添加可执行文件, 使用配置好的 "SOURCES" 变量
|
||||||
|
add_executable(${TARGET} ${SOURCES})
|
||||||
|
|
||||||
# 链接库
|
# 链接库
|
||||||
target_link_libraries(${TARGET}
|
target_link_libraries(${TARGET}
|
||||||
${SDL3_LIBRARIES}
|
${SDL3_LIBRARIES}
|
||||||
@@ -102,3 +112,8 @@ target_link_libraries(${TARGET}
|
|||||||
nlohmann_json::nlohmann_json
|
nlohmann_json::nlohmann_json
|
||||||
spdlog::spdlog
|
spdlog::spdlog
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# 不要弹出控制台窗口
|
||||||
|
if (MSVC)
|
||||||
|
target_link_options(${TARGET} PRIVATE "/SUBSYSTEM:WINDOWS")
|
||||||
|
endif()
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
// MAINICON:是你给这个图标资源起的一个名字(ID),可以随意命名,但通常用大写。
|
||||||
|
// ICON:指定资源类型是图标。
|
||||||
|
// "icon.ico":你的图标文件名。如果 .rc 文件和 .ico 文件在同一目录,直接写文件名即可。
|
||||||
|
|
||||||
|
MAINICON ICON "icon.ico"
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
#include "engine/scene/scene_manager.h"
|
#include "engine/scene/scene_manager.h"
|
||||||
#include "game/scene/title_scene.h"
|
#include "game/scene/title_scene.h"
|
||||||
#include <spdlog/spdlog.h>
|
#include <spdlog/spdlog.h>
|
||||||
|
#include <SDL3/SDL_main.h>
|
||||||
|
|
||||||
void setupInitialScene(engine::scene::SceneManager& scene_manager) {
|
void setupInitialScene(engine::scene::SceneManager& scene_manager) {
|
||||||
// GameApp在调用run方法之前,先创建并设置初始场景
|
// GameApp在调用run方法之前,先创建并设置初始场景
|
||||||
|
|||||||
Reference in New Issue
Block a user