Skip to content

Commit 647d70f

Browse files
bretdavi89gfxVPLsdm
authored andcommitted
[Build] Workaround for failures caused by Crowdstrike
Recent IT updates have caused issues with scan exceptions for build workspace, causing file related build errors. This change removes the manifest embedding and incremental linking steps, which prevents a race condition for scans to occur during build process.
1 parent b88adaf commit 647d70f

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

builder/FindGlobals.cmake

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ elseif( Windows )
109109
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BIN_DIR}/${CMAKE_BUILD_TYPE})
110110
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BIN_DIR}/${CMAKE_BUILD_TYPE})
111111
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_LIB_DIR}/${CMAKE_BUILD_TYPE})
112-
112+
113113
foreach(config_type ${CMAKE_CONFIGURATION_TYPES})
114114
string(TOUPPER ${config_type} config_type_capital)
115115
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY_${config_type_capital} ${CMAKE_BIN_DIR}/${config_type})
@@ -144,6 +144,21 @@ elseif( Windows )
144144
/guard:cf
145145
)
146146
147+
# Use /MANIFEST:NO to prevent CMake's vs_link_exe wrapper from invoking
148+
# mt.exe as a separate step, and /INCREMENTAL:NO to avoid the linker
149+
# modifying an existing binary in-place. Both avoid failures when security
150+
# software (e.g. CrowdStrike) locks freshly written binaries.
151+
# These must go in config-specific flags because CMake's Ninja generator
152+
# strips /MANIFEST:NO from the base CMAKE_EXE_LINKER_FLAGS, and CMake's
153+
# default CMAKE_EXE_LINKER_FLAGS_DEBUG contains /INCREMENTAL which
154+
# overrides any /INCREMENTAL:NO in the base flags.
155+
foreach(config DEBUG RELEASE RELWITHDEBINFO MINSIZEREL)
156+
set(CMAKE_EXE_LINKER_FLAGS_${config}
157+
"${CMAKE_EXE_LINKER_FLAGS_${config}} /MANIFEST:NO /INCREMENTAL:NO")
158+
set(CMAKE_SHARED_LINKER_FLAGS_${config}
159+
"${CMAKE_SHARED_LINKER_FLAGS_${config}} /MANIFEST:NO /INCREMENTAL:NO")
160+
endforeach()
161+
147162
endif( )
148163
149164
if( NOT DEFINED MFX_APPS_DIR)

0 commit comments

Comments
 (0)