Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CMP0038 warnings on CMake >= 3.0 #143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix CMP0038 warnings on CMake >= 3.0
As of CMake 3.0, targets may not link to themselves in target_link_libraries. Doing so displays a warning (policy CMP0038). This change makes sure that a library will not be considered a dependency of itself.
pkerling committed Mar 11, 2015
commit f62793d36e34371f6e4a5da2d74ca7ccb400f395
8 changes: 6 additions & 2 deletions cmake/Platform/Arduino.cmake
Original file line number Diff line number Diff line change
@@ -988,8 +988,12 @@ function(setup_arduino_library VAR_NAME BOARD_ID LIB_PATH COMPILE_FLAGS LINK_FLA

foreach(LIB_DEP ${LIB_DEPS})
setup_arduino_library(DEP_LIB_SRCS ${BOARD_ID} ${LIB_DEP} "${COMPILE_FLAGS}" "${LINK_FLAGS}")
list(APPEND LIB_TARGETS ${DEP_LIB_SRCS})
list(APPEND LIB_INCLUDES ${DEP_LIB_SRCS_INCLUDES})
# Do not link to this library. DEP_LIB_SRCS will always be only one entry
# if we are looking at the same library.
if(NOT DEP_LIB_SRCS STREQUAL TARGET_LIB_NAME)
list(APPEND LIB_TARGETS ${DEP_LIB_SRCS})
list(APPEND LIB_INCLUDES ${DEP_LIB_SRCS_INCLUDES})
endif()
endforeach()

if (LIB_INCLUDES)