From cb95ad726ad3862533a10890e9f74e6ea417b343 Mon Sep 17 00:00:00 2001 From: Riuzakiii Date: Mon, 27 Nov 2023 17:47:03 +0100 Subject: [PATCH] Change project name, build tool/tests only if top-level --- CMakeLists.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 47a1500..b1c37e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.17) -project(hydradancer LANGUAGES C ASM) +project(wch-ch56x-lib LANGUAGES C ASM) ## Adding lwrb, setting compiler options @@ -69,15 +69,17 @@ target_include_directories(nanoprintf INTERFACE ${CMAKE_CURRENT_LIST_DIR}/submod add_subdirectory(src) +if (PROJECT_IS_TOP_LEVEL) ## Adding the tests + if (DEFINED BUILD_TESTS) + add_subdirectory(tests) + endif() -if (DEFINED BUILD_TESTS) -add_subdirectory(tests) -endif() + ## Adding tools -## Adding tools + if (DEFINED BUILD_TOOLS) + add_subdirectory(tools/firmware_debug_board) + endif() -if (DEFINED BUILD_TOOLS) -add_subdirectory(tools/firmware_debug_board) endif()