Skip to content

Commit 61e9b7e

Browse files
authored
Merge pull request #13827 from 0xc0170/feature-cmake-fix-ninja-armclang
CMake: ninja reponse files disabled for ARMClang on Windows
2 parents 014dbce + 79329c5 commit 61e9b7e

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# This is the boilerplate for Mbed OS
55

6-
cmake_minimum_required(VERSION 3.18.2 FATAL_ERROR)
6+
cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)
77

88
# Using relative paths behavior
99
if(POLICY CMP0076)
@@ -200,3 +200,12 @@ function(mbed_generate_executable target)
200200
mbed_generate_bin_hex(${target})
201201
mbed_generate_map_file(${target})
202202
endfunction()
203+
204+
# Ninja requires to be forced for response files
205+
if ("${CMAKE_GENERATOR}" MATCHES "Ninja")
206+
# known issue ARMClang and Ninja with response files for windows
207+
# https://gitlab.kitware.com/cmake/cmake/-/issues/21093
208+
if(NOT (CMAKE_HOST_SYSTEM_NAME MATCHES "Windows" AND CMAKE_CXX_COMPILER_ID MATCHES "ARMClang"))
209+
set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1 CACHE INTERNAL "")
210+
endif()
211+
endif()

tools/cmake/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,13 @@ Supported examples can be identified by the presence of a top level `CMakelists.
3737

3838
### Known issues
3939

40-
- ARMClang6: the assembler does not include definitions. It will be fixed in the upcoming release (>3.18.2). Reference: https://gitlab.kitware.com/cmake/cmake/-/issues/21148#note_823305
41-
- Ninja: ARMClang6 response files require unix paths on Windows. Reference: https://gitlab.kitware.com/cmake/cmake/-/issues/21093
40+
- Ninja: ARMClang6 response files require unix paths on Windows. Reference: https://gitlab.kitware.com/cmake/cmake/-/issues/21093. We disabled response files for Ninja on Windows until CMake is fixed.
4241

4342
## How to build an application
4443

4544
Prerequisities:
46-
- CMake >=3.18.2
47-
- mbed-tools >=3.2.0
45+
- CMake >=3.19.0
46+
- mbed-tools >=3.4.0
4847

4948
From the application root or wherever `mbed-os.lib` is found:
5049
1. Run the following command to create the Mbed OS configuration CMake module:

tools/cmake/toolchain.cmake

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,3 @@ set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1)
8989
set(CMAKE_ASM_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
9090
set(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
9191
set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
92-
93-
# Ninja requires to be forced for response files
94-
if ("${CMAKE_GENERATOR}" MATCHES "Ninja")
95-
set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1 CACHE INTERNAL "")
96-
endif()
97-

0 commit comments

Comments
 (0)