From 853c87973a1833c1a5e064224c8c1f6925a77ef2 Mon Sep 17 00:00:00 2001 From: VVVVictorJ <956951190@qq.com> Date: Tue, 3 May 2022 09:20:28 -0400 Subject: [PATCH] done --- CMakeLists.txt | 2 +- stbiw/CMakeLists.txt | 4 +++- stbiw/use.cpp | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 stbiw/use.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 887bb43..d445259 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,6 @@ if (NOT CMAKE_BUILD_TYPE) endif() add_subdirectory(stbiw) - add_executable(main main.cpp rainbow.cpp mandel.cpp) target_link_libraries(main PUBLIC stbiw) +target_include_directories(main PUBLIC stbiw) diff --git a/stbiw/CMakeLists.txt b/stbiw/CMakeLists.txt index b56b853..cddae32 100644 --- a/stbiw/CMakeLists.txt +++ b/stbiw/CMakeLists.txt @@ -1 +1,3 @@ -message(FATAL_ERROR "请修改 stbiw/CMakeLists.txt!要求生成一个名为 stbiw 的库") +add_library(stbiw STATIC use.cpp) +set_target_properties(stbiw PROPERTIES LINKER_LANGUAGE CXX) +target_include_directories(stbiw PUBLIC .) diff --git a/stbiw/use.cpp b/stbiw/use.cpp new file mode 100644 index 0000000..f25fa1b --- /dev/null +++ b/stbiw/use.cpp @@ -0,0 +1,2 @@ +#define STB_IMAGE_WRITE_IMPLEMENTATION +#include