Workaround autocrlf=input (#4072)
We've seen some lingering odd issues with autocrlf. I think this will resolve them all because our gitattrbutes sets text=auto which is only overridden if autocrlf=input. We'll know if this works based on whether or not the AppVeyor build works.
This commit is contained in:
Родитель
0c53d74705
Коммит
9e6453cefd
|
@ -11,9 +11,13 @@ if (WIN32 AND NOT DEFINED HLSL_AUTOCRLF)
|
||||||
OUTPUT_VARIABLE output
|
OUTPUT_VARIABLE output
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
if( result EQUAL 0 )
|
if( result EQUAL 0 )
|
||||||
set(val Off)
|
# This is a little counterintuitive... Because the repo's gitattributes set
|
||||||
if (output STREQUAL "true")
|
# text=auto, autocrlf behavior will be enabled for autocrlf true or false.
|
||||||
set(val On)
|
# For reasons unknown to me, autocrlf=input overrides the gitattributes, so
|
||||||
|
# that is the case we need special handling for.
|
||||||
|
set(val On)
|
||||||
|
if (output STREQUAL "input")
|
||||||
|
set(val Off)
|
||||||
endif()
|
endif()
|
||||||
set(HLSL_AUTOCRLF ${val} CACHE BOOL "Is core.autocrlf enabled in this clone")
|
set(HLSL_AUTOCRLF ${val} CACHE BOOL "Is core.autocrlf enabled in this clone")
|
||||||
message(STATUS "Git checkout autocrlf: ${HLSL_AUTOCRLF}")
|
message(STATUS "Git checkout autocrlf: ${HLSL_AUTOCRLF}")
|
||||||
|
|
Загрузка…
Ссылка в новой задаче