Skip to content

Commit ac9414d

Browse files
committed
Fix release build by guarding add_subdirectory(test)
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.
1 parent 7119511 commit ac9414d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ FetchContent_Declare( cmock
171171

172172
add_subdirectory(source)
173173
add_subdirectory(tools)
174-
add_subdirectory(test)
174+
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test")
175+
add_subdirectory(test)
176+
endif()
175177

176178
if(STANDALONE_TEST_BUILD_UNIX)
177179
add_library(freertos_config INTERFACE)

0 commit comments

Comments
 (0)