-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f2d733b
commit ff1c77b
Showing
8 changed files
with
112 additions
and
37 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[requires] | ||
spdlog/1.9.0 | ||
spdlog/1.14.1 | ||
|
||
[generators] | ||
cmake | ||
CMakeDeps | ||
CMakeToolchain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"version": 4, | ||
"vendor": { | ||
"conan": {} | ||
}, | ||
"include": [ | ||
"build/CMakePresets.json" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#项目编译环境 | ||
cmake_minimum_required (VERSION 3.17) | ||
# 确保可以描述项目 | ||
if (POLICY CMP0048) | ||
cmake_policy(SET CMP0048 NEW) | ||
endif (POLICY CMP0048) | ||
|
||
project (helloworld_with_log | ||
VERSION 0.0.0 | ||
DESCRIPTION "简单测试" | ||
LANGUAGES CXX | ||
) | ||
# 引入conan维护的依赖 | ||
message(NOTICE "引入conan维护的依赖") | ||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup() | ||
|
||
option(AS_STATIC "是否作为纯静态可执行文件编译" off) | ||
# 构造可执行文件的配置 | ||
add_executable(${PROJECT_NAME}) | ||
## 设置源码位置 | ||
target_sources(${PROJECT_NAME} | ||
PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/helloworld.cc | ||
) | ||
target_link_libraries(${PROJECT_NAME} | ||
${CONAN_LIBS} | ||
) | ||
if(AS_STATIC) | ||
message("编译纯静态可执行文件") | ||
target_compile_options(${PROJECT_NAME} | ||
PRIVATE "-static" | ||
) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[requires] | ||
spdlog/1.9.0 | ||
spdlog/1.14.1 | ||
|
||
[generators] | ||
cmake | ||
CMakeDeps | ||
CMakeToolchain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters