Skip to content

Commit 1b486d5

Browse files
authored
Merge pull request arduino-cmake#31 from fraillt/hotfix/arduino_library_includes
fixed arduino library includes
2 parents 9cca36c + fe1e372 commit 1b486d5

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

cmake/Platform/Core/Libraries/ArduinoLibraryFactory.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ function(make_arduino_library VAR_NAME BOARD_ID LIB_PATH COMPILE_FLAGS LINK_FLAG
6868
else ()
6969
# Target already exists, skiping creating
7070
list(APPEND LIB_TARGETS ${TARGET_LIB_NAME})
71+
list(APPEND LIB_INCLUDES "-I\"${LIB_PATH}\"")
7172
endif ()
7273

7374
if (LIB_TARGETS)

cmake/Platform/Core/LibraryFinder.cmake

-8
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,12 @@ function(find_arduino_libraries VAR_NAME SRCS ARDLIBS)
102102
list(APPEND ARDUINO_LIBS ${LIB_SEARCH_PATH}/${INCLUDE_NAME})
103103
break()
104104
endif ()
105-
if (EXISTS ${LIB_SEARCH_PATH}/${CMAKE_MATCH_1})
106-
list(APPEND ARDUINO_LIBS ${LIB_SEARCH_PATH})
107-
break()
108-
endif ()
109105

110106
# Some libraries like Wire and SPI require building from source
111107
if (EXISTS ${LIB_SEARCH_PATH}/${INCLUDE_NAME}/src/${CMAKE_MATCH_1})
112108
list(APPEND ARDUINO_LIBS ${LIB_SEARCH_PATH}/${INCLUDE_NAME}/src)
113109
break()
114110
endif ()
115-
if (EXISTS ${LIB_SEARCH_PATH}/src/${CMAKE_MATCH_1})
116-
list(APPEND ARDUINO_LIBS ${LIB_SEARCH_PATH}/src)
117-
break()
118-
endif ()
119111
endforeach ()
120112

121113
endif ()

0 commit comments

Comments
 (0)