Skip to content

Commit

Permalink
DO NOT MERGE: Tmp commit to build with more compilers in CI to detect…
Browse files Browse the repository at this point in the history
… issues.
  • Loading branch information
microbit-carlos committed Sep 8, 2023
1 parent 9da1d9d commit f8269af
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04, macos-11, windows-2019]
gcc: ['7-2017-q4', 'latest']
cmake: ['3.6.0', ''] # Empty string installs the latest CMake release
gcc: ['7-2017-q4', '7-2018-q2', '8-2018-q4', '8-2019-q3', '9-2019-q4', '9-2020-q2', '10-2020-q4', 'latest']
cmake: ['3.6.0'] #, ''] # Empty string installs the latest CMake release
fail-fast: false
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }}, gcc ${{ matrix.gcc }}, cmake ${{ matrix.cmake || 'latest'}}
Expand Down
30 changes: 21 additions & 9 deletions utils/cmake/toolchains/ARM_GCC/compiler-flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ if((CMAKE_VERSION VERSION_GREATER "3.4.0") OR (CMAKE_VERSION VERSION_EQUAL "3.4.
set(EXPLICIT_INCLUDES "<INCLUDES> ")
endif()


#if(CMAKE_C_COMPILER_VERSION VERSION_GREATER "9.0.0" OR CMAKE_C_COMPILER_VERSION VERSION_EQUAL "9.0.0")
# Some tools are not compatible with DWARF v5 yet
set(DWARF_VERSION_FLAG "-gdwarf-4")
message("USING DWARF v4 (${CMAKE_C_COMPILER_VERSION})")
#else()
# Older gcc versions need to be configured with DWARF v3
# set(DWARF_VERSION_FLAG "-gdwarf-3")
# message("USING DWARF v3 (${CMAKE_C_COMPILER_VERSION})")
#endif()


# Override the link rules:
set(CMAKE_C_CREATE_SHARED_LIBRARY "echo 'shared libraries not supported' && 1")
set(CMAKE_C_CREATE_SHARED_MODULE "echo 'shared modules not supported' && 1")
Expand All @@ -19,29 +31,29 @@ set(CMAKE_DEPFILE_FLAGS_CXX "-MMD -MT <OBJECT> -MF <DEPFILE>")
set(CMAKE_C_OUTPUT_EXTENSION ".o")
set(CMAKE_DEPFILE_FLAGS_C "-MMD -MT <OBJECT> -MF <DEPFILE>")

set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -gdwarf-4")
set(CMAKE_C_FLAGS_DEBUG_INIT "-g -gdwarf-4")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g ${DWARF_VERSION_FLAG}")
set(CMAKE_C_FLAGS_DEBUG_INIT "-g ${DWARF_VERSION_FLAG}")
set(CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
set(CMAKE_C_FLAGS_RELEASE_INIT "-Os -DNDEBUG")
set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-Os -g -gdwarf-4 -DNDEBUG")
set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-Os -g ${DWARF_VERSION_FLAG} -DNDEBUG")
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")

set(CMAKE_ASM_FLAGS_RELWITHDEBINFO "-g -gdwarf-4")
set(CMAKE_ASM_FLAGS_DEBUG_INIT "-g -gdwarf-4")
set(CMAKE_ASM_FLAGS_RELWITHDEBINFO "-g ${DWARF_VERSION_FLAG}")
set(CMAKE_ASM_FLAGS_DEBUG_INIT "-g ${DWARF_VERSION_FLAG}")
set(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
set(CMAKE_ASM_FLAGS_RELEASE_INIT "-Os -DNDEBUG")
set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-Os -g -gdwarf-4 -DNDEBUG")
set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-Os -g ${DWARF_VERSION_FLAG} -DNDEBUG")
set(CMAKE_INCLUDE_SYSTEM_FLAG_ASM "-isystem ")

set(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> -cr <LINK_FLAGS> <TARGET> <OBJECTS>")

set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> -Wl,-Map,<TARGET>.map -Wl,--start-group <OBJECTS> <LINK_LIBRARIES> -lnosys -lstdc++ -lsupc++ -lm -lc -lgcc -lstdc++ -lsupc++ -lm -lc -lgcc -Wl,--end-group --specs=nano.specs -o <TARGET>")

set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -gdwarf-4")
set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g -gdwarf-4")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g ${DWARF_VERSION_FLAG}")
set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g ${DWARF_VERSION_FLAG}")
set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE_INIT "-Os -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-Os -g -gdwarf-4 -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-Os -g ${DWARF_VERSION_FLAG} -DNDEBUG")
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")

if (CMAKE_C_COMPILER_VERSION VERSION_GREATER "7.1.0" OR CMAKE_C_COMPILER_VERSION VERSION_EQUAL "7.1.0")
Expand Down

0 comments on commit f8269af

Please sign in to comment.