Skip to content

Commit af7a4b7

Browse files
qt1bblanchon
authored andcommitted
CMake: added support for ESP-IDF (closes #1562)
1 parent fc4f175 commit af7a4b7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
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)