2017-03-27 18:46:19 +00:00
|
|
|
project(libcxx)
|
|
|
|
|
2020-11-10 17:18:09 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdinc -std=c++11 -fvisibility=hidden -fvisibility-inlines-hidden")
|
2017-03-27 18:46:19 +00:00
|
|
|
|
|
|
|
include_directories(
|
|
|
|
BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
|
|
)
|
|
|
|
|
2024-11-01 05:30:49 +00:00
|
|
|
add_definitions(-D_LIBCPP_BUILDING_LIBRARY=1 -DLIBCXX_BUILDING_LIBCXXABI=1)
|
2017-03-27 18:46:19 +00:00
|
|
|
|
|
|
|
set(cxx_sources
|
|
|
|
src/algorithm.cpp
|
|
|
|
src/any.cpp
|
2022-06-26 23:57:40 +00:00
|
|
|
src/atomic.cpp
|
|
|
|
src/barrier.cpp
|
2017-03-27 18:46:19 +00:00
|
|
|
src/bind.cpp
|
2020-04-17 13:03:49 +00:00
|
|
|
src/charconv.cpp
|
|
|
|
src/chrono.cpp
|
2017-03-27 18:46:19 +00:00
|
|
|
src/condition_variable.cpp
|
2020-04-17 13:03:49 +00:00
|
|
|
src/condition_variable_destructor.cpp
|
2017-03-27 18:46:19 +00:00
|
|
|
src/debug.cpp
|
|
|
|
src/exception.cpp
|
2022-06-26 23:57:40 +00:00
|
|
|
src/format.cpp
|
2020-04-17 13:03:49 +00:00
|
|
|
src/functional.cpp
|
2017-03-27 18:46:19 +00:00
|
|
|
src/future.cpp
|
|
|
|
src/hash.cpp
|
|
|
|
src/ios.cpp
|
2022-06-26 23:57:40 +00:00
|
|
|
src/ios.instantiations.cpp
|
2017-03-27 18:46:19 +00:00
|
|
|
src/iostream.cpp
|
|
|
|
src/locale.cpp
|
|
|
|
src/memory.cpp
|
|
|
|
src/mutex.cpp
|
2020-04-17 13:03:49 +00:00
|
|
|
src/mutex_destructor.cpp
|
2017-03-27 18:46:19 +00:00
|
|
|
src/new.cpp
|
|
|
|
src/optional.cpp
|
|
|
|
src/random.cpp
|
2022-06-26 23:57:40 +00:00
|
|
|
src/random_shuffle.cpp
|
2017-03-27 18:46:19 +00:00
|
|
|
src/regex.cpp
|
|
|
|
src/shared_mutex.cpp
|
|
|
|
src/stdexcept.cpp
|
|
|
|
src/string.cpp
|
|
|
|
src/strstream.cpp
|
|
|
|
src/system_error.cpp
|
|
|
|
src/thread.cpp
|
|
|
|
src/typeinfo.cpp
|
|
|
|
src/utility.cpp
|
|
|
|
src/valarray.cpp
|
|
|
|
src/variant.cpp
|
2020-04-17 13:03:49 +00:00
|
|
|
src/vector.cpp
|
2017-03-27 18:46:19 +00:00
|
|
|
)
|
|
|
|
|
2019-08-13 18:08:54 +00:00
|
|
|
add_darling_object_library(cxx_obj ${cxx_sources})
|
2017-03-27 18:46:19 +00:00
|
|
|
make_fat(cxx_obj)
|
|
|
|
|
|
|
|
set(DYLIB_INSTALL_NAME "/usr/lib/libc++.1.dylib")
|
|
|
|
set(DYLIB_COMPAT_VERSION "1.0.0")
|
|
|
|
set(DYLIB_CURRENT_VERSION "1.0.0")
|
|
|
|
|
|
|
|
add_darling_library(cxx SHARED $<TARGET_OBJECTS:cxx_obj>)
|
|
|
|
make_fat(cxx)
|
|
|
|
target_link_libraries(cxx PRIVATE system cxxabi)
|
|
|
|
set_target_properties(cxx PROPERTIES OUTPUT_NAME "c++.1")
|
2020-10-11 09:02:06 +00:00
|
|
|
set_property(TARGET cxx APPEND_STRING PROPERTY LINK_FLAGS " \
|
|
|
|
-Wl,-reexport_library,${CMAKE_BINARY_DIR}/src/external/libcxxabi/libc++abi.dylib \
|
|
|
|
-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/lib/libc++unexp.exp \
|
|
|
|
-Wl,-force_symbols_not_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/lib/notweak.exp \
|
|
|
|
-Wl,-force_symbols_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/lib/weak.exp ")
|
2017-03-27 18:46:19 +00:00
|
|
|
|
2017-03-27 21:43:08 +00:00
|
|
|
install(TARGETS cxx DESTINATION libexec/darling/usr/lib)
|
2017-03-27 18:46:19 +00:00
|
|
|
InstallSymlink("libc++.1.dylib" "${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/lib/libc++.dylib")
|
|
|
|
|
|
|
|
# For dyld only
|
2024-11-01 05:19:51 +00:00
|
|
|
add_darling_static_library(cxx_static SOURCES ${cxx_sources})
|
2017-03-27 18:46:19 +00:00
|
|
|
make_fat(cxx_static)
|
2010-12-10 19:47:54 +00:00
|
|
|
|