Disable -Wmaybe-uninitialized in GCC versions 12 and later.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109561

PiperOrigin-RevId: 569204628
Change-Id: I34ccb84a0afc60ccfcc47c820438d15dfa0a5f42
This commit is contained in:
Saran Tunyasuvunakool
2023-09-28 09:24:32 -07:00
committed by Copybara-Service
parent 107b76490a
commit 8e00f8029e
+5
View File
@@ -311,6 +311,11 @@ macro(mujoco_pybind11_module name)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# Only allow fallthrough annotation via __attribute__.
target_compile_options(${name} PRIVATE -Wimplicit-fallthrough=5)
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109561
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 11)
target_compile_options(${name} PRIVATE -Wno-maybe-uninitialized)
endif()
endif()
endif()
set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})