Auto submodule update: cmake - Fix compiler errors from check third-party dependency on Windows (#188)#1514
Merged
martin4861 merged 1 commit intomasterfrom Oct 15, 2025
Conversation
# Issue The check unit testing framework (used as a third-party dependency) emits compiler diagnostics that break the build on Windows platforms, even though it's configured as an external dependency with `SYSTEM_INCLUDES`. Specific error: ``` D:\a\libsbp\libsbp\c\third_party\check\lib\timer_delete.c:48:5: error: implicit declaration of function 'alarm' [-Wimplicit-function-declaration] ``` # Root Cause The check library has platform compatibility issues on Windows: 1. Missing POSIX functions: Windows lacks POSIX functions like alarm(), setitimer(), and proper timer support 2. Incomplete fallback detection: While check includes compatibility shims (e.g., alarm.c), the file timer_delete.c calls alarm() directly without proper header inclusion or declaration checking 3. SYSTEM_INCLUDES limitation: The SYSTEM_INCLUDES flag in CMake only suppresses warnings from headers consumed via target_include_directories(). However, check adds its compatibility source files (including timer_delete.c) directly to the target via target_sources(), so these files are compiled as part of the target itself and inherit all parent compile flags including -Werror Note: The check project has been unmaintained for over 4 years (last release: 0.15.2 in 2020), making an upstream fix unlikely. # Solution Modified cmake/common/FindCheck.cmake to temporarily adjust CMAKE_C_FLAGS during the check library's configuration and compilation: 1. Save original flags before including the dependency 2. Apply platform-specific suppressions: - MinGW/GCC: Remove -Werror and add -Wno-error=implicit-function-declaration - MSVC: Remove /WX and add /wd4013 (disables C4013: implicit function declaration) 3. Restore original flags immediately after the dependency is added This approach: - ✅ Doesn't modify third-party code - ✅ Only affects check library compilation - ✅ Preserves strict warnings for project code - ✅ Supports both MinGW and MSVC toolchains Triggered-By: cmake d5558e3ad3c2cdabfb1ba31d20ea4defce570a95 Upstream-PR: http://github.com/swift-nav/cmake/pull/188
|
martin4861
approved these changes
Oct 15, 2025
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.



Automated PR by Jenkins. If CI has passed successfully, merge away!
cmake 1ab487a2 -> d5558e3a
This pull request was created by https://jenkins.ci.swift-nav.com/job/CI%20Infra/job/submodule-update/21558/.