Cygwin: Enable ARM build of px4fmu-vX_default under Windows Cygwin Environment

This commit is contained in:
Matthias Grob
2017-12-10 07:37:01 +00:00
committed by Daniel Agar
parent 70de169f15
commit 2186f7b1b1
3 changed files with 67 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
include(common/px4_upload)
include(cygwin_cygpath)
if (NOT FW_NAME)
set(FW_NAME ${CONFIG}.elf)
@@ -35,9 +36,13 @@ if (NOT LD_SCRIPT)
set(LD_SCRIPT ld.script)
endif()
# only in the cygwin environment: convert paths for
# linker script, map file and binary output to mixed windows paths (C:/...)
CYGPATH(PX4_BINARY_DIR PX4_BINARY_DIR_CYG)
target_link_libraries(${FW_NAME}
-T${PX4_BINARY_DIR}/NuttX/nuttx/configs/${BOARD}/scripts/${LD_SCRIPT}
-Wl,-Map=${PX4_BINARY_DIR}/${CONFIG}.map
-T${PX4_BINARY_DIR_CYG}/NuttX/nuttx/configs/${BOARD}/scripts/${LD_SCRIPT}
-Wl,-Map=${PX4_BINARY_DIR_CYG}/${CONFIG}.map
-Wl,--warn-common
-Wl,--gc-sections
-Wl,--start-group
@@ -62,7 +67,7 @@ string(REPLACE ".elf" ".px4" fw_file ${fw_file})
string(REPLACE "nuttx_" "" fw_file ${fw_file})
add_custom_command(OUTPUT ${BOARD}.bin
COMMAND ${OBJCOPY} -O binary ${PX4_BINARY_DIR}/${FW_NAME} ${BOARD}.bin
COMMAND ${OBJCOPY} -O binary ${PX4_BINARY_DIR_CYG}/${FW_NAME} ${BOARD}.bin
DEPENDS ${FW_NAME}
)