1
1
cmake_minimum_required (VERSION 3.16 )
2
2
3
- # set the project name
4
- project (arduino_helix )
3
+ if (DEFINED ESP_PLATFORM )
4
+ # idf component
5
+ idf_component_register (
6
+ SRC_DIRS src src/utils src/libhelix-aac src/libhelix-mp3
7
+ INCLUDE_DIRS src src/utils src/libhelix-aac src/libhelix-mp3
8
+ REQUIRES arduino-esp32
9
+ )
5
10
6
- # lots of warnings and all warnings as errors
7
- ## add_compile_options(-Wall -Wextra )
8
- set (CMAKE_CXX_STANDARD 17 )
11
+ target_compile_options (${COMPONENT_LIB} INTERFACE -Wno-error -Wno-format )
12
+ target_compile_options (${COMPONENT_LIB} PRIVATE -DUSE_DEFAULT_STDLIB )
13
+ add_compile_definitions (ESP32 )
14
+ else ()
9
15
10
- option (MP3_EXAMPLES "build examples" OFF )
16
+ # set the project name
17
+ project (arduino_helix )
11
18
12
- file (GLOB_RECURSE SRC_LIST_C CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR} /src/*.c" )
13
- file (GLOB_RECURSE SRC_LIST_CPP CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR} /src/*.cpp" )
19
+ # lots of warnings and all warnings as errors
20
+ ## add_compile_options(-Wall -Wextra )
21
+ set (CMAKE_CXX_STANDARD 17 )
14
22
15
- # define libraries
16
- add_library (arduino_helix ${SRC_LIST_C} ${SRC_LIST_CPP} )
23
+ option (MP3_EXAMPLES "build examples" OFF )
17
24
18
- # prevent compile errors
19
- target_compile_options ( arduino_helix PRIVATE -DUSE_DEFAULT_STDLIB )
25
+ file ( GLOB_RECURSE SRC_LIST_C CONFIGURE_DEPENDS " ${PROJECT_SOURCE_DIR} /src/*.c" )
26
+ file ( GLOB_RECURSE SRC_LIST_CPP CONFIGURE_DEPENDS " ${PROJECT_SOURCE_DIR} /src/*.cpp" )
20
27
21
- # define location for header files
22
- target_include_directories (arduino_helix PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} /src ${CMAKE_CURRENT_SOURCE_DIR} /src/libhelix-mp3 ${CMAKE_CURRENT_SOURCE_DIR} /src/libhelix-aac )
28
+ # define libraries
29
+ add_library (arduino_helix ${SRC_LIST_C} ${SRC_LIST_CPP} )
23
30
24
- # build examples
25
- if (MP3_EXAMPLES )
26
- add_subdirectory ( "${CMAKE_CURRENT_SOURCE_DIR} /examples/output_mp3" )
27
- add_subdirectory ( "${CMAKE_CURRENT_SOURCE_DIR} /examples/output_aac" )
31
+ # prevent compile errors
32
+ target_compile_options (arduino_helix PRIVATE -DUSE_DEFAULT_STDLIB )
33
+
34
+ # define location for header files
35
+ target_include_directories (arduino_helix PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} /src ${CMAKE_CURRENT_SOURCE_DIR} /src/libhelix-mp3 ${CMAKE_CURRENT_SOURCE_DIR} /src/libhelix-aac )
36
+
37
+ # build examples
38
+ if (MP3_EXAMPLES )
39
+ add_subdirectory ( "${CMAKE_CURRENT_SOURCE_DIR} /examples/output_mp3" )
40
+ add_subdirectory ( "${CMAKE_CURRENT_SOURCE_DIR} /examples/output_aac" )
41
+ endif ()
28
42
endif ()
0 commit comments