CMakeLists.txt: warning D9002 on windows + msvc

Resolve compile warning

cl : command line  warning D9002: ignoring unknown option '-fmacro-prefix-map=
This commit is contained in:
simbit18 2024-08-21 17:45:10 +02:00 committed by archer
parent 9b3fe17743
commit 419a8ab050

View File

@ -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__)