File tree Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,11 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
4646set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /bin)
4747set (CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR} /swift)
4848
49+ # Optionally build tools (on by default) but only when building shared libraries
50+ if (BUILD_SHARED_LIBS )
51+ option (FOUNDATION_BUILD_TOOLS "build tools" ON )
52+ endif ()
53+
4954set (CMAKE_POSITION_INDEPENDENT_CODE YES )
5055
5156# Fetchable dependcies
Original file line number Diff line number Diff line change @@ -18,3 +18,6 @@ add_subdirectory(_CFURLSessionInterface)
1818add_subdirectory (Foundation)
1919add_subdirectory (FoundationXML)
2020add_subdirectory (FoundationNetworking)
21+ if (FOUNDATION_BUILD_TOOLS)
22+ add_subdirectory (plutil)
23+ endif ()
Original file line number Diff line number Diff line change 1+ ##===----------------------------------------------------------------------===##
2+ ##
3+ ## This source file is part of the Swift open source project
4+ ##
5+ ## Copyright (c) 2024 Apple Inc. and the Swift project authors
6+ ## Licensed under Apache License v2.0
7+ ##
8+ ## See LICENSE.txt for license information
9+ ## See CONTRIBUTORS.md for the list of Swift project authors
10+ ##
11+ ## SPDX-License-Identifier: Apache-2.0
12+ ##
13+ ##===----------------------------------------------------------------------===##
14+
15+ add_executable (plutil
16+ main.swift)
17+
18+ target_link_libraries (plutil PRIVATE
19+ Foundation)
20+
21+ target_link_options (plutil PRIVATE
22+ "SHELL:-no-toolchain-stdlib-rpath" )
23+
24+ set_target_properties (plutil PROPERTIES
25+ INSTALL_RPATH "$ORIGIN/../lib/swift/${SWIFT_SYSTEM_NAME} " )
26+
27+ set_property (GLOBAL APPEND PROPERTY Foundation_EXPORTS plutil)
28+ install (TARGETS plutil
29+ DESTINATION ${CMAKE_INSTALL_BINDIR} )
You can’t perform that action at this time.
0 commit comments