Skip to content

Commit a199291

Browse files
tejlmandcarlescufi
authored andcommitted
cmake: remove base_name for dep file
With CMake 3.20 relative path inside DEPFILEs are treated relative to CMAKE_CURRENT_BINARY_DIR and are transformed by CMake in its internal dep file. Therefore Zephyr build system must no longer add `base_name` to the `-MT` argument for the preprocessor. Signed-off-by: Torsten Rasmussen <[email protected]>
1 parent abce052 commit a199291

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

cmake/linker/arcmwdt/target.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ macro(configure_linker_script linker_script_gen linker_pass_define)
3030
endif()
3131

3232
zephyr_get_include_directories_for_lang(C current_includes)
33-
get_filename_component(base_name ${CMAKE_CURRENT_BINARY_DIR} NAME)
3433
get_property(current_defines GLOBAL PROPERTY PROPERTY_LINKER_SCRIPT_DEFINES)
3534

3635
# the command to generate linker file from template
@@ -46,7 +45,7 @@ macro(configure_linker_script linker_script_gen linker_pass_define)
4645
-x c
4746
${NOSYSDEF_CFLAG}
4847
-Hnocopyr
49-
-MD -MF ${linker_script_gen}.dep -MT ${base_name}/${linker_script_gen}
48+
-MD -MF ${linker_script_gen}.dep -MT ${linker_script_gen}
5049
-D_LINKER
5150
-D_ASMLANGUAGE
5251
-imacros ${AUTOCONF_H}

cmake/linker/lld/target.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ macro(configure_linker_script linker_script_gen linker_pass_define)
2929
endif()
3030

3131
zephyr_get_include_directories_for_lang(C current_includes)
32-
get_filename_component(base_name ${CMAKE_CURRENT_BINARY_DIR} NAME)
3332
get_property(current_defines GLOBAL PROPERTY PROPERTY_LINKER_SCRIPT_DEFINES)
3433

3534
add_custom_command(
@@ -42,7 +41,7 @@ macro(configure_linker_script linker_script_gen linker_pass_define)
4241
COMMAND ${CMAKE_C_COMPILER}
4342
-x assembler-with-cpp
4443
${NOSYSDEF_CFLAG}
45-
-MD -MF ${linker_script_gen}.dep -MT ${base_name}/${linker_script_gen}
44+
-MD -MF ${linker_script_gen}.dep -MT ${linker_script_gen}
4645
-D_LINKER
4746
-D_ASMLANGUAGE
4847
${current_includes}

0 commit comments

Comments
 (0)