Skip to content

CMake: ninja reponse files disabled for ARMClang on Windows #13827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# This is the boilerplate for Mbed OS

cmake_minimum_required(VERSION 3.18.2 FATAL_ERROR)
cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Travis will fail if it fetches from pip (this version not yet there unfortunately)

I can do:

        # Fetch the 3.19.0
        - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
        - mkdir ${DEPS_DIR} && cd ${DEPS_DIR}
        - travis_retry wget --no-check-certificate https://cmake.org/files/v3.19/cmake-3.19.0-rc2-Linux-x86_64.tar.gz
        - tar -xvf cmake-3.19.0-rc2-Linux-x86_64.tar.gz > /dev/null
        - mv cmake-3.19.0-rc2-Linux-x86_64 cmake-install
        - PATH=${DEPS_DIR}/cmake-install:${DEPS_DIR}/cmake-install/bin:$PATH
        - cd ${TRAVIS_BUILD_DIR}

However this would be just partial fix for now. I'll talk to test team to include 3.19.0 in the jenkins and this can wait for CI update to land


# Using relative paths behavior
if(POLICY CMP0076)
Expand Down Expand Up @@ -200,3 +200,12 @@ function(mbed_generate_executable target)
mbed_generate_bin_hex(${target})
mbed_generate_map_file(${target})
endfunction()

# Ninja requires to be forced for response files
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"))
set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1 CACHE INTERNAL "")
endif()
endif()
7 changes: 3 additions & 4 deletions tools/cmake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ Supported examples can be identified by the presence of a top level `CMakelists.

### Known issues

- 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
- Ninja: ARMClang6 response files require unix paths on Windows. Reference: https://gitlab.kitware.com/cmake/cmake/-/issues/21093
- 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.

## How to build an application

Prerequisities:
- CMake >=3.18.2
- mbed-tools >=3.2.0
- CMake >=3.19.0
- mbed-tools >=3.4.0

From the application root or wherever `mbed-os.lib` is found:
1. Run the following command to create the Mbed OS configuration CMake module:
Expand Down
6 changes: 0 additions & 6 deletions tools/cmake/toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,3 @@ set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1)
set(CMAKE_ASM_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
set(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES 1)

# Ninja requires to be forced for response files
if ("${CMAKE_GENERATOR}" MATCHES "Ninja")
set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1 CACHE INTERNAL "")
endif()