From f5b117cd4a3309a43baa51da4f128754b2a5b102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tautvydas=20=C5=BDilys?= Date: Wed, 23 Feb 2022 15:30:53 -0800 Subject: [PATCH] Fix compiler flags to enable building using VS2019+ and targetting Windows 7. --- cmake/compilers/MSVC.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/compilers/MSVC.cmake b/cmake/compilers/MSVC.cmake index acf0952c..7c6d7654 100644 --- a/cmake/compilers/MSVC.cmake +++ b/cmake/compilers/MSVC.cmake @@ -33,7 +33,8 @@ if (MSVC_VERSION LESS_EQUAL 1900) set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} /wd4503) endif() set(TBB_LIB_COMPILE_FLAGS -D_CRT_SECURE_NO_WARNINGS /GS) -set(TBB_COMMON_COMPILE_FLAGS /volatile:iso /FS /EHsc) +set(TBB_COMMON_COMPILE_FLAGS /volatile:iso /FS /EHsc /d2FH4- $<$>:/GL>) +set(TBB_COMMON_LINK_FLAGS $<$>:-LTCG> $<$>:-INCREMENTAL:NO>) # Ignore /WX set through add_compile_options() or added to CMAKE_CXX_FLAGS if TBB_STRICT is disabled. if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag) @@ -44,6 +45,8 @@ if (WINDOWS_STORE OR TBB_WINDOWS_DRIVER) set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} /D_WIN32_WINNT=0x0A00) set(TBB_COMMON_LINK_FLAGS -NODEFAULTLIB:kernel32.lib -INCREMENTAL:NO) set(TBB_COMMON_LINK_LIBS OneCore.lib) +else() + set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} /DNTDDI_VERSION=0x06010000 /D_WIN32_WINNT=0x0601 /DWINVER=0x0601) endif() if (WINDOWS_STORE)