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.
pull/14656/head
Robert Walton 2021-05-11 12:44:05 +01:00
parent 125f58449d
commit ccb49b506d
1 changed files with 1 additions and 1 deletions

View File

@ -274,7 +274,7 @@ endfunction()
if ("${CMAKE_GENERATOR}" MATCHES "Ninja")
# known issue ARMClang and Ninja with response files for windows
# https://gitlab.kitware.com/cmake/cmake/-/issues/21093
if(NOT (CMAKE_HOST_SYSTEM_NAME MATCHES "Windows" AND CMAKE_CXX_COMPILER_ID MATCHES "ARMClang"))
if((CMAKE_HOST_SYSTEM_NAME MATCHES "Windows" AND NOT CMAKE_CXX_COMPILER_ID MATCHES "ARMClang"))
set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1 CACHE INTERNAL "")
endif()
endif()