Skip to content

Commit b6de3dc

Browse files
committed
Use /bigobj with Visual Studio
1>C:\Libs\xtensor\include\xtensor\xstrided_view_base.hpp(264): fatal error C1128: number of sections exceeded object file format limit: compile with /bigobj
1 parent 8d23051 commit b6de3dc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,11 @@ macro(xtensor_zarr_create_target source target_name linkage output_name)
262262
OUTPUT_NAME "lib${output_name}"
263263
)
264264

265+
if (MSVC) # the object files can get big, so we need to "Increase Number of Sections in .Obj file"
266+
# target_compile_definitions(${target_name} PUBLIC COMPILE_DEFINITIONS -Dbigobj) # doesn't work
267+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
268+
endif()
269+
265270
# Compilation flags
266271
# =================
267272

0 commit comments

Comments
 (0)