path: root/configurecompiler.cmake
diff options
authorMorgan Brown <>2018-08-29 00:29:40 (GMT)
committerGitHub <>2018-08-29 00:29:40 (GMT)
commit246ae784b826c79098a1b3967083c66187786197 (patch)
tree67b21a573bb1d89ba446f8a5bf38d077d35bed1e /configurecompiler.cmake
parent68a1167f6d12ca10ce6ce6ec9d3951e59912e4ce (diff)
Enable mixed mode assembly loading (#19542)
Bring back functionality for loading IJW assemblies and calling managed->native. Also add workaround to test case for the C++ compiler inserting calls to mscoree.
Diffstat (limited to 'configurecompiler.cmake')
1 files changed, 4 insertions, 2 deletions
diff --git a/configurecompiler.cmake b/configurecompiler.cmake
index cd73888..41e881c 100644
--- a/configurecompiler.cmake
+++ b/configurecompiler.cmake
@@ -496,7 +496,7 @@ if (WIN32)
add_compile_options(/Gy) # separate functions for linker
add_compile_options(/Zc:wchar_t-) # C++ language conformance: wchar_t is NOT the native type, but a typedef
add_compile_options(/Zc:forScope) # C++ language conformance: enforce Standard C++ for scoping rules
- add_compile_options(/GR-) # disable C++ RTTI
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") # disable C++ RTTI
add_compile_options(/FC) # use full pathnames in diagnostics
add_compile_options(/MP) # Build with Multiple Processes (number of processes equal to the number of processors)
add_compile_options(/GS) # Buffer Security Check
@@ -519,7 +519,9 @@ if (WIN32)
# enable control-flow-guard support for native components for non-Arm64 builds
- add_compile_options(/guard:cf)
+ # Added using variables instead of add_compile_options to let individual projects override it
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /guard:cf")
+ set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} /guard:cf")
# Statically linked CRT (libcmt[d].lib, libvcruntime[d].lib and libucrt[d].lib) by default. This is done to avoid
# linking in VCRUNTIME140.DLL for a simplified xcopy experience by reducing the dependency on VC REDIST.