Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit 62b7fcf

Browse files
committed
Fixed bug where not all platform library's sources were retrieved.
1 parent ad218e7 commit 62b7fcf

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

cmake/Platform/Targets/PlatformLibraryTarget.cmake

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,19 @@ endfunction()
2929
#=============================================================================#
3030
function(_add_platform_library _library_name _board_id)
3131

32-
find_header_files("${ARDUINO_CMAKE_PLATFORM_LIBRARIES_PATH}/${_library_name}/src" lib_headers)
33-
find_source_files("${ARDUINO_CMAKE_PLATFORM_LIBRARIES_PATH}/${_library_name}/src" lib_source_files)
32+
find_library_header_files("${ARDUINO_CMAKE_PLATFORM_LIBRARIES_PATH}/${_library_name}/src"
33+
lib_headers)
34+
find_library_source_files("${ARDUINO_CMAKE_PLATFORM_LIBRARIES_PATH}/${_library_name}/src"
35+
lib_source_files)
36+
3437
set(lib_sources ${lib_headers} ${lib_source_files})
3538

3639
_add_arduino_cmake_library(${_library_name} ${_board_id} "${lib_sources}")
3740

3841
endfunction()
3942

4043
#=============================================================================#
41-
# Links the given platform library target to the given target, be it an executable or another library.
44+
# Links the given platform library target to the given target.
4245
# _target_name - Name of the target to link against.
4346
# _library_name - Name of the library target to create, usually the platform library name.
4447
# _board_id - Board ID associated with the linked Core Lib.

examples/3rd-party-library/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ target_source_directories(adafruit_GFX DIRS libraries/Adafruit-GFX-Library/Fonts
2121
# We can even automatically find a library that doesn't have a properties file!
2222
find_arduino_library(sky_writer Skywriter ${board_id} 3RD_PARTY)
2323

24-
find_arduino_library(liquidCrystal LiquidCrystal_I2C ${board_id} 3RD_PARTY)
24+
# Libraries that have an inner-dependency on a platform library are also suported!
25+
find_arduino_library(liquid_Crystal LiquidCrystal_I2C ${board_id} 3RD_PARTY)
2526

2627
# Link all libraries to our previously created target
2728
link_arduino_library(3rd_Party_Arduino_Library adafruit_NeoPixel ${board_id})
2829
link_arduino_library(3rd_Party_Arduino_Library adafruit_GFX ${board_id})
2930
link_arduino_library(3rd_Party_Arduino_Library sky_writer ${board_id})
30-
link_arduino_library(3rd_Party_Arduino_Library liquidCrystal ${board_id})
31+
link_arduino_library(3rd_Party_Arduino_Library liquid_Crystal ${board_id})

0 commit comments

Comments
 (0)