From b89390148b81c2712a2f749e68d805aca94c314c Mon Sep 17 00:00:00 2001 From: Yadunund Date: Wed, 10 Nov 2021 15:44:05 +0800 Subject: [PATCH] Build samples independently of examples Signed-off-by: Yadunund --- CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 428b06f29..83a4e21fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -240,9 +240,15 @@ else() -Wall -Wextra -Werror=return-type) endif() +###################################################### +# Samples +if (BUILD_SAMPLES) + add_subdirectory(sample_nodes) +endif() + ###################################################### # Test -if (BUILD_UNIT_TESTS) +if (BUILD_UNIT_TESTS AND BUILD_SAMPLES) add_subdirectory(tests) endif() @@ -276,7 +282,6 @@ if(BUILD_TOOLS) add_subdirectory(tools) endif() -if( BUILD_EXAMPLES ) - add_subdirectory(sample_nodes) +if(BUILD_EXAMPLES AND BUILD_SAMPLES) add_subdirectory(examples) endif()