File tree Expand file tree Collapse file tree 4 files changed +9
-3
lines changed 
examples/build_system/cmake/toolchain Expand file tree Collapse file tree 4 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ if (NOT DEFINED CMAKE_CXX_COMPILER)
77endif  ()
88
99set (CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER} )
10+ set (TOOLCHAIN_ASM_FLAGS "-x assembler-with-cpp" )
11+ 
1012find_program (CMAKE_SIZE llvm-size)
1113find_program (CMAKE_OBJCOPY llvm-objcopy)
1214find_program (CMAKE_OBJDUMP llvm-objdump)
Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ if (TOOLCHAIN STREQUAL "gcc" OR TOOLCHAIN STREQUAL "clang")
3232    -Wl,--gc-sections
3333    -Wl,--cref
3434    )
35- 
3635elseif  (TOOLCHAIN STREQUAL  "iar" )
3736  list (APPEND  TOOLCHAIN_EXE_LINKER_FLAGS
3837    --diag_suppress=Li065
@@ -48,5 +47,10 @@ foreach (LANG IN ITEMS C CXX ASM)
4847  #set(CMAKE_${LANG}_FLAGS_DEBUG_INIT "-O0") 
4948endforeach  ()
5049
50+ # Assembler 
51+ if  (DEFINED  TOOLCHAIN_ASM_FLAGS)
52+   set (CMAKE_ASM_FLAGS_INIT "${CMAKE_ASM_FLAGS_INIT}  ${TOOLCHAIN_ASM_FLAGS} " )
53+ endif  ()
54+ 
5155# Linker 
5256list (JOIN TOOLCHAIN_EXE_LINKER_FLAGS " "  CMAKE_EXE_LINKER_FLAGS_INIT )
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ function(family_add_board BOARD_TARGET)
4848  update_board(${BOARD_TARGET} )
4949
5050  if  (CMAKE_C_COMPILER_ID STREQUAL  "GNU"  OR  CMAKE_C_COMPILER_ID STREQUAL  "Clang" )
51-     target_compile_options (${TARGET }  PUBLIC  -mcmodel=medany)
51+     target_compile_options (${BOARD_TARGET }  PUBLIC  -mcmodel=medany)
5252  endif ()
5353endfunction ()
5454
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ function(family_configure_example TARGET RTOS)
7979      --specs=nosys.specs --specs=nano.specs
8080      )
8181  elseif  (CMAKE_C_COMPILER_ID STREQUAL  "Clang" )
82-     target_link_options (${BOARD_TARGET }  PUBLIC 
82+     target_link_options (${TARGET }  PUBLIC 
8383      "LINKER:--script=${LD_FILE_GNU} " 
8484      )
8585  elseif  (CMAKE_C_COMPILER_ID STREQUAL  "IAR" )
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments