We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f17263 commit 5d64964Copy full SHA for 5d64964
ArduinoLibrary.cmake
@@ -31,11 +31,20 @@ function(arduino_library LIB_NAME LIB_PATH)
31
endif()
32
set(LIB_PATH "${CLONE_DIR}")
33
34
- set(INC_DIR "${LIB_PATH}/src")
35
- file(GLOB SRC_FILES
36
- "${LIB_PATH}/src/*.c"
37
- "${LIB_PATH}/src/*.cpp"
38
- )
+ if(EXISTS "${LIB_PATH}/src")
+ set(INC_DIR "${LIB_PATH}/src")
+ file(GLOB_RECURSE SRC_FILES
+ "${LIB_PATH}/src/*.c"
+ "${LIB_PATH}/src/*.cpp"
39
+ )
40
+ else()
41
+ # Legacy libraries without src folder
42
+ set(INC_DIR "${LIB_PATH}")
43
44
+ "${LIB_PATH}/*.c"
45
+ "${LIB_PATH}/*.cpp"
46
47
+ endif()
48
# Only create library if there are source files
49
if(SRC_FILES)
50
add_library(${LIB_NAME} STATIC ${SRC_FILES})
0 commit comments