Skip to content

Commit 2455455

Browse files
qt1bblanchon
authored andcommitted
Added support for ESP-IDF component build (closes #1562)
1 parent fc4f175 commit 2455455

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ HEAD
1212
* Added support for `std::string_view` (issue #1578, PR #1554 by @0xFEEDC0DE64)
1313
* Fixed warning `definition of implicit copy constructor for 'MsgPackDeserializer' is deprecated because it has a user-declared copy assignment operator`
1414
* Added `JsonArray::clear()` (issue #1597)
15+
* Added support for ESP-IDF component build (PR #1562 by @qt1)
1516

1617
v6.18.0 (2021-05-05)
1718
-------

CMakeLists.txt

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
cmake_minimum_required(VERSION 3.3)
66

7+
if(ESP_PLATFORM)
8+
# Build ArduinoJson as an ESP-IDF component
9+
idf_component_register(INCLUDE_DIRS src)
10+
target_compile_definitions(${COMPONENT_LIB} INTERFACE ARDUINOJSON_EMBEDDED_MODE=1)
11+
return()
12+
endif()
13+
714
project(ArduinoJson VERSION 6.18.0)
815

916
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)

0 commit comments

Comments
 (0)