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
pull/15223/head
Chun-Chieh Li 2022-02-11 17:24:20 +08:00
parent c6d814e68c
commit 15579bdf0c
1 changed files with 3 additions and 1 deletions

View File

@ -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()