-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear CXX flags to make test_package work
Conan's adds host side flags to the conan_toolchain.cmake file which interferes with arm-none-eabi-g++. To fix this, we set CMAKE_CXX_FLAGS to an empty string, then provide target specific flags to the executable.
- Loading branch information
Khalil Estell
committed
Oct 17, 2023
1 parent
c6bc92c
commit e7ae67e
Showing
3 changed files
with
11 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
|
||
# This is a workaround for Conan 1.x | ||
set(CMAKE_TOOLCHAIN_FILE toolchain.cmake) | ||
|
||
project(test_package LANGUAGES CXX) | ||
|
||
set(test_package_compiler_flags -mcpu=cortex-m0plus | ||
# Conan's adds host side flags to the conan_toolchain.cmake file which | ||
# interferes with arm-none-eabi-g++. To fix this, we set CMAKE_CXX_FLAGS | ||
# to an empty string, then provide target specific flags to the | ||
# executable. | ||
set(CMAKE_CXX_FLAGS "") | ||
|
||
set(compiler_flags | ||
-mcpu=cortex-m0plus | ||
-mfloat-abi=soft | ||
--specs=nosys.specs | ||
--specs=nano.specs) | ||
|
||
set(CMAKE_CXX_FLAGS "") | ||
message(AUTHOR_WARNING "CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}") | ||
|
||
add_executable(${PROJECT_NAME} main.cpp) | ||
target_compile_options(${PROJECT_NAME} PRIVATE ${test_package_compiler_flags}) | ||
target_link_options(${PROJECT_NAME} PRIVATE ${test_package_compiler_flags}) | ||
target_compile_options(${PROJECT_NAME} PRIVATE ${compiler_flags}) | ||
target_link_options(${PROJECT_NAME} PRIVATE ${compiler_flags}) |
34 changes: 0 additions & 34 deletions
34
recipes/arm-gnu-toolchain/all/test_package/toolchain.cmake
This file was deleted.
Oops, something went wrong.