-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathCMakeLists.txt
43 lines (39 loc) · 1.41 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#[[
This source file is part of the Swift open source project
Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception
See http://swift.org/LICENSE.txt for license information
See http://swift.org/CONTRIBUTORS.txt for Swift project authors
]]
file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}"
_SWBQNXPlatform_NATIVE_CMAKE_CURRENT_BINARY_DIR)
file(CONFIGURE
OUTPUT resource_bundle_accessor.swift
CONTENT [[
import Foundation
extension Foundation.Bundle {
static let module: Bundle = {
let mainPath = Bundle.main.bundleURL.appendingPathComponent("SwiftBuild_SWBQNXPlatform.resources").path
let buildPath = #"@_SWBQNXPlatform_NATIVE_CMAKE_CURRENT_BINARY_DIR@\SwiftBuild_SWBQNXPlatform.resources"#
let preferredBundle = Bundle(path: mainPath)
guard let bundle = preferredBundle ?? Bundle(path: buildPath) else {
Swift.fatalError("could not load resource bundle: from \(mainPath) or \(buildPath)")
}
return bundle
}()
}
]]
ESCAPE_QUOTES @ONLY NEWLINE_STYLE LF)
add_library(SWBQNXPlatform STATIC
Plugin.swift
QNXSDP.swift)
target_link_libraries(SWBQNXPlatform PUBLIC
SWBCore
SWBMacro
SWBUtil)
target_sources(SWBQNXPlatform PRIVATE
"${CMAKE_CURRENT_BINARY_DIR}/resource_bundle_accessor.swift")
SwiftBuild_Bundle(MODULE SWBQNXPlatform FILES
QNX.xcspec
QNXCompile.xcspec
QNXLibtool.xcspec)