From ccb49b506d433b71d693d30db4ed5836148cab25 Mon Sep 17 00:00:00 2001 From: Robert Walton Date: Tue, 11 May 2021 12:44:05 +0100 Subject: [PATCH] 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. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 63c80e8570..68c48add1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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()