-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
CMake 3.19 doesn't work with Zephyr (tracking issue w/upstream CMake) #30232
Comments
This issue is really to track the issue w/upstream CMake and convey status of what's going on. Here's the CMake issue: |
Note, its possible you get into a weird state with the Zephyr cmake cache and best to possibly remove it:
|
setup workaround for Ubuntu, just as an example: $ wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add -
$ sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
$ sudo apt update
$ sudo apt install cmake-data=3.18.4-0kitware1 cmake=3.18.4-0kitware1 |
Quick-and-dirty workaround for MacOS + Ignore all the $ export FIX_CMAKE_VERSION=3.18.4
$ brew tap-new $USER/homebrew-repo
$ brew extract --version $FIX_CMAKE_VERSION cmake $USER/homebrew-repo
$ brew unlink cmake
$ brew install cmake@$FIX_CMAKE_VERSION |
Cmake is available as a pip package, which is already mentioned in the getting started docs. Would it make sense to add cmake to the python requirements instead of having to manually install it? This would also make it easier to pin a specific cmake version as the officially supported version. |
We did consider that, but it was ultimately decided that this was not a good idea because many people choose to use the CMake that comes with their distribution instead, and by putting it in the requirements we'd effectively be asking users to have 2 copies of CMake. |
Workaround posted: #30272 |
Fixes: zephyrproject-rtos#30232 This is a workaround for zephyrproject-rtos#30232. During Zephyr CMake invocation a plain C compiler is used for DTS. This results in the internal `CheckCompilerFlag.cmake` being included by CMake Later, when the full toolchain is configured, then `CMakeCheckCompilerFlag.cmake` is included. This overloads the `cmake_check_compiler_flag()` function, thus causing zephyrproject-rtos#30232. By manualy loading `CMakeCheckCompilerFlag.cmake` then `CheckCompilerFlag.cmake` will overload the functions (and thus win the battle), and because `include_guard(GLOBAL)` is used in `CMakeCheckCompilerFlag.cmake` this file will not be re-included later. It also prints a warning informing the user of the issue. Signed-off-by: Torsten Rasmussen <[email protected]>
Fixes: #30232 This is a workaround for #30232. During Zephyr CMake invocation a plain C compiler is used for DTS. This results in the internal `CheckCompilerFlag.cmake` being included by CMake Later, when the full toolchain is configured, then `CMakeCheckCompilerFlag.cmake` is included. This overloads the `cmake_check_compiler_flag()` function, thus causing #30232. By manualy loading `CMakeCheckCompilerFlag.cmake` then `CheckCompilerFlag.cmake` will overload the functions (and thus win the battle), and because `include_guard(GLOBAL)` is used in `CMakeCheckCompilerFlag.cmake` this file will not be re-included later. It also prints a warning informing the user of the issue. Signed-off-by: Torsten Rasmussen <[email protected]>
Fixes: zephyrproject-rtos#30232 This is a workaround for zephyrproject-rtos#30232. During Zephyr CMake invocation a plain C compiler is used for DTS. This results in the internal `CheckCompilerFlag.cmake` being included by CMake Later, when the full toolchain is configured, then `CMakeCheckCompilerFlag.cmake` is included. This overloads the `cmake_check_compiler_flag()` function, thus causing zephyrproject-rtos#30232. By manualy loading `CMakeCheckCompilerFlag.cmake` then `CheckCompilerFlag.cmake` will overload the functions (and thus win the battle), and because `include_guard(GLOBAL)` is used in `CMakeCheckCompilerFlag.cmake` this file will not be re-included later. It also prints a warning informing the user of the issue. Signed-off-by: Torsten Rasmussen <[email protected]>
Fixes: zephyrproject-rtos#30232 This is a workaround for zephyrproject-rtos#30232. During Zephyr CMake invocation a plain C compiler is used for DTS. This results in the internal `CheckCompilerFlag.cmake` being included by CMake Later, when the full toolchain is configured, then `CMakeCheckCompilerFlag.cmake` is included. This overloads the `cmake_check_compiler_flag()` function, thus causing zephyrproject-rtos#30232. By manualy loading `CMakeCheckCompilerFlag.cmake` then `CheckCompilerFlag.cmake` will overload the functions (and thus win the battle), and because `include_guard(GLOBAL)` is used in `CMakeCheckCompilerFlag.cmake` this file will not be re-included later. It also prints a warning informing the user of the issue. Signed-off-by: Torsten Rasmussen <[email protected]>
Fixes: zephyrproject-rtos#30232 This is a workaround for zephyrproject-rtos#30232. During Zephyr CMake invocation a plain C compiler is used for DTS. This results in the internal `CheckCompilerFlag.cmake` being included by CMake Later, when the full toolchain is configured, then `CMakeCheckCompilerFlag.cmake` is included. This overloads the `cmake_check_compiler_flag()` function, thus causing zephyrproject-rtos#30232. By manualy loading `CMakeCheckCompilerFlag.cmake` then `CheckCompilerFlag.cmake` will overload the functions (and thus win the battle), and because `include_guard(GLOBAL)` is used in `CMakeCheckCompilerFlag.cmake` this file will not be re-included later. It also prints a warning informing the user of the issue. Signed-off-by: Torsten Rasmussen <[email protected]>
Fixes: zephyrproject-rtos#30232 This is a workaround for zephyrproject-rtos#30232. During Zephyr CMake invocation a plain C compiler is used for DTS. This results in the internal `CheckCompilerFlag.cmake` being included by CMake Later, when the full toolchain is configured, then `CMakeCheckCompilerFlag.cmake` is included. This overloads the `cmake_check_compiler_flag()` function, thus causing zephyrproject-rtos#30232. By manualy loading `CMakeCheckCompilerFlag.cmake` then `CheckCompilerFlag.cmake` will overload the functions (and thus win the battle), and because `include_guard(GLOBAL)` is used in `CMakeCheckCompilerFlag.cmake` this file will not be re-included later. It also prints a warning informing the user of the issue. Signed-off-by: Torsten Rasmussen <[email protected]>
Fixes: zephyrproject-rtos#30232 This is a workaround for zephyrproject-rtos#30232. During Zephyr CMake invocation a plain C compiler is used for DTS. This results in the internal `CheckCompilerFlag.cmake` being included by CMake Later, when the full toolchain is configured, then `CMakeCheckCompilerFlag.cmake` is included. This overloads the `cmake_check_compiler_flag()` function, thus causing zephyrproject-rtos#30232. By manualy loading `CMakeCheckCompilerFlag.cmake` then `CheckCompilerFlag.cmake` will overload the functions (and thus win the battle), and because `include_guard(GLOBAL)` is used in `CMakeCheckCompilerFlag.cmake` this file will not be re-included later. It also prints a warning informing the user of the issue. Signed-off-by: Torsten Rasmussen <[email protected]>
Fixes: zephyrproject-rtos#30232 This is a workaround for zephyrproject-rtos#30232. During Zephyr CMake invocation a plain C compiler is used for DTS. This results in the internal `CheckCompilerFlag.cmake` being included by CMake Later, when the full toolchain is configured, then `CMakeCheckCompilerFlag.cmake` is included. This overloads the `cmake_check_compiler_flag()` function, thus causing zephyrproject-rtos#30232. By manualy loading `CMakeCheckCompilerFlag.cmake` then `CheckCompilerFlag.cmake` will overload the functions (and thus win the battle), and because `include_guard(GLOBAL)` is used in `CMakeCheckCompilerFlag.cmake` this file will not be re-included later. It also prints a warning informing the user of the issue. Signed-off-by: Torsten Rasmussen <[email protected]>
In cmake 3.19
cmake_check_compiler_flag
behaves differently than previous versions and breaks Zephyr.On ARM you might see something like:
and
The text was updated successfully, but these errors were encountered: