From 15579bdf0c141349a7ee0db5bf2215a1eedd301f Mon Sep 17 00:00:00 2001 From: Chun-Chieh Li Date: Fri, 11 Feb 2022 17:24:20 +0800 Subject: [PATCH] CMake: Fix command line too long with Ninja/ARMClang on Windows The issue is reported in: https://github.com/ARMmbed/mbed-os/issues/14533 And relies on bugfix in newer cmake version: https://gitlab.kitware.com/cmake/cmake/-/issues/21093 --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9536ccf0f3..b3fab59fc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -195,7 +195,9 @@ endif() if ("${CMAKE_GENERATOR}" MATCHES "Ninja") # known issue ARMClang and Ninja with response files for windows # https://gitlab.kitware.com/cmake/cmake/-/issues/21093 - if((CMAKE_HOST_SYSTEM_NAME MATCHES "Windows" AND NOT CMAKE_CXX_COMPILER_ID MATCHES "ARMClang")) + # This gets fixed in newer cmake version + # https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6484 + if((CMAKE_HOST_SYSTEM_NAME MATCHES "Windows") AND ((${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.22.0") OR (NOT CMAKE_CXX_COMPILER_ID MATCHES "ARMClang"))) set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1 CACHE INTERNAL "") endif() endif()