summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorLuca Cappa <lucappa@microsoft.com>2019-03-19 20:52:53 (GMT)
committerBrad King <brad.king@kitware.com>2019-05-14 17:27:18 (GMT)
commit2a9ff9703e20172ca14b6c872b300d0dbb75f5da (patch)
tree62541895769c282e435393895121f8573d2cdc06 /Modules
parentfa077acba51393030586aa50f5eff9d6034c5c11 (diff)
downloadCMake-2a9ff9703e20172ca14b6c872b300d0dbb75f5da.zip
CMake-2a9ff9703e20172ca14b6c872b300d0dbb75f5da.tar.gz
CMake-2a9ff9703e20172ca14b6c872b300d0dbb75f5da.tar.bz2
MSVC: Add support for /JMC (Just My Code)
Diffstat (limited to 'Modules')
-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 787c17e..378a119 100644
--- a/Modules/Compiler/MSVC-CXX.cmake
+++ b/Modules/Compiler/MSVC-CXX.cmake
@@ -64,3 +64,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()