Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wyhs hw01 #114

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 .)
```

14 changes: 13 additions & 1 deletion stbiw/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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 .)