Skip to content

Commit 39b2c0d

Browse files
committed
Add CMake Build for IDEUtils
1 parent dd62d3b commit 39b2c0d

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

Sources/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ add_subdirectory(SwiftOperators)
1515
add_subdirectory(SwiftSyntaxBuilder)
1616
add_subdirectory(_SwiftSyntaxMacros)
1717
add_subdirectory(SwiftCompilerSupport)
18+
add_subdirectory(IDEUtils)

Sources/IDEUtils/CMakeLists.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This source file is part of the Swift.org open source project
2+
#
3+
# Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
4+
# Licensed under Apache License v2.0 with Runtime Library Exception
5+
#
6+
# See http://swift.org/LICENSE.txt for license information
7+
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors
8+
9+
add_library(IDEUtils STATIC
10+
gyb_generated/SyntaxClassification.swift
11+
Syntax+Classifications.swift
12+
SyntaxClassifier.swift
13+
)
14+
15+
target_link_libraries(IDEUtils PUBLIC
16+
SwiftSyntax)
17+
18+
set_property(GLOBAL APPEND PROPERTY SWIFTSYNTAX_EXPORTS IDEUtils)
19+
20+
# NOTE: workaround for CMake not setting up include flags yet
21+
set_target_properties(IDEUtils PROPERTIES
22+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
23+
24+
install(TARGETS IDEUtils
25+
EXPORT SwiftSyntaxTargets
26+
ARCHIVE DESTINATION lib
27+
LIBRARY DESTINATION lib
28+
RUNTIME DESTINATION bin)

0 commit comments

Comments
 (0)