Skip to content

Fix release build by guarding add_subdirectory(test)#1323

Merged
archigup merged 1 commit intoFreeRTOS:mainfrom
archigup:fix/cmake-guard-test-subdir
Mar 2, 2026
Merged

Fix release build by guarding add_subdirectory(test)#1323
archigup merged 1 commit intoFreeRTOS:mainfrom
archigup:fix/cmake-guard-test-subdir

Conversation

@archigup
Copy link
Member

Problem

The release workflow fails because the FreeRTOS/CI-CD-Github-Actions/release action removes the test/ directory from the archive before running the build command (rm -rf "$ARCHIVE_DIR/test"). Since CMakeLists.txt unconditionally calls add_subdirectory(test), CMake fails with:

add_subdirectory given source "test" which is not an existing directory.

Fix

Guard add_subdirectory(test) with IS_DIRECTORY so the build succeeds when test/ is absent. No behavior change when the directory is present.

The release workflow removes the test/ directory from the archive
before running the build command. The unconditional
add_subdirectory(test) in CMakeLists.txt causes CMake to fail with:

  add_subdirectory given source "test" which is not an existing directory.

Guard it with IS_DIRECTORY so the build succeeds when test/ is absent.
@archigup archigup merged commit ac9414d into FreeRTOS:main Mar 2, 2026
10 checks passed
@archigup archigup deleted the fix/cmake-guard-test-subdir branch March 2, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants