Skip to content

Commit ccb49b5

Browse files
committed
CMake: Only force Ninja response files on Windows
We force Ninja to create response files to work around file path length limitations on Windows. Previously we were forcing the response file generation for all platforms, unless we were building on Windows using ARMClang, this was to work around a CMake issue https://gitlab.kitware.com/cmake/cmake/-/issues/21093 Unfortunately `ar` on macOS doesn't support Ninja response files. So the check was incorrect, as forcing a response file to be generated on macOS causes a build failure when trying to build Mbed's unit tests. This PR changes the logic so we only generate a response file on Windows systems if we're not building with ARMClang.
1 parent 125f584 commit ccb49b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ endfunction()
274274
if ("${CMAKE_GENERATOR}" MATCHES "Ninja")
275275
# known issue ARMClang and Ninja with response files for windows
276276
# https://gitlab.kitware.com/cmake/cmake/-/issues/21093
277-
if(NOT (CMAKE_HOST_SYSTEM_NAME MATCHES "Windows" AND CMAKE_CXX_COMPILER_ID MATCHES "ARMClang"))
277+
if((CMAKE_HOST_SYSTEM_NAME MATCHES "Windows" AND NOT CMAKE_CXX_COMPILER_ID MATCHES "ARMClang"))
278278
set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1 CACHE INTERNAL "")
279279
endif()
280280
endif()

0 commit comments

Comments
 (0)