Fix Windows build warning (#1228)
This commit is contained in:
parent
ab18927533
commit
7ef7ec8491
@ -96,19 +96,20 @@ if (NOT TARGET pico_standard_link)
|
|||||||
target_link_options(pico_standard_link INTERFACE "LINKER:--gc-sections")
|
target_link_options(pico_standard_link INTERFACE "LINKER:--gc-sections")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Ignore warnings about rwx segments introduced in binutils 2.39
|
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
|
||||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -print-prog-name=ld RESULT_VARIABLE RUN_C_RESULT OUTPUT_VARIABLE FULL_LD_PATH
|
# Ignore warnings about rwx segments introduced in binutils 2.39
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
execute_process(COMMAND ${CMAKE_C_COMPILER} -print-prog-name=ld RESULT_VARIABLE RUN_C_RESULT OUTPUT_VARIABLE FULL_LD_PATH
|
||||||
if (${RUN_C_RESULT} EQUAL 0)
|
|
||||||
execute_process(COMMAND ${FULL_LD_PATH} --help RESULT_VARIABLE RUN_LD_RESULT OUTPUT_VARIABLE LD_HELP_OUTPUT
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
if (${RUN_LD_RESULT} EQUAL 0)
|
if (${RUN_C_RESULT} EQUAL 0)
|
||||||
set(RWX_WARNING "no-warn-rwx-segments")
|
execute_process(COMMAND ${FULL_LD_PATH} --help RESULT_VARIABLE RUN_LD_RESULT OUTPUT_VARIABLE LD_HELP_OUTPUT
|
||||||
string(FIND "${LD_HELP_OUTPUT}" "${RWX_WARNING}" LD_RWX_WARNING_SUPPORTED)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
if (${LD_RWX_WARNING_SUPPORTED} GREATER -1)
|
if (${RUN_LD_RESULT} EQUAL 0)
|
||||||
target_link_options(pico_standard_link INTERFACE "LINKER:--${RWX_WARNING}")
|
set(RWX_WARNING "no-warn-rwx-segments")
|
||||||
endif()
|
string(FIND "${LD_HELP_OUTPUT}" "${RWX_WARNING}" LD_RWX_WARNING_SUPPORTED)
|
||||||
|
if (${LD_RWX_WARNING_SUPPORTED} GREATER -1)
|
||||||
|
target_link_options(pico_standard_link INTERFACE "LINKER:--${RWX_WARNING}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user