Skip to content

Commit 0cdc9ac

Browse files
Merge pull request #192 from forefireAPI/build/vendor-stb-image-write
Record what stb_image_write.h is and where it came from
2 parents 7467f40 + d3c9703 commit 0cdc9ac

4 files changed

Lines changed: 27 additions & 4 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,11 @@ endif()
300300
target_include_directories(forefireL PUBLIC
301301
"${CMAKE_CURRENT_SOURCE_DIR}/src"
302302
"${CMAKE_CURRENT_SOURCE_DIR}/src/include")
303+
# SYSTEM and PRIVATE: vendored headers are ours to use but not ours to fix, so
304+
# the warning flags below must not apply to them, and nothing outside this
305+
# library includes them.
306+
target_include_directories(forefireL SYSTEM PRIVATE
307+
"${CMAKE_CURRENT_SOURCE_DIR}/third_party")
303308
# Threads is explicit because a static core does not drag libpthread in for
304309
# its consumers the way the shared library does.
305310
find_package(Threads REQUIRED)

‎tests/unit/CMakeLists.txt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ add_executable(forefire_unit_tests
1616

1717
target_link_libraries(forefire_unit_tests PRIVATE forefireL)
1818
target_include_directories(forefire_unit_tests PRIVATE
19-
"${CMAKE_CURRENT_SOURCE_DIR}"
19+
"${CMAKE_CURRENT_SOURCE_DIR}")
20+
# SYSTEM, so the warning flags below stop at code this project maintains.
21+
target_include_directories(forefire_unit_tests SYSTEM PRIVATE
2022
"${PROJECT_SOURCE_DIR}/third_party")
2123

2224
if(_ff_warning_flags)

‎third_party/README.md‎

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@
33
Dependencies that are checked in rather than fetched, so that a build and a CI
44
run need no network access beyond cloning the repository.
55

6-
Nothing here is compiled into `libforefireL`: `CMakeLists.txt` globs `src/*.cpp`
7-
only, and this directory is on the include path of the test target alone.
6+
Nothing here is compiled on its own: `CMakeLists.txt` globs `src/*.cpp` only.
7+
These are headers, included by whichever target needs them. Both `libforefireL`
8+
and the test target have this directory on their include path, in both cases as
9+
a `SYSTEM` include, so the project's `-Wall -Wextra` does not report code we do
10+
not maintain.
811

9-
| Directory | Version | License |
12+
| File or directory | Version | License |
1013
| --- | --- | --- |
1114
| `doctest/` | 2.5.3 (2026-07-06) | MIT |
15+
| `stb_image_write.h` | 1.16 | public domain / MIT |
1216

1317
## doctest
1418

@@ -22,3 +26,15 @@ it still builds under the project's `CMAKE_CXX_STANDARD 11`.
2226
To update it, replace the file with a newer tagged release and run
2327
`ctest --test-dir build`. Nothing in `tests/unit/` uses anything beyond
2428
`TEST_SUITE`, `TEST_CASE`, `CHECK`, `REQUIRE`, `CAPTURE` and `doctest::Approx`.
29+
30+
## stb_image_write
31+
32+
Writes the PNG output of the `plot` command. Taken unmodified from
33+
<https://github.com/nothings/stb/blob/master/stb_image_write.h>, v1.16.
34+
35+
Header-only, and header-only in the awkward sense: the implementation is
36+
compiled in wherever `STB_IMAGE_WRITE_IMPLEMENTATION` is defined before the
37+
include, which `src/Command.cpp` does and nothing else may.
38+
39+
To update it, replace the file with a newer release and rebuild. ForeFire uses
40+
`stbi_write_png` only.

0 commit comments

Comments
 (0)