Skip to content

Commit

Permalink
[𝘀𝗽𝗿] initial version
Browse files Browse the repository at this point in the history
Created using spr 1.3.4
  • Loading branch information
ilovepi committed Oct 14, 2024
1 parent 35684fa commit 1dafa52
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libcxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ option(LIBCXX_ENABLE_WIDE_CHARACTERS
support the C functionality for wide characters. When wide characters are
not supported, several parts of the library will be disabled, notably the
wide character specializations of std::basic_string." ON)
option(LIBCXX_ENABLE_FATLTO
"Whether to compile libc++ with FatLTO enabled." ON)
option(LIBCXX_ENABLE_LTO
"Whether to compile libc++ with LTO enabled." ON)

# To use time zone support in libc++ the platform needs to have the IANA
# database installed. Libc++ will fail to build if this is enabled on a
Expand Down
10 changes: 10 additions & 0 deletions libcxx/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@ if (APPLE AND LLVM_USE_SANITIZER)
endif()
endif()


if(LIBCXX_ENABLE_LTO)
list(APPEND LIBCXX_COMPILE_FLAGS "-flto")
list(APPEND LIBCXX_LINK_FLAGS "-flto")
endif()
if(LIBCXX_ENABLE_FATLTO)
list(APPEND LIBCXX_COMPILE_FLAGS "-ffat-lto-objects")
list(APPEND LIBCXX_LINK_FLAGS "-ffat-lto-objects")
endif()

split_list(LIBCXX_COMPILE_FLAGS)
split_list(LIBCXX_LINK_FLAGS)

Expand Down
10 changes: 10 additions & 0 deletions libcxxabi/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@ if ( APPLE )
endif()
endif()

if(LIBCXX_ENABLE_LTO)
list(APPEND LIBCXXABI_COMPILE_FLAGS "-flto")
list(APPEND LIBCXXABI_LINK_FLAGS "-flto")
endif()
if(LIBCXX_ENABLE_FATLTO)
list(APPEND LIBCXXABI_COMPILE_FLAGS "-ffat-lto-objects")
list(APPEND LIBCXXABI_LINK_FLAGS "-ffat-lto-objects")
endif()

split_list(LIBCXXABI_COMPILE_FLAGS)
split_list(LIBCXXABI_LINK_FLAGS)

Expand All @@ -154,6 +163,7 @@ endif()

include(WarningFlags)


# Build the shared library.
add_library(cxxabi_shared_objects OBJECT EXCLUDE_FROM_ALL ${LIBCXXABI_SOURCES} ${LIBCXXABI_HEADERS})
cxx_add_warning_flags(cxxabi_shared_objects ${LIBCXXABI_ENABLE_WERROR} ${LIBCXXABI_ENABLE_PEDANTIC})
Expand Down

0 comments on commit 1dafa52

Please sign in to comment.