From 419a8ab050d596ee60029454fb6479efd8fbd2ab Mon Sep 17 00:00:00 2001 From: simbit18 <101105604+simbit18@users.noreply.github.com> Date: Wed, 21 Aug 2024 17:45:10 +0200 Subject: [PATCH] CMakeLists.txt: warning D9002 on windows + msvc Resolve compile warning cl : command line warning D9002: ignoring unknown option '-fmacro-prefix-map= --- CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97a63445570..f41122b6590 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -528,11 +528,13 @@ endif() # failure logs more deterministic and most importantly makes builds more # deterministic. Debuggers usually have a path mapping feature to ensure the # files are still found. -if(CONFIG_OUTPUT_STRIP_PATHS) - add_compile_options(-fmacro-prefix-map=${NUTTX_DIR}=) - add_compile_options(-fmacro-prefix-map=${NUTTX_APPS_DIR}=) - add_compile_options(-fmacro-prefix-map=${NUTTX_BOARD_ABS_DIR}=) - add_compile_options(-fmacro-prefix-map=${NUTTX_CHIP_ABS_DIR}=) +if(NOT MSVC) + if(CONFIG_OUTPUT_STRIP_PATHS) + add_compile_options(-fmacro-prefix-map=${NUTTX_DIR}=) + add_compile_options(-fmacro-prefix-map=${NUTTX_APPS_DIR}=) + add_compile_options(-fmacro-prefix-map=${NUTTX_BOARD_ABS_DIR}=) + add_compile_options(-fmacro-prefix-map=${NUTTX_CHIP_ABS_DIR}=) + endif() endif() add_definitions(-D__NuttX__)