add workaround for MinGW GCC bug
@@ -20,6 +20,13 @@ set_target_properties(sbp PROPERTIES
C_STANDARD_REQUIRED ON)
target_code_coverage(sbp AUTO ALL)
+if (MINGW)
+ if (CMAKE_C_COMPILER_VERSION VERSION_GREATER "4.7.0" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "8.0.0")
+ message(WARNING "Detected MinGW adding __attribute__((packed)) workaround")
+ target_compile_options(sbp PUBLIC "-mno-ms-bitfields")
+ endif()
+endif()
+
install(TARGETS sbp
EXPORT sbp-export
DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR})
