Skip to content

Commit db0d342

Browse files
committed
rework flags
1 parent 8930df5 commit db0d342

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/torchcodec/_core/CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,19 @@ else()
1414
set(TORCHCODEC_WERROR_OPTION "-Werror")
1515
endif()
1616

17+
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
18+
# Avoid warnings about non-ASCII characters in source files.
19+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4819")
20+
# Important for when we add Windows CUDA: exporting all symbols is aparently
21+
# limited to 65535 symbols, which (aparently) will not work for CUDA.
22+
# https://github.com/pytorch/pytorch/pull/3650
23+
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
24+
endif()
25+
1726
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic ${TORCHCODEC_WERROR_OPTION} ${TORCH_CXX_FLAGS}")
18-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${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}")
29+
1930

2031
function(make_torchcodec_sublibrary
2132
library_name

0 commit comments

Comments
 (0)