From c61a51fb4c667867de903aa72ee2449cae85bbd2 Mon Sep 17 00:00:00 2001 From: xuxin19 Date: Mon, 14 Oct 2024 18:36:35 +0800 Subject: [PATCH] cmake(fix warning):toolchain do not have parent scope toolchain file variable is global scope dont need set parent scope clear warning: CMake Warning (dev) at /github/workspace/sources/nuttx/arch/arm/src/cmake/gcc.cmake:69 (set): Cannot set "GCCVER": current scope has no parent. Call Stack (most recent call first): /github/workspace/sources/nuttx/arch/arm/src/cmake/Toolchain.cmake:56 (include) /github/workspace/sources/nuttx/build/CMakeFiles/3.26.0/CMakeSystem.cmake:6 (include) /github/workspace/sources/nuttx/build/CMakeFiles/CMakeScratch/TryCompile-ZJVOZO/CMakeLists.txt:5 (project) This warning is for project developers. Use -Wno-dev to suppress it. Signed-off-by: xuxin19 --- arch/arm/src/cmake/gcc.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm/src/cmake/gcc.cmake b/arch/arm/src/cmake/gcc.cmake index bd0796f8afd6d..1a4414314403b 100644 --- a/arch/arm/src/cmake/gcc.cmake +++ b/arch/arm/src/cmake/gcc.cmake @@ -66,9 +66,7 @@ execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE GCC_VERSION_OUTPUT) string(REGEX MATCH "\\+\\+.* ([0-9]+)\\.[0-9]+" GCC_VERSION_REGEX "${GCC_VERSION_OUTPUT}") -set(GCCVER - ${CMAKE_MATCH_1} - PARENT_SCOPE) +set(GCCVER ${CMAKE_MATCH_1}) if(GCCVER EQUAL 12) add_compile_options(--param=min-pagesize=0)