From 44f0e4f3d0effb17edcc0754170fd91350fd75a0 Mon Sep 17 00:00:00 2001 From: Ilya Churaev Date: Fri, 6 Oct 2023 17:06:04 +0400 Subject: [PATCH] Throw an error if SELECTIVE_BUILD_STAT doesn't contain csv files (#20283) * Throw an error if SELECTIVE_BUILD_STAT doesn't contain csv files * Fixed detection STAT files for Windows * Remove regex --- src/common/conditional_compilation/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/conditional_compilation/CMakeLists.txt b/src/common/conditional_compilation/CMakeLists.txt index b0a0f2835fb..876558cea5e 100644 --- a/src/common/conditional_compilation/CMakeLists.txt +++ b/src/common/conditional_compilation/CMakeLists.txt @@ -22,7 +22,13 @@ elseif(SELECTIVE_BUILD STREQUAL "ON") endif() find_host_package (Python3 REQUIRED COMPONENTS Interpreter) - file(GLOB STAT_FILES ${SELECTIVE_BUILD_STAT}) + file(TO_CMAKE_PATH ${SELECTIVE_BUILD_STAT} CMAKE_SELECTIVE_BUILD_STAT) + + file(GLOB STAT_FILES ${CMAKE_SELECTIVE_BUILD_STAT}) + + if(NOT STAT_FILES) + message(FATAL_ERROR "SELECTIVE_BUILD_STAT (${SELECTIVE_BUILD_STAT}) path doesn't contain valid csv files!") + endif() target_compile_definitions(${TARGET_NAME} INTERFACE SELECTIVE_BUILD)