Skip to content

Commit 419a8ab

Browse files
simbit18anchao
authored andcommitted
CMakeLists.txt: warning D9002 on windows + msvc
Resolve compile warning cl : command line warning D9002: ignoring unknown option '-fmacro-prefix-map=
1 parent 9b3fe17 commit 419a8ab

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,11 +528,13 @@ endif()
528528
# failure logs more deterministic and most importantly makes builds more
529529
# deterministic. Debuggers usually have a path mapping feature to ensure the
530530
# files are still found.
531-
if(CONFIG_OUTPUT_STRIP_PATHS)
532-
add_compile_options(-fmacro-prefix-map=${NUTTX_DIR}=)
533-
add_compile_options(-fmacro-prefix-map=${NUTTX_APPS_DIR}=)
534-
add_compile_options(-fmacro-prefix-map=${NUTTX_BOARD_ABS_DIR}=)
535-
add_compile_options(-fmacro-prefix-map=${NUTTX_CHIP_ABS_DIR}=)
531+
if(NOT MSVC)
532+
if(CONFIG_OUTPUT_STRIP_PATHS)
533+
add_compile_options(-fmacro-prefix-map=${NUTTX_DIR}=)
534+
add_compile_options(-fmacro-prefix-map=${NUTTX_APPS_DIR}=)
535+
add_compile_options(-fmacro-prefix-map=${NUTTX_BOARD_ABS_DIR}=)
536+
add_compile_options(-fmacro-prefix-map=${NUTTX_CHIP_ABS_DIR}=)
537+
endif()
536538
endif()
537539

538540
add_definitions(-D__NuttX__)

0 commit comments

Comments
 (0)