Meta+Libraries+AK: Append Cxx to imported library module names in swift

At the same time, simplify CMakeLists magic for libraries that want to
include Swift code in the library. The Lib-less name of the library is
now always the module name for the library with any Swift additions,
extensions, etc. All vfs overlays now live in a common location to make
finding them easier from CMake functions. A new pattern is needed for
the Lib-less modules to re-export their Cxx counterparts.
This commit is contained in:
Andrew Kaster
2024-08-26 19:04:05 -06:00
committed by Andrew Kaster
parent f27d638e0a
commit c5153cb398
13 changed files with 68 additions and 80 deletions

View File

@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
import AK
@_exported import AKCxx
import Foundation
public extension Foundation.Data {

View File

@@ -62,14 +62,11 @@ swizzle_target_properties_for_swift(simdutf::simdutf)
target_link_libraries(AK PRIVATE simdutf::simdutf)
if (ENABLE_SWIFT)
generate_clang_module_map(
AK
generate_clang_module_map(AK
GENERATED_FILES
"${CMAKE_CURRENT_BINARY_DIR}/Backtrace.h"
"${CMAKE_CURRENT_BINARY_DIR}/Debug.h"
)
target_compile_features(AK PUBLIC cxx_std_23)
set_target_properties(AK PROPERTIES Swift_MODULE_NAME SwiftAK)
target_sources(AK PRIVATE AK+Swift.swift)
add_swift_target_properties(AK)
endif()