Skip to content

Commit

Permalink
Add the /bigobj flag to Windows Debug builds. (#1009)
Browse files Browse the repository at this point in the history
Windows debug builds generate a lot more sections, so when
building in debug mode we need to add the /bigobj flag to
avoid failing the build.  More details are in the link in
the code comment.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
  • Loading branch information
clalancette authored May 11, 2022
1 parent c6e5290 commit 848e2bb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rosbag2_transport/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND MSVC)
# /bigobj is needed to avoid error C1128:
# https://msdn.microsoft.com/en-us/library/8578y171.aspx
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
endif()

# Windows supplies macros for min and max by default. We should only use min and max from stl
if(WIN32)
Expand Down

0 comments on commit 848e2bb

Please sign in to comment.