File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,12 @@ find_package(Python3 ${PYTHON_VERSION} EXACT COMPONENTS Development)
1111if (DEFINED TORCHCODEC_DISABLE_COMPILE_WARNING_AS_ERROR AND TORCHCODEC_DISABLE_COMPILE_WARNING_AS_ERROR)
1212 set (TORCHCODEC_WERROR_OPTION "" )
1313else ()
14- set (TORCHCODEC_WERROR_OPTION "-Werror" )
14+ if (WIN32 )
15+ # TODO set warnings as errors on Windows as well.
16+ # set(TORCHCODEC_WERROR_OPTION "/WX")
17+ else ()
18+ set (TORCHCODEC_WERROR_OPTION "-Werror" )
19+ endif ()
1520endif ()
1621
1722if (WIN32 )
@@ -23,9 +28,11 @@ if (WIN32)
2328 set (CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON )
2429endif ()
2530
26- # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic ${TORCHCODEC_WERROR_OPTION} ${TORCH_CXX_FLAGS}")
27- # TODO put back previous line and set proper flags for windows. e.g. Wall is W4.
28- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS} " )
31+ if (WIN32 )
32+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 ${TORCHCODEC_WERROR_OPTION} ${TORCH_CXX_FLAGS} " )
33+ else ()
34+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic ${TORCHCODEC_WERROR_OPTION} ${TORCH_CXX_FLAGS} " )
35+ endif ()
2936
3037
3138function (make_torchcodec_sublibrary
You can’t perform that action at this time.
0 commit comments