summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-12 10:52:57 +0000
committerKitware Robot <kwrobot@kitware.com>2020-05-12 06:53:41 -0400
commiteb2a554b12b4980f76e425bfc720bb170d08e840 (patch)
tree9605603c3a8e7d8cf0226d1876e47e78c65ac47e /Tests
parentb049f0af52155d405129f6a6fd0524a88b1839dc (diff)
parent6b2fb4ffd2e34093e54db0d5e2dac0fa17eacdf0 (diff)
downloadcmake-eb2a554b12b4980f76e425bfc720bb170d08e840.tar.gz
Merge topic 'vs-pch-compile-opts'
6b2fb4ffd2 VS: Fix using PCH from source with COMPILE_OPTIONS Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4734
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchInterface.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/Tests/RunCMake/PrecompileHeaders/PchInterface.cmake b/Tests/RunCMake/PrecompileHeaders/PchInterface.cmake
index a1e0792738..aab20d8f59 100644
--- a/Tests/RunCMake/PrecompileHeaders/PchInterface.cmake
+++ b/Tests/RunCMake/PrecompileHeaders/PchInterface.cmake
@@ -9,6 +9,9 @@ target_precompile_headers(foo PUBLIC
<stdio.h>
\"string.h\"
)
+if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
+ set_property(SOURCE foo.c APPEND PROPERTY COMPILE_OPTIONS "-WX-")
+endif()
add_library(bar INTERFACE)
target_include_directories(bar INTERFACE include)