Sfoglia il codice sorgente

Fix for linker script path that includes space

I am working on Windows and path to my project contains space. When toolchain generates -T linker switch result looks like this:
-T<Path_before_space> <path_after_space>/${TARGET}_flash.ld
This is interpreted by linker as 2 separate arguments.

I encolsed -T argument with quotes to force treating it as a single argument
grafalex82 8 anni fa
parent
commit
79ce3605be
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      cmake/gcc_stm32.cmake

+ 2 - 2
cmake/gcc_stm32.cmake

@@ -108,9 +108,9 @@ FUNCTION(STM32_SET_FLASH_PARAMS TARGET STM32_FLASH_SIZE STM32_RAM_SIZE STM32_CCR
 
     GET_TARGET_PROPERTY(TARGET_LD_FLAGS ${TARGET} LINK_FLAGS)
     IF(TARGET_LD_FLAGS)
-        SET(TARGET_LD_FLAGS "-T${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_flash.ld ${TARGET_LD_FLAGS}")
+        SET(TARGET_LD_FLAGS "\"-T${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_flash.ld\" ${TARGET_LD_FLAGS}")
     ELSE()
-        SET(TARGET_LD_FLAGS "-T${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_flash.ld")
+        SET(TARGET_LD_FLAGS "\"-T${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_flash.ld\"")
     ENDIF()
     SET_TARGET_PROPERTIES(${TARGET} PROPERTIES LINK_FLAGS ${TARGET_LD_FLAGS})
 ENDFUNCTION()