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

Commit a7eda7f

Browse files
committed
Fixed bug where 'utility' sub-dir hasn't been searched for sources/headers.
This is relevant for libraries conforming to the 1.0 standard, where there's no 'src' sub-dir. The specs say that besides the root dir, 'utility' sub-dir should be part of the search as well.
1 parent aee9326 commit a7eda7f

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

cmake/Platform/Sources/ArduinoLibrarySourcesSeeker.cmake

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,18 @@
88
function(find_library_header_files _base_path _return_var)
99

1010
if (EXISTS ${_base_path}/src) # 'src' sub-dir exists and should contain sources
11+
1112
# Headers are always searched recursively under the 'src' sub-dir
1213
find_header_files(${_base_path}/src headers RECURSE)
14+
1315
else ()
14-
find_header_files(${_base_path} headers)
16+
17+
# Both root-dir and 'utility' sub-dir are searched when 'src' doesn't exist
18+
find_header_files(${_base_path} root_headers)
19+
find_header_files(${_base_path}/utility utility_headers)
20+
21+
set(headers ${root_headers} ${utility_headers})
22+
1523
endif ()
1624

1725
set(${_return_var} "${headers}" PARENT_SCOPE)
@@ -28,10 +36,18 @@ endfunction()
2836
function(find_library_source_files _base_path _return_var)
2937

3038
if (EXISTS ${_base_path}/src)
39+
3140
# Sources are always searched recursively under the 'src' sub-dir
3241
find_source_files(${_base_path}/src sources RECURSE)
42+
3343
else ()
34-
find_source_files(${_base_path} sources)
44+
45+
# Both root-dir and 'utility' sub-dir are searched when 'src' doesn't exist
46+
find_source_files(${_base_path} root_sources)
47+
find_source_files(${_base_path}/utility utility_sources)
48+
49+
set(sources ${root_sources} ${utility_sources})
50+
3551
endif ()
3652

3753
set(${_return_var} "${sources}" PARENT_SCOPE)

0 commit comments

Comments
 (0)