diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9c7e023a7..a06935bc4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,6 +56,19 @@ jobs: run: | script/make-pretty check + cmake-version: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Bootstrap + run: | + sudo pip3 install --system -U cmake==3.10.3 + cmake --version | grep 3.10.3 + sudo apt-get --no-install-recommends install -y ninja-build libreadline-dev libncurses-dev + - name: Build + run: | + NODE_MODE=rcp ./script/test build + package: name: package-${{ matrix.compiler }} runs-on: ubuntu-18.04 diff --git a/CMakeLists.txt b/CMakeLists.txt index 21b2141c8..4d5f726f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,8 +60,8 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang") if(OT_COVERAGE) target_compile_definitions(ot-config INTERFACE "OPENTHREAD_ENABLE_COVERAGE=1") - add_compile_options(-g -O0 --coverage) - add_link_options(--coverage) + target_compile_options(ot-config INTERFACE -g -O0 --coverage) + target_link_libraries(ot-config INTERFACE --coverage) endif() set(OT_CFLAGS diff --git a/examples/platforms/simulation/CMakeLists.txt b/examples/platforms/simulation/CMakeLists.txt index 571825707..c1034328e 100644 --- a/examples/platforms/simulation/CMakeLists.txt +++ b/examples/platforms/simulation/CMakeLists.txt @@ -84,7 +84,6 @@ if(LIBRT) endif() target_link_libraries(openthread-simulation PRIVATE - openthread-platform-utils openthread-platform ot-config) diff --git a/examples/platforms/utils/CMakeLists.txt b/examples/platforms/utils/CMakeLists.txt index c32856589..4712015e8 100644 --- a/examples/platforms/utils/CMakeLists.txt +++ b/examples/platforms/utils/CMakeLists.txt @@ -42,15 +42,17 @@ set_target_properties( CXX_STANDARD 11 ) +target_compile_definitions(openthread-platform-utils PRIVATE + $ +) + target_include_directories(openthread-platform-utils PRIVATE ${OT_PUBLIC_INCLUDES} + $ ${PROJECT_SOURCE_DIR}/examples/platforms ${PROJECT_SOURCE_DIR}/examples/platforms/utils - ${PROJECT_SOURCE_DIR}/src/core ${PROJECT_SOURCE_DIR}/third_party/jlink/SEGGER_RTT_V640/RTT ) # Provide a static library implementation of platform-utils for non-cmake platforms add_library(openthread-platform-utils-static $) -target_link_libraries(openthread-platform-utils-static PUBLIC openthread-platform-utils) -target_link_libraries(openthread-platform-utils PRIVATE ot-config)