Skip to content

Commit ad0ef31

Browse files
fix compiler flags for msvc in portable lib (pytorch#15185)
### Test plan manual for now. When I get a stable config working on msvc I will add ci
1 parent 9b67fea commit ad0ef31

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kernels/portable/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ if(NOT EXECUTORCH_ROOT)
2121
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
2222
endif()
2323

24-
set(_common_compile_options -Wno-deprecated-declarations)
24+
set(_common_compile_options
25+
$<$<CXX_COMPILER_ID:MSVC>:/wd4996>
26+
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-deprecated-declarations>
27+
)
2528

2629
include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)
2730
include(${EXECUTORCH_ROOT}/tools/cmake/Codegen.cmake)

0 commit comments

Comments
 (0)