diff options
| author | graham sanderson <[email protected]> | 2024-07-17 20:03:27 -0500 |
|---|---|---|
| committer | Liam Fraser <[email protected]> | 2024-07-18 11:11:06 +0100 |
| commit | 5f6152a87e2a2fd07ed0cdbf6cf2300cb4fc6342 (patch) | |
| tree | 8a1399c61bc53276fe5c55141a0c662ea7fcdd36 | |
| parent | 0d72f153cf1614aaff0b5859d00fb5c0e1711f51 (diff) | |
not all GCC compiler builds support --no-warn-rwx-segments; check_linker_flag is not available in all supported version of CMake, so just allow it to be passed in
| -rw-r--r-- | hw/bsp/family_support.cmake | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/hw/bsp/family_support.cmake b/hw/bsp/family_support.cmake index bc2d481bb..6a1e96624 100644 --- a/hw/bsp/family_support.cmake +++ b/hw/bsp/family_support.cmake @@ -69,6 +69,10 @@ if (NOT FAMILY STREQUAL rp2040) endif() endif() +if (NOT NO_WARN_RWX_SEGMENTS_SUPPORTED) + set(NO_WARN_RWX_SEGMENTS_SUPPORTED 1) +endif() + set(WARNING_FLAGS_GNU -Wall -Wextra @@ -210,7 +214,7 @@ function(family_configure_common TARGET RTOS) # Generate linker map file if (CMAKE_C_COMPILER_ID STREQUAL "GNU") target_link_options(${TARGET} PUBLIC "LINKER:-Map=$<TARGET_FILE:${TARGET}>.map") - if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0) + if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0 AND NO_WARN_RWX_SEGMENTS_SUPPORTED) target_link_options(${TARGET} PUBLIC "LINKER:--no-warn-rwx-segments") endif () elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang") @@ -360,7 +364,7 @@ function(family_add_default_example_warnings TARGET) ) if (CMAKE_C_COMPILER_ID STREQUAL "GNU") - if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0) + if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0 AND NO_WARN_RWX_SEGMENTS_SUPPORTED) target_link_options(${TARGET} PUBLIC "LINKER:--no-warn-rwx-segments") endif() |
