if(COMPILER_SUPPORTS_REDUNDANT_MOVE)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wredundant-move>)
endif()
+CHECK_CXX_COMPILER_FLAG("-Werror=vla" COMPILER_SUPPORTS_VLA_ERROR)
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
if(WIN32)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10)
HAVE_WARN_IMPLICIT_CONST_INT_FLOAT_CONVERSION)
endif()
+if(COMPILER_SUPPORTS_VLA_ERROR)
+ # Will be picked up by anyone including rgw_common
+ target_compile_options(rgw_common PUBLIC
+ $<$<COMPILE_LANGUAGE:CXX>:-Werror=vla>)
+endif()
+
target_link_libraries(rgw_common
PRIVATE
legacy-option-headers
add_library(rgw_schedulers STATIC ${rgw_schedulers_srcs})
target_link_libraries(rgw_schedulers
PUBLIC dmclock::dmclock Boost::context)
+if(COMPILER_SUPPORTS_VLA_ERROR)
+ target_compile_options(rgw_schedulers PRIVATE
+ $<$<COMPILE_LANGUAGE:CXX>:-Werror=vla>)
+endif()
set(radosgw_srcs
rgw_main.cc)
add_executable(radosgw ${radosgw_srcs})
-
if(WITH_RADOSGW_ARROW_FLIGHT)
# target_compile_definitions(radosgw PUBLIC WITH_ARROW_FLIGHT)
target_compile_definitions(rgw_common PUBLIC WITH_ARROW_FLIGHT)
legacy-option-headers
librados
global)
+if(COMPILER_SUPPORTS_VLA_ERROR)
+ target_compile_options(radosgw-token PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Werror=vla>)
+endif()
install(TARGETS radosgw-token DESTINATION bin)
if(WITH_RADOSGW_RADOS)
)
add_library(dbstore_lib ${dbstore_srcs})
+if(COMPILER_SUPPORTS_VLA_ERROR)
+ target_compile_options(dbstore_lib PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Werror=vla>)
+endif()
target_include_directories(dbstore_lib
PUBLIC "${CMAKE_SOURCE_DIR}/src/rgw"
PUBLIC "${CMAKE_SOURCE_DIR}/src/rgw/store/rados"
include_directories(${CMAKE_INCLUDE_DIR})
add_library(dbstore STATIC ${dbstore_mgr_srcs})
target_link_libraries(dbstore ${CMAKE_LINK_LIBRARIES})
+if(COMPILER_SUPPORTS_VLA_ERROR)
+ target_compile_options(dbstore PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Werror=vla>)
+endif()
# testing purpose
set(dbstore_main_srcs
add_executable(dbstore-bin ${dbstore_main_srcs})
add_dependencies(dbstore-bin dbstore)
target_link_libraries(dbstore-bin ${CMAKE_LINK_LIBRARIES})
+if(COMPILER_SUPPORTS_VLA_ERROR)
+ target_compile_options(dbstore-bin PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Werror=vla>)
+endif()
add_library(sqlite_db STATIC ${sqlite_db_srcs})
target_link_libraries(sqlite_db sqlite3 dbstore_lib rgw_common)
+if(COMPILER_SUPPORTS_VLA_ERROR)
+ target_compile_options(sqlite_db PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Werror=vla>)
+endif()
add_executable(unittest_dbstore_tests ${dbstore_tests_srcs})
target_link_libraries(unittest_dbstore_tests ${CMAKE_LINK_LIBRARIES})
add_ceph_unittest(unittest_dbstore_tests)
+if(COMPILER_SUPPORTS_VLA_ERROR)
+ target_compile_options(unittest_dbstore_tests PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Werror=vla>)
+endif()
add_executable(unittest_dbstore_mgr_tests dbstore_mgr_tests.cc)
target_link_libraries(unittest_dbstore_mgr_tests dbstore gtest_main)
add_ceph_unittest(unittest_dbstore_mgr_tests)
+if(COMPILER_SUPPORTS_VLA_ERROR)
+ target_compile_options(unittest_dbstore_mgr_tests PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Werror=vla>)
+endif()