Cygwin: use absolute path with cygpath conversion to the linker script again

because the relative path is interpreted differently on linux, mac and windows
This commit is contained in:
Matthias Grob
2018-01-04 07:46:01 +00:00
committed by Daniel Agar
parent 275f462136
commit c0c0666d5c
2 changed files with 56 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
include(common/px4_upload)
include(cygwin_cygpath)
if (NOT FW_NAME)
set(FW_NAME ${CONFIG}.elf)
@@ -37,9 +38,13 @@ endif()
file(RELATIVE_PATH PX4_BINARY_DIR_REL ${CMAKE_CURRENT_BINARY_DIR} ${PX4_BINARY_DIR})
# only in the cygwin environment: convert absolute linker script path to mixed windows (C:/...)
# because even relative linker script paths are different for linux, mac and windows
CYGPATH(PX4_BINARY_DIR PX4_BINARY_DIR_CYG)
target_link_libraries(${FW_NAME}
-Wl,--script=${PX4_BINARY_DIR_REL}/NuttX/nuttx/configs/${BOARD}/scripts/${LD_SCRIPT}
-Wl,--script=${PX4_BINARY_DIR_CYG}/NuttX/nuttx/configs/${BOARD}/scripts/${LD_SCRIPT}
-Wl,-Map=${CONFIG}.map
-Wl,--warn-common,--gc-sections