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

Commit 3f2d66b

Browse files
committed
Removed code related to header-only-libraries, it belongs to another branch.
1 parent 26b3981 commit 3f2d66b

File tree

2 files changed

+15
-41
lines changed

2 files changed

+15
-41
lines changed

cmake/Platform/Libraries/LibrariesFinder.cmake

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
# _library_name - Name of the Arduino library to find.
88
# _board_id - Board ID associated with the linked Core Lib.
99
# [3RD_PARTY] - Whether library should be treated as a 3rd Party library.
10-
# [HEADER_ONLY] - Whether library is a header-only library, i.e has no source files
1110
#=============================================================================#
1211
function(find_arduino_library _target_name _library_name _board_id)
1312

14-
set(argument_options "3RD_PARTY" "HEADER_ONLY")
13+
set(argument_options "3RD_PARTY")
1514
cmake_parse_arguments(parsed_args "${argument_options}" "" "" ${ARGN})
1615

1716
if (NOT parsed_args_3RD_PARTY)
@@ -34,23 +33,17 @@ function(find_arduino_library _target_name _library_name _board_id)
3433
set(error_message "Couldn't find any header files for the ${_library_name} library")
3534
message(SEND_ERROR "${error_message}")
3635
else ()
37-
if (parsed_args_HEADER_ONLY)
38-
add_arduino_header_only_library(${_target_name} ${_board_id}
39-
ARCH ${ARDUINO_CMAKE_PLATFORM_ARCHITECTURE}
40-
HEADERS ${library_headers})
36+
find_library_source_files("${library_path}" library_sources)
37+
if (NOT library_sources)
38+
string(CONCAT error_message
39+
"Couldn't find any source files for the ${_library_name} library - "
40+
"Is it a header-only library?\n"
41+
"If so, please pass the HEADER_ONLY option as an argument to the function")
42+
message(SEND_ERROR "${error_message}")
4143
else ()
42-
find_library_source_files("${library_path}" library_sources)
43-
if (NOT library_sources)
44-
string(CONCAT error_message
45-
"Couldn't find any source files for the ${_library_name} library - "
46-
"Is it a header-only library?\n"
47-
"If so, please pass the HEADER_ONLY option as an argument to the function")
48-
message(SEND_ERROR "${error_message}")
49-
else ()
50-
set(sources ${library_headers} ${library_sources})
51-
add_arduino_library(${_target_name} ${_board_id} ${library_path} "${sources}"
52-
LIB_PROPS_FILE ${library_properties_file})
53-
endif ()
44+
set(sources ${library_headers} ${library_sources})
45+
add_arduino_library(${_target_name} ${_board_id} ${library_path} "${sources}"
46+
LIB_PROPS_FILE ${library_properties_file})
5447
endif ()
5548
endif ()
5649
endif ()

cmake/Platform/Targets/ArduinoLibraryTarget.cmake

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
#=============================================================================#
99
function(add_arduino_library _target_name _board_id _library_root_dir _sources)
1010

11-
resolve_library_architecture(${_library_root_dir} "${_sources}" arch_resolved_sources
12-
"${ARGN}")
11+
resolve_library_architecture(${_library_root_dir} "${_sources}" arch_resolved_sources "${ARGN}")
1312

1413
_add_arduino_cmake_library(${_target_name} ${_board_id} "${arch_resolved_sources}" "${ARGN}")
1514

@@ -21,27 +20,15 @@ function(add_arduino_library _target_name _board_id _library_root_dir _sources)
2120

2221
endfunction()
2322

24-
function(add_arduino_header_only_library _target_name _board_id)
25-
26-
cmake_parse_arguments(parsed_args "ARCH" "" "HEADERS" ${ARGN})
27-
28-
_add_arduino_cmake_library(${_target_name} ${_board_id} "${parsed_args_HEADERS}"
29-
INTERFACE ${parsed_args_ARCH})
30-
31-
endfunction()
32-
3323
#=============================================================================#
3424
# Links the given library target to the given "executable" target, but first,
3525
# it adds core lib's include directories to the libraries include directories.
3626
# _target_name - Name of the "executable" target.
3727
# _library_target_name - Name of the library target.
3828
# _board_id - Board ID associated with the linked Core Lib.
39-
# [HEADER_ONLY] - Whether library is a header-only library, i.e has no source files
4029
#=============================================================================#
4130
function(link_arduino_library _target_name _library_target_name _board_id)
4231

43-
cmake_parse_arguments(parsed_args "HEADER_ONLY" "" "" ${ARGN})
44-
4532
get_core_lib_target_name(${_board_id} core_lib_target)
4633

4734
if (NOT TARGET ${_target_name})
@@ -52,14 +39,8 @@ function(link_arduino_library _target_name _library_target_name _board_id)
5239
message(FATAL_ERROR "Core Library target doesn't exist. This is bad and should be reported")
5340
endif ()
5441

55-
if (parsed_args_HEADER_ONLY)
56-
_link_arduino_cmake_library(${_target_name} ${_library_target_name}
57-
INTERFACE
58-
BOARD_CORE_TARGET ${core_lib_target})
59-
else ()
60-
_link_arduino_cmake_library(${_target_name} ${_library_target_name}
61-
PUBLIC
62-
BOARD_CORE_TARGET ${core_lib_target})
63-
endif ()
42+
_link_arduino_cmake_library(${_target_name} ${_library_target_name}
43+
PUBLIC
44+
BOARD_CORE_TARGET ${core_lib_target})
6445

6546
endfunction()

0 commit comments

Comments
 (0)