aboutsummaryrefslogtreecommitdiff
path: root/cmake/scripts/windows/CXXFlagOverrides.cmake
diff options
context:
space:
mode:
authorfuzzard <fuzzard@kodi.tv>2023-02-19 16:37:04 +1000
committerfuzzard <fuzzard@kodi.tv>2023-03-14 20:22:33 +1000
commit8ca18068de2c74296e41e38a09aec06125986e79 (patch)
tree71d2ffb3eb9f305ed567dd1252b3911035d482cc /cmake/scripts/windows/CXXFlagOverrides.cmake
parent50c977326ceab9b738924d9bbb182006a5161157 (diff)
[cmake][win] allow MAXTHREADS env var for /MP use
Diffstat (limited to 'cmake/scripts/windows/CXXFlagOverrides.cmake')
-rw-r--r--cmake/scripts/windows/CXXFlagOverrides.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmake/scripts/windows/CXXFlagOverrides.cmake b/cmake/scripts/windows/CXXFlagOverrides.cmake
index 44ae602bfe..72df9de168 100644
--- a/cmake/scripts/windows/CXXFlagOverrides.cmake
+++ b/cmake/scripts/windows/CXXFlagOverrides.cmake
@@ -1,5 +1,10 @@
if(MSVC)
- set(CMAKE_CXX_FLAGS "/D_UNICODE /DUNICODE /DRPC_USE_NATIVE_WCHAR /MP /DWIN32 /D_WINDOWS /W3 /GR /Zi /EHsc /arch:SSE2")
+ if(DEFINED ENV{MAXTHREADS})
+ set(MP_FLAG "/MP$ENV{MAXTHREADS}")
+ else()
+ set(MP_FLAG "/MP")
+ endif()
+ set(CMAKE_CXX_FLAGS "/D_UNICODE /DUNICODE /DRPC_USE_NATIVE_WCHAR ${MP_FLAG} /DWIN32 /D_WINDOWS /W3 /GR /Zi /EHsc /arch:SSE2")
set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MDd /Ob0 /Od /RTC1 /D_ITERATOR_DEBUG_LEVEL=0")
set(CMAKE_CXX_FLAGS_RELEASE "/MD /Ox /Ob2 /Oi /Ot /Oy /GL /DNDEBUG")
endif()