diff --git a/README.md b/README.md index accbceb..a7b34c3 100644 --- a/README.md +++ b/README.md @@ -43,3 +43,36 @@ target_compile_definitions(stbiw PUBLIC -DSTB_IMAGE_WRITE_IMPLEMENTATION) ``` 是不行的,因为 mandel.cpp 和 rainbow.cpp 两个文件都 include 了 stb_image_write.h, 这样同一个函数会被定义两遍! + + + +2023/3/6 + +提交pr的方式: + +```powershell +# 先进行修改 +git push - a +# 在文件内下面添加 Modified README.md +git checkout -b [分支名] +git push origin [分支名] +# 打开remote中的网址 https://github.com/WangYuHang-cmd/xxx/pull/new/xxx +``` + + + +```cmake +# add_library(stbiw STATIC stbiw) +# target_include_directories(stbiw PUBLIC .) +``` + + + +我的方案: + +```cmake +aux_source_directory(NEEDED DIR_STBIW) +add_library(stbiw STATIC ${DIR_STBIW}) +target_include_directories(stbiw PUBLIC .) +``` + diff --git a/stbiw/CMakeLists.txt b/stbiw/CMakeLists.txt index b56b853..19a80de 100644 --- a/stbiw/CMakeLists.txt +++ b/stbiw/CMakeLists.txt @@ -1 +1,13 @@ -message(FATAL_ERROR "请修改 stbiw/CMakeLists.txt!要求生成一个名为 stbiw 的库") +# message(FATAL_ERROR "请修改 stbiw/CMakeLists.txt!要求生成一个名为 stbiw 的库") +cmake_minimum_required(VERSION 3.10) + +set(CMAKE_C_COMPILER "gcc") +set(CMAKE_CXX_COMPILER "g++") + + +aux_source_directory(NEEDED DIR_STBIW) +add_library(stbiw STATIC ${DIR_STBIW}) +target_include_directories(stbiw PUBLIC .) + + +