Skip to content
Permalink
Browse files

cmake: remove spurious IS_ABSOLUTE logic in zephyr_sources()

target_sources() documentation states:

  Relative source file paths are interpreted as being relative to the
  current source directory (i.e. CMAKE_CURRENT_SOURCE_DIR).

Remove spurious code duplicating cmake's behaviour. It proved to be a
time-consuming red herring while debugging some path-related issue and
"less is more".

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
  • Loading branch information...
marc-hb authored and nashif committed Jun 1, 2019
1 parent 86bfa07 commit e217c1b172965adf151d3e9abc71a0b56a78ed97
Showing with 2 additions and 9 deletions.
  1. +2 −9 cmake/extensions.cmake
@@ -65,17 +65,10 @@
# https://cmake.org/cmake/help/latest/command/target_sources.html
function(zephyr_sources)
foreach(arg ${ARGV})
if(IS_ABSOLUTE ${arg})
set(path ${arg})
else()
set(path ${CMAKE_CURRENT_SOURCE_DIR}/${arg})
endif()

if(IS_DIRECTORY ${path})
if(IS_DIRECTORY ${arg})
message(FATAL_ERROR "zephyr_sources() was called on a directory")
endif()

target_sources(zephyr PRIVATE ${path})
target_sources(zephyr PRIVATE ${arg})
endforeach()
endfunction()

0 comments on commit e217c1b

Please sign in to comment.
You can’t perform that action at this time.