This commit is contained in:
Andrew Kaster 2025-01-02 11:40:21 +00:00 committed by GitHub
commit 9010bbf0e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 18 additions and 6 deletions

View file

@ -15,6 +15,11 @@ set(BUILD_TESTING_SAVE ${BUILD_TESTING})
set(BUILD_TESTING OFF)
set(BUILD_EXAMPLES OFF)
# FIXME: https://github.com/apple/swift-collections/issues/440
set(BUILD_SHARED_LIBS_SAVE ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS OFF)
FetchContent_MakeAvailable(SwiftCollections)
set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_SAVE})
set(BUILD_TESTING ${BUILD_TESTING_SAVE})

View file

@ -77,16 +77,11 @@ add_cxx_compile_options(-Wno-invalid-offsetof)
add_cxx_compile_options(-Wno-unknown-warning-option)
add_cxx_compile_options(-Wno-unused-command-line-argument)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "18")
add_cxx_compile_options(-Wpadded-bitfield)
endif()
if (NOT CMAKE_HOST_SYSTEM_NAME MATCHES SerenityOS)
# FIXME: Something makes this go crazy and flag unused variables that aren't flagged as such when building with the toolchain.
# Disable -Werror for now.
add_cxx_compile_options(-Werror)
endif()
add_cxx_compile_options(-Werror)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_SIMULATE_ID MATCHES "MSVC")
# Clang's default constexpr-steps limit is 1048576(2^20), GCC doesn't have one

View file

@ -54,6 +54,13 @@ if (NOT WIN32)
endif()
endif()
if (NOT WIN32 AND NOT APPLE AND NOT ENABLE_FUZZERS)
# NOTE: Assume ELF
add_link_options(LINKER:-z,defs)
add_link_options(LINKER:--no-undefined)
add_link_options(LINKER:--no-allow-shlib-undefined)
endif()
if (ENABLE_LAGOM_COVERAGE_COLLECTION)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang$" AND NOT ENABLE_FUZZERS)
add_cxx_compile_options(-fprofile-instr-generate -fcoverage-mapping)

View file

@ -16,6 +16,11 @@ function(clang_plugin target_name)
set_property(GLOBAL APPEND PROPERTY CLANG_PLUGINS_COMPILE_OPTIONS_FOR_TESTS -fplugin=${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/lib${target_name}.so)
add_lagom_library_install_rules(${target_name})
if (NOT WIN32 AND NOT APPLE)
target_link_options(${target_name} PRIVATE LINKER:-z,undefs)
target_link_options(${target_name} PRIVATE LINKER:--allow-shlib-undefined)
endif()
endfunction()
function(depend_on_clang_plugin target_name plugin_name)