Skip to content

Commit f97ad4b

Browse files
committed
Add /bigobj for pybind11 target on Windows
Signed-off-by: Rémi Achard <remiachard@gmail.com>
1 parent e24ce5c commit f97ad4b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

share/cmake/modules/Findpybind11.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,5 +140,14 @@ if(_pybind11_TARGET_CREATE)
140140
INTERFACE_INCLUDE_DIRECTORIES ${pybind11_INCLUDE_DIR}
141141
)
142142

143+
# /bigobj is needed for bigger binding projects due to the limit to 64k
144+
# addressable sections (see pybind11Common.cmake).
145+
if (MSVC)
146+
set_target_properties(pybind11::module PROPERTIES
147+
INTERFACE_COMPILE_OPTIONS /bigobj
148+
)
149+
150+
endif()
151+
143152
mark_as_advanced(pybind11_INCLUDE_DIR pybind11_VERSION)
144153
endif()

0 commit comments

Comments
 (0)