fix(tests): link glm into test_chat_types - #108
Merged
Conversation
Summary: - Add the glm::glm-header-only / glm::glm link block to the test_chat_types target, matching the pattern already used by test_hill_climbing, test_spline, and test_taxi_packets. Rationale: - test_chat_types.cpp includes game/world_packets.hpp, which pulls in game/entity.hpp, which includes math/spline.hpp and therefore <glm/glm.hpp>. The target linked only catch2_main, so it never received glm's include path. - glm is not vendored. It comes from find_package(glm) and its headers arrive with the imported target rather than through TEST_INCLUDE_DIRS or TEST_SYSTEM_INCLUDE_DIRS, as the comment above test_hill_climbing already records. - On Linux libglm-dev installs into /usr/include, so the target compiles regardless. On macOS glm lives under the Homebrew prefix, which the compiler does not search by default, and the build fails with "'glm/glm.hpp' file not found". CI only covers ubuntu-24.04 and ubuntu-24.04-arm, so the platform that reports this is not built on pull requests. - test_taxi_packets, added in the same commit, already carries the block. test_chat_types was the only target missing it: the other test targets that compile without glm's include path do not reach entity.hpp. Tests: - cmake --build build --parallel 12 (exit 0, full project) - ctest --test-dir build (55/55 passed)
Kelsidavis
added a commit
that referenced
this pull request
Aug 5, 2026
macOS CI has been failing on test_chat_types for want of glm's include path. #108 fixed that target, and it was the thirtieth copy of the same four-line block — added because CI broke, which is how the twenty-nine before it were added too. glm is not vendored: it comes from find_package and its include path arrives with the imported target rather than through any directory the tests file lists. A test that reaches <glm/glm.hpp> through a chain of headers and does not name glm compiles anyway on Linux, where there is a system copy under /usr/include, and fails on macOS, where there is not. So every one of these was found the same way — by breaking one platform's CI — and the next header that starts including spline.hpp would have found the thirty-first. One PUBLIC link on catch2_main instead. Every one of the 55 test targets links catch2_main, checked rather than assumed, so all of them get the include path transitively and a new test cannot be written without it. It also fixes a fault none of them had hit yet: twenty-six of the thirty checked only glm::glm, with no branch for the glm::glm-header-only target GLM 1.0 exposes when it builds glm::glm as a real library. On such a system those tests would have failed exactly the way macOS is failing now.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the glm link block to the
test_chat_typestarget intests/CMakeLists.txt, matching the pattern already used bytest_hill_climbing,test_spline,test_transport_path_repo, andtest_taxi_packets.Why
test_chat_typesdoes not build on macOS. It fails at the preprocessor:The include chain is
test_chat_types.cpptogame/world_packets.hpptogame/entity.hpp:16tomath/spline.hpp:5to<glm/glm.hpp>. The target linked onlycatch2_main, so it never received glm's include path.glm is not vendored in
extern/. It comes fromfind_package(glm), and its include directory arrives with the imported target rather than throughTEST_INCLUDE_DIRSorTEST_SYSTEM_INCLUDE_DIRS. The comment abovetest_hill_climbingattests/CMakeLists.txt:50already records this, from the previous time it bit:test_taxi_packets, added in the same commit astest_chat_types(3ed9330), already carries the block.test_chat_typeswas the one that missed it.Why CI did not catch it
.github/workflows/build.ymlruns onubuntu-24.04andubuntu-24.04-armonly. There,libglm-devinstalls the headers into/usr/include, which the compiler searches by default, so the missing link target makes no difference and the build is green. macOS puts glm under the Homebrew prefix, which is not on the default search path, so it is the only platform that reports the error. macOS appears inrelease.yml(macos-15), which runs on release rather than on pull requests.This is a build-configuration bug with a platform-dependent symptom, not a behaviour change. The compiled test itself is untouched.
Scope
I audited the rest of the test suite rather than fixing only the reported failure. Running each target's exact compile line from
compile_commands.jsonwith-fsyntax-only: of 55 test translation units, 27 build without glm's include path, and all 27 are clean. None of them reachentity.hpp, sotest_chat_typeswas the only affected target.The three other targets added recently (
test_equipment_set_packets,test_achievement_criteria,test_packed_time) include onlynetwork/packet.hpp,game/achievement_criteria.hpp, andgame/packed_time.hpprespectively, and are correct as they stand. I left them alone rather than adding a block they do not currently need.Effect on Linux
None. On Linux,
glm::glm(orglm::glm-header-only) resolves to the same headers already found via/usr/include, and theif(TARGET ...)guard makes the block a no-op where neither imported target exists.Verification
cmake --build build --parallel 12exits 0 on macOS 15 (arm64, Homebrew glm 1.0), andctestreports 55 of 55 tests passing, includingchat_types.Possible follow-up, not included here
Adding a
macos-15job to thebuild.ymlmatrix would let CI catch this class of error on pull requests instead of at release time or on a contributor's machine. That is a separate change and I have kept it out of this PR.