Skip to content

Commit c4f7d83

Browse files
committed
Fix build error with clang-cl on Windows
Close issue #327
1 parent f1a04c2 commit c4f7d83

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

cmake/CompilerOptions.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
9090
if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0 )
9191
target_compile_options( ${LIB_TARGET} PRIVATE -Wno-missing-braces -Wmissing-field-initializers )
9292
endif()
93+
if(
94+
MSVC AND
95+
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19 AND
96+
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 21
97+
)
98+
target_compile_options( ${LIB_TARGET} PRIVATE -Wno-cast-function-type )
99+
endif()
93100
endif()
94101

95102
if( APPLE )

0 commit comments

Comments
 (0)