Skip to content
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] fix handling of assembly files #786

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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# CMake project definitions
# ==============================================================================
cmake_minimum_required(VERSION 3.16.0)
project(ot-efr32 VERSION 1.0.0)
project(ot-efr32 VERSION 1.0.0 LANGUAGES C CXX ASM)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
Expand Down
9 changes: 1 addition & 8 deletions slc/exporter_templates/platform_library/CMakeLists.txt.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,12 @@ target_include_directories({{PROJECT_NAME}} PRIVATE
# ==============================================================================
target_sources({{PROJECT_NAME}} PRIVATE
{%- for source in NON_MBEDTLS_SOURCES %}
{%- if source.endswith('.c') or source.endswith('.cpp') or source.endswith('.h') or source.endswith('.hpp') %}
{%- if source.endswith('.c') or source.endswith('.cpp') or source.endswith('.h') or source.endswith('.hpp') or source.endswith('.s') or source.endswith('.S') %}
{{source}}
{%- endif %}
{%- endfor %}
)

{%- for source in NON_MBEDTLS_SOURCES %}
{%- if source.endswith('.s') or source.endswith('.S') %}
target_sources({{PROJECT_NAME}} PRIVATE {{source}})
set_property(SOURCE {{source}} PROPERTY LANGUAGE C)
{%- endif %}
{%- endfor %}

# ==============================================================================
# Compile definitions
# ==============================================================================
Expand Down
51 changes: 0 additions & 51 deletions src/arm-none-eabi.cmake
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I deleted this file because it's not used anywhere

This file was deleted.

3 changes: 2 additions & 1 deletion src/efr32mg1/arm-none-eabi.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ set(CMAKE_SYSTEM_PROCESSOR ARM)

set(CMAKE_C_COMPILER arm-none-eabi-gcc)
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
set(CMAKE_ASM_COMPILER arm-none-eabi-as)
set(CMAKE_ASM_COMPILER arm-none-eabi-gcc)
set(CMAKE_RANLIB arm-none-eabi-ranlib)

execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
Expand All @@ -40,6 +40,7 @@ set(COMMON_C_FLAGS "-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-ab

set(CMAKE_C_FLAGS_INIT "${COMMON_C_FLAGS} -std=c99")
set(CMAKE_CXX_FLAGS_INIT "${COMMON_C_FLAGS} -fno-exceptions -fno-rtti")
set(CMAKE_ASM_FLAGS_INIT "${CMAKE_C_FLAGS_INIT} -x assembler-with-cpp")
set(CMAKE_EXE_LINKER_FLAGS_INIT "${COMMON_C_FLAGS} -specs=nano.specs -specs=nosys.specs")

set(CMAKE_C_FLAGS_DEBUG "-Og -g")
Expand Down
3 changes: 2 additions & 1 deletion src/efr32mg12/arm-none-eabi.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ set(CMAKE_SYSTEM_PROCESSOR ARM)

set(CMAKE_C_COMPILER arm-none-eabi-gcc)
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
set(CMAKE_ASM_COMPILER arm-none-eabi-as)
set(CMAKE_ASM_COMPILER arm-none-eabi-gcc)
set(CMAKE_RANLIB arm-none-eabi-ranlib)

execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
Expand All @@ -40,6 +40,7 @@ set(COMMON_C_FLAGS "-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-ab

set(CMAKE_C_FLAGS_INIT "${COMMON_C_FLAGS} -std=c99")
set(CMAKE_CXX_FLAGS_INIT "${COMMON_C_FLAGS} -fno-exceptions -fno-rtti")
set(CMAKE_ASM_FLAGS_INIT "${CMAKE_C_FLAGS_INIT} -x assembler-with-cpp")
set(CMAKE_EXE_LINKER_FLAGS_INIT "${COMMON_C_FLAGS} -specs=nano.specs -specs=nosys.specs")

set(CMAKE_C_FLAGS_DEBUG "-Og -g")
Expand Down
3 changes: 2 additions & 1 deletion src/efr32mg13/arm-none-eabi.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ set(CMAKE_SYSTEM_PROCESSOR ARM)

set(CMAKE_C_COMPILER arm-none-eabi-gcc)
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
set(CMAKE_ASM_COMPILER arm-none-eabi-as)
set(CMAKE_ASM_COMPILER arm-none-eabi-gcc)
set(CMAKE_RANLIB arm-none-eabi-ranlib)

execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
Expand All @@ -40,6 +40,7 @@ set(COMMON_C_FLAGS "-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-ab

set(CMAKE_C_FLAGS_INIT "${COMMON_C_FLAGS} -std=c99")
set(CMAKE_CXX_FLAGS_INIT "${COMMON_C_FLAGS} -fno-exceptions -fno-rtti")
set(CMAKE_ASM_FLAGS_INIT "${CMAKE_C_FLAGS_INIT} -x assembler-with-cpp")
set(CMAKE_EXE_LINKER_FLAGS_INIT "${COMMON_C_FLAGS} -specs=nano.specs -specs=nosys.specs")

set(CMAKE_C_FLAGS_DEBUG "-Og -g")
Expand Down
3 changes: 2 additions & 1 deletion src/efr32mg21/arm-none-eabi.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ set(CMAKE_SYSTEM_PROCESSOR ARM)

set(CMAKE_C_COMPILER arm-none-eabi-gcc)
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
set(CMAKE_ASM_COMPILER arm-none-eabi-as)
set(CMAKE_ASM_COMPILER arm-none-eabi-gcc)
set(CMAKE_RANLIB arm-none-eabi-ranlib)

execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
Expand All @@ -40,6 +40,7 @@ set(COMMON_C_FLAGS "-mcpu=cortex-m33 -mthumb -fmessage-length=0

set(CMAKE_C_FLAGS_INIT "${COMMON_C_FLAGS} -std=c99")
set(CMAKE_CXX_FLAGS_INIT "${COMMON_C_FLAGS} -fno-exceptions -fno-rtti")
set(CMAKE_ASM_FLAGS_INIT "${CMAKE_C_FLAGS_INIT} -x assembler-with-cpp")
set(CMAKE_EXE_LINKER_FLAGS_INIT "${COMMON_C_FLAGS} -specs=nano.specs -specs=nosys.specs")

set(CMAKE_C_FLAGS_DEBUG "-Og -g")
Expand Down
3 changes: 2 additions & 1 deletion src/efr32mg24/arm-none-eabi.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ set(CMAKE_SYSTEM_PROCESSOR ARM)

set(CMAKE_C_COMPILER arm-none-eabi-gcc)
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
set(CMAKE_ASM_COMPILER arm-none-eabi-as)
set(CMAKE_ASM_COMPILER arm-none-eabi-gcc)
set(CMAKE_RANLIB arm-none-eabi-ranlib)

execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
Expand All @@ -40,6 +40,7 @@ set(COMMON_C_FLAGS "-mcpu=cortex-m33 -mthumb -fmessage-length=0

set(CMAKE_C_FLAGS_INIT "${COMMON_C_FLAGS} -std=c99")
set(CMAKE_CXX_FLAGS_INIT "${COMMON_C_FLAGS} -fno-exceptions -fno-rtti")
set(CMAKE_ASM_FLAGS_INIT "${CMAKE_C_FLAGS_INIT} -x assembler-with-cpp")
set(CMAKE_EXE_LINKER_FLAGS_INIT "${COMMON_C_FLAGS} -specs=nano.specs -specs=nosys.specs")

set(CMAKE_C_FLAGS_DEBUG "-Og -g")
Expand Down
Loading