-
Notifications
You must be signed in to change notification settings - Fork 20
/
CMakeLists.txt
47 lines (45 loc) · 1.09 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
if(IDF_VER)
# ESP-IDF
if(IDF_VERSION_MAJOR GREATER_EQUAL 5)
idf_component_register(
INCLUDE_DIRS
src
SRC_DIRS
src
src/platform
src/drivers
PRIV_REQUIRES
driver
esp_timer
soc
)
else()
idf_component_register(
INCLUDE_DIRS
src
SRC_DIRS
src
src/platform
src/drivers
)
endif()
set(target ${COMPONENT_LIB})
elseif(PICO_SDK_VERSION_STRING)
# Pico SDK
file(GLOB target_src
src/*.cpp
src/platform/*.cpp
src/drivers/*.cpp
)
add_library(OneWireNg STATIC ${target_src})
target_include_directories(OneWireNg PUBLIC src)
target_link_libraries(OneWireNg PUBLIC
pico_stdlib
hardware_pio
)
set(target OneWireNg)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(${target} PRIVATE -Os)
endif()