File tree 3 files changed +37
-0
lines changed
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)
46
46
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /bin)
47
47
set (CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR} /swift)
48
48
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
+
49
54
set (CMAKE_POSITION_INDEPENDENT_CODE YES )
50
55
51
56
# Fetchable dependcies
Original file line number Diff line number Diff line change @@ -18,3 +18,6 @@ add_subdirectory(_CFURLSessionInterface)
18
18
add_subdirectory (Foundation)
19
19
add_subdirectory (FoundationXML)
20
20
add_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