Skip to content
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
8 changes: 7 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ jobs:

- name: 📦 Create Conan Package
working-directory: all
if: ${{ runner.os != 'Windows' }}
run: VERBOSE=1 conan create . --version=${{ inputs.version }}

- name: 📦 Create Conan Package
working-directory: all
if: ${{ runner.os == 'Windows' }}
run: conan create . --version=${{ inputs.version }}

- name: 📦 Build Demos Conan Package
Expand Down Expand Up @@ -69,6 +75,6 @@ jobs:
run: conan remote login -p $env:PASSWORD libhal $env:JFROG_USER

- name: 🆙 Upload package to `libhal` repo
if: ${{ github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-22.04' }}
if: ${{ github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest' }}
run: |
conan upload "arm-gnu-toolchain/*" --only-recipe --confirm -r=libhal
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ flag `-fdata-sections` to C and CXX arguments.
### `gc_sections` (Default: `True`)

This option can be `True` or `False` and when set to `True` will inject the
flag `-gc_sections` to the linker arguments.
flag `--gc_sections` to the linker arguments.

## ✨ Adding New Versions of GCC

Expand Down
2 changes: 1 addition & 1 deletion all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def inject_c_cxx_and_link_flags(self):
exelinkflags.append("--specs=nosys.specs")

if self.options.gc_sections:
exelinkflags.append("-gc-sections")
exelinkflags.append("-Wl,--gc-sections")

ARCH_MAP = {
"cortex-m0": ["-mcpu=cortex-m0", "-mfloat-abi=soft"],
Expand Down
6 changes: 5 additions & 1 deletion all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@ set(CMAKE_TOOLCHAIN_FILE ../toolchain.cmake)
project(test_package LANGUAGES CXX)

add_executable(test_package main.cpp)

# These are added here because conan will not propagate this information to
# test packages due to the build target being the host OS.
target_compile_options(test_package PRIVATE -mcpu=cortex-m0)
target_link_options(test_package PRIVATE -mcpu=cortex-m0)
target_link_options(test_package PRIVATE -mcpu=cortex-m0
--specs=nano.specs --specs=nosys.specs)
18 changes: 0 additions & 18 deletions all/toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,3 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

if(DEFINED CONAN_LIBC AND CONAN_LIBC STREQUAL "custom")
message(STATUS "Custom libc selected. No link flags injected!")
else()
message(STATUS "Default libc used!")

set(NANO_SPECS_FLAG "--specs=nano.specs")
if(NOT CMAKE_EXE_LINKER_FLAGS MATCHES ${NANO_SPECS_FLAG})
message(STATUS "Injecting linker flag ${NANO_SPECS_FLAG}")
string(APPEND CMAKE_EXE_LINKER_FLAGS " ${NANO_SPECS_FLAG}")
endif()

set(NOSYS_SPECS_FLAG "--specs=nosys.specs")
if(NOT CMAKE_EXE_LINKER_FLAGS MATCHES ${NOSYS_SPECS_FLAG})
message(STATUS "Injecting linker flag ${NOSYS_SPECS_FLAG}")
string(APPEND CMAKE_EXE_LINKER_FLAGS " ${NOSYS_SPECS_FLAG}")
endif()
endif()