summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-05-15 18:06:36 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-05-15 18:06:58 (GMT)
commit9ee24ede7363f8349c876e2f1dbbc541f60e3452 (patch)
tree1b868e346e2fc06077d5d1c8f1f64b8a8cf1126d /Modules/Compiler
parent66efdbd21a46b63572f5de677ed126a68e524e7a (diff)
parent2a9ff9703e20172ca14b6c872b300d0dbb75f5da (diff)
downloadCMake-9ee24ede7363f8349c876e2f1dbbc541f60e3452.zip
CMake-9ee24ede7363f8349c876e2f1dbbc541f60e3452.tar.gz
CMake-9ee24ede7363f8349c876e2f1dbbc541f60e3452.tar.bz2
Merge topic 'msvc-jmc'
2a9ff9703e MSVC: Add support for /JMC (Just My Code) Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3121
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/MSVC-C.cmake5
-rw-r--r--Modules/Compiler/MSVC-CXX.cmake5
2 files changed, 10 insertions, 0 deletions
diff --git a/Modules/Compiler/MSVC-C.cmake b/Modules/Compiler/MSVC-C.cmake
index f56227b..20787a3 100644
--- a/Modules/Compiler/MSVC-C.cmake
+++ b/Modules/Compiler/MSVC-C.cmake
@@ -31,3 +31,8 @@ macro(cmake_record_c_compile_features)
endif()
set(_result 0) # expected by cmake_determine_compile_features
endmacro()
+
+# /JMC "Just My Code" is only supported by MSVC 19.05 onward.
+if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.05)
+ set(CMAKE_C_COMPILE_OPTIONS_JMC "-JMC")
+endif()
diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake
index f3a7408..915295d 100644
--- a/Modules/Compiler/MSVC-CXX.cmake
+++ b/Modules/Compiler/MSVC-CXX.cmake
@@ -65,3 +65,8 @@ elseif (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)
_record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES)
endmacro()
endif()
+
+# /JMC "Just My Code" is only supported by MSVC 19.05 onward.
+if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.05)
+ set(CMAKE_CXX_COMPILE_OPTIONS_JMC "-JMC")
+endif()