@@ -83,6 +83,10 @@ endfunction()
83
83
84
84
# Link against a system-provided libstdc++
85
85
if ("${LIBCXX_CXX_ABI} " STREQUAL "libstdc++" )
86
+ if (NOT LIBCXX_CXX_ABI_INCLUDE_PATHS )
87
+ message (FATAL_ERROR "LIBCXX_CXX_ABI_INCLUDE_PATHS must be set when selecting libstdc++ as an ABI library" )
88
+ endif ()
89
+
86
90
add_library (libcxx-abi-headers INTERFACE )
87
91
import_private_headers (libcxx-abi-headers "${LIBCXX_CXX_ABI_INCLUDE_PATHS} "
88
92
"cxxabi.h;bits/c++config.h;bits/os_defines.h;bits/cpu_defines.h;bits/cxxabi_tweaks.h;bits/cxxabi_forced.h" )
@@ -96,6 +100,10 @@ if ("${LIBCXX_CXX_ABI}" STREQUAL "libstdc++")
96
100
97
101
# Link against a system-provided libsupc++
98
102
elseif ("${LIBCXX_CXX_ABI} " STREQUAL "libsupc++" )
103
+ if (NOT LIBCXX_CXX_ABI_INCLUDE_PATHS )
104
+ message (FATAL_ERROR "LIBCXX_CXX_ABI_INCLUDE_PATHS must be set when selecting libsupc++ as an ABI library" )
105
+ endif ()
106
+
99
107
add_library (libcxx-abi-headers INTERFACE )
100
108
import_private_headers (libcxx-abi-headers "${LIBCXX_CXX_ABI_INCLUDE_PATHS} "
101
109
"cxxabi.h;bits/c++config.h;bits/os_defines.h;bits/cpu_defines.h;bits/cxxabi_tweaks.h;bits/cxxabi_forced.h" )
@@ -114,7 +122,18 @@ elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libcxxabi")
114
122
target_compile_definitions (libcxx-abi-headers INTERFACE "-DLIBCXX_BUILDING_LIBCXXABI" )
115
123
116
124
if (TARGET cxxabi_shared )
117
- add_library (libcxx-abi-shared ALIAS cxxabi_shared )
125
+ add_library (libcxx-abi-shared INTERFACE )
126
+ target_link_libraries (libcxx-abi-shared INTERFACE cxxabi_shared )
127
+
128
+ # When using the in-tree libc++abi as an ABI library, libc++ re-exports the
129
+ # libc++abi symbols (on platforms where it can) because libc++abi is only an
130
+ # implementation detail of libc++.
131
+ target_link_libraries (libcxx-abi-shared INTERFACE cxxabi-reexports )
132
+
133
+ # Populate the OUTPUT_NAME property of libcxx-abi-shared because that is used when
134
+ # generating a linker script.
135
+ get_target_property (_output_name cxxabi_shared OUTPUT_NAME )
136
+ set_target_properties (libcxx-abi-shared PROPERTIES "OUTPUT_NAME" "${_output_name} " )
118
137
endif ()
119
138
120
139
if (TARGET cxxabi_static )
@@ -131,6 +150,10 @@ elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libcxxabi")
131
150
132
151
# Link against a system-provided libc++abi
133
152
elseif ("${LIBCXX_CXX_ABI} " STREQUAL "system-libcxxabi" )
153
+ if (NOT LIBCXX_CXX_ABI_INCLUDE_PATHS )
154
+ message (FATAL_ERROR "LIBCXX_CXX_ABI_INCLUDE_PATHS must be set when selecting system-libcxxabi as an ABI library" )
155
+ endif ()
156
+
134
157
add_library (libcxx-abi-headers INTERFACE )
135
158
import_private_headers (libcxx-abi-headers "${LIBCXX_CXX_ABI_INCLUDE_PATHS} " "cxxabi.h;__cxxabi_config.h" )
136
159
target_compile_definitions (libcxx-abi-headers INTERFACE "-DLIBCXX_BUILDING_LIBCXXABI" )
0 commit comments