File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -369,6 +369,14 @@ function Build-CMakeProject
369
369
TryAdd- KeyValue $Defines CMAKE_BUILD_TYPE $BuildType
370
370
TryAdd- KeyValue $Defines CMAKE_MT " mt"
371
371
372
+ # Workaround for running into MAX_PATH with CMake-generated output directory paths.
373
+ # CMake has logic to shorten output directory paths if they approach MAX_PATH,
374
+ # but when appending the filename we can still exceed MAX_PATH.
375
+ # The specific issue this solves is rc.exe writing windows_version_resource.rc.res
376
+ $MAX_PATH = 260
377
+ $LONG_FILENAME_LENGTH = 40
378
+ TryAdd- KeyValue $Defines CMAKE_OBJECT_PATH_MAX ($MAX_PATH - $LONG_FILENAME_LENGTH )
379
+
372
380
$CFlags = " /GS- /Gw /Gy /Oi /Oy /Zi /Zc:inline"
373
381
$CXXFlags = " /GS- /Gw /Gy /Oi /Oy /Zi /Zc:inline /Zc:__cplusplus"
374
382
if ($UseMSVCCompilers.Contains (" C" ))
You can’t perform that action at this time.
0 commit comments