Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dependency on swift-system #1494

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ find_package(dispatch QUIET)
find_package(Foundation QUIET)
find_package(Yams CONFIG REQUIRED)
find_package(ArgumentParser CONFIG REQUIRED)
find_package(SwiftSystem CONFIG REQUIRED)

add_subdirectory(Sources)
add_subdirectory(cmake/modules)
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ all with CMake:
```
cmake -B <llbuild-build-dir> -G Ninja <llbuild-source-dir> -DLLBUILD_SUPPORT_BINDINGS="Swift" -DCMAKE_OSX_ARCHITECTURES=x86_64
```
* [swift-system](https://github.com/apple/swift-system)
* [swift-argument-parser](https://github.com/apple/swift-argument-parser)
* [Yams](https://github.com/jpsim/Yams)

Expand Down
32 changes: 2 additions & 30 deletions Utilities/build-script-helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ def install_swiftdriver(args, build_dir, prefix, targets) :
# swift-driver: SwiftDriver.swiftmodule, SwiftOptions.swiftmodule
# swift-tools-support-core: TSCUtility.swiftmodule, TSCBasic.swiftmodule
# swift-argument-parser: ArgumentParser.swiftmodule (disabled until needed)
# swift-system: SystemPackage.swiftmodule
install_binary_swift_modules(args, build_dir, install_lib, targets)

# Modulemaps for C Modules:
Expand Down Expand Up @@ -324,11 +323,6 @@ def install_libraries(args, build_dir, universal_lib_dir, toolchain_lib_dir, tar
install_library(args, build_dir, package_subpath, lib, shared_lib_ext,
universal_lib_dir, toolchain_lib_dir, 'swift-tools-support-core', targets)

# Install the swift-system shared library into the toolchain lib
package_subpath = os.path.join(args.configuration, 'dependencies', 'swift-system')
install_library(args, build_dir, package_subpath, 'libSystemPackage', shared_lib_ext,
universal_lib_dir, toolchain_lib_dir, 'swift-system', targets)

# Install the swift-argument-parser shared libraries into the toolchain lib
package_subpath = os.path.join(args.configuration, 'dependencies', 'swift-argument-parser')
for (lib, ext) in [('libArgumentParser', shared_lib_ext), ('libArgumentParserToolInfo', static_lib_ext)]:
Expand Down Expand Up @@ -376,11 +370,6 @@ def install_binary_swift_modules(args, build_dir, toolchain_lib_dir, targets):
product_subpath)
install_module(args, build_dir, package_subpath, toolchain_lib_dir, 'ArgumentParser', targets)

# swift-system
package_subpath = os.path.join(args.configuration, 'dependencies', 'swift-system',
product_subpath)
install_module(args, build_dir, package_subpath, toolchain_lib_dir, 'SystemPackage', targets)


# Install the modulemaps and headers of the driver's C module dependencies into the toolchain
# include directory
Expand Down Expand Up @@ -442,9 +431,6 @@ def build_using_cmake(args, toolchain_bin, build_dir, targets):
# LLBuild
build_llbuild_using_cmake(args, target, swiftc_exec, dependencies_dir,
base_cmake_flags, swift_flags)
# SwiftSystem
build_system_using_cmake(args, target, swiftc_exec, dependencies_dir,
base_cmake_flags, swift_flags)

# TSC
build_tsc_using_cmake(args, target, swiftc_exec, dependencies_dir,
Expand Down Expand Up @@ -485,24 +471,11 @@ def build_llbuild_using_cmake(args, target, swiftc_exec, build_dir, base_cmake_f
cmake_build(args, swiftc_exec, llbuild_cmake_flags, llbuild_swift_flags,
llbuild_source_dir, llbuild_build_dir, 'products/all')

def build_system_using_cmake(args, target, swiftc_exec, build_dir, base_cmake_flags, swift_flags):
print('Building Swift Driver dependency: Swift System')
system_source_dir = os.path.join(os.path.dirname(args.package_path), 'swift-system')
system_build_dir = os.path.join(build_dir, 'swift-system')
flags = [
# required due to swift-autolink-extract bug ("The file was not recognized as a valid object file")
"-DBUILD_SHARED_LIBS=YES"]
system_cmake_flags = base_cmake_flags + flags
system_swift_flags = swift_flags[:]
cmake_build(args, swiftc_exec, system_cmake_flags, system_swift_flags,
system_source_dir, system_build_dir)

def build_tsc_using_cmake(args, target, swiftc_exec, build_dir, base_cmake_flags, swift_flags):
print('Building Swift Driver dependency: TSC')
tsc_source_dir = os.path.join(os.path.dirname(args.package_path), 'swift-tools-support-core')
tsc_build_dir = os.path.join(build_dir, 'swift-tools-support-core')
flags = [
'-DSwiftSystem_DIR=' + os.path.join(os.path.join(build_dir, 'swift-system'), 'cmake/modules')]
flags = []
tsc_cmake_flags = base_cmake_flags + flags

tsc_swift_flags = swift_flags[:]
Expand Down Expand Up @@ -550,8 +523,7 @@ def build_swift_driver_using_cmake(args, target, swiftc_exec, build_dir, base_cm
'-DLLBuild_DIR=' + os.path.join(os.path.join(dependencies_dir, 'llbuild'), 'cmake/modules'),
'-DTSC_DIR=' + os.path.join(os.path.join(dependencies_dir, 'swift-tools-support-core'), 'cmake/modules'),
'-DYams_DIR=' + os.path.join(os.path.join(dependencies_dir, 'yams'), 'cmake/modules'),
'-DArgumentParser_DIR=' + os.path.join(os.path.join(dependencies_dir, 'swift-argument-parser'), 'cmake/modules'),
'-DSwiftSystem_DIR=' + os.path.join(os.path.join(dependencies_dir, 'swift-system'), 'cmake/modules')]
'-DArgumentParser_DIR=' + os.path.join(os.path.join(dependencies_dir, 'swift-argument-parser'), 'cmake/modules')]
driver_cmake_flags = base_cmake_flags + flags
cmake_build(args, swiftc_exec, driver_cmake_flags, driver_swift_flags,
driver_source_dir, driver_build_dir)
Expand Down