diff --git a/build/build-win22.sh b/build/build-win22.sh index c924dc1eaea..dbe0ad5f043 100644 --- a/build/build-win22.sh +++ b/build/build-win22.sh @@ -11,8 +11,8 @@ CORE=`grep -c ^processor /proc/cpuinfo` CMAKE="/mnt/c/Program Files/CMake/bin/cmake.exe" XRT=/mnt/c/Xilinx/xrt -BOOST=$XRT/ext -KHRONOS=$XRT/ext +BOOST=$XRT/ext.new +KHRONOS=$XRT/ext.new BOOST=$(sed -e 's|/mnt/\([A-Za-z]\)/\(.*\)|\1:/\2|' -e 's|/|\\|g' <<< $BOOST) KHRONOS=$(sed -e 's|/mnt/\([A-Za-z]\)/\(.*\)|\1:/\2|' -e 's|/|\\|g' <<< $KHRONOS) diff --git a/build/build22.bat b/build/build22.bat index d71a40ed7e3..e27ee110477 100644 --- a/build/build22.bat +++ b/build/build22.bat @@ -7,7 +7,7 @@ set BUILDDIR=%SCRIPTDIR% set DEBUG=1 set RELEASE=1 -set EXT_DIR=C:/Xilinx/XRT/ext +set EXT_DIR=C:/Xilinx/XRT/ext.new set CREATE_PACKAGE=0 set CMAKEFLAGS= set NOCMAKE=0 diff --git a/src/CMake/nativeWin.cmake b/src/CMake/nativeWin.cmake index 9c15c9cb672..ffa38df3956 100644 --- a/src/CMake/nativeWin.cmake +++ b/src/CMake/nativeWin.cmake @@ -51,18 +51,24 @@ add_compile_definitions("BOOST_BIND_GLOBAL_PLACEHOLDERS") add_compile_definitions("_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING") if (MSVC) - add_compile_options( - /Zc:__cplusplus - /Zi # generate pdb files even in release mode - /sdl # enable security checks - /Qspectre # compile with the Spectre mitigations switch - /ZH:SHA_256 # enable secure source code hashing - /guard:cf # enable compiler control guard feature (CFG) to prevent attackers from redirecting execution to unsafe locations + # Static linking with the CRT + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + + add_compile_options( + /MT$<$:d> # static linking with the CRT + /Zc:__cplusplus + /Zi # generate pdb files even in release mode + /sdl # enable security checks + /Qspectre # compile with the Spectre mitigations switch + /ZH:SHA_256 # enable secure source code hashing + /guard:cf # enable compiler control guard feature (CFG) to prevent attackers from redirecting execution to unsafe locations ) - add_link_options( - /DEBUG # instruct linker to create debugging info - /guard:cf # enable linker control guard feature (CFG) to prevent attackers from redirecting execution to unsafe locations - /CETCOMPAT # enable Control-flow Enforcement Technology (CET) Shadow Stack mitigation + add_link_options( + /NODEFAULTLIB:libucrt$<$:d>.lib # Hybrid CRT + /DEFAULTLIB:ucrt$<$:d>.lib # Hybrid CRT + /DEBUG # instruct linker to create debugging info + /guard:cf # enable linker control guard feature (CFG) to prevent attackers from redirecting execution to unsafe locations + /CETCOMPAT # enable Control-flow Enforcement Technology (CET) Shadow Stack mitigation ) endif()