Merge pull request 'Add CMake Support' (#1) from Zaph/levenshtein-transformations:main into main
Reviewed-on: #1 Reviewed-by: david-swift <david-swift@noreply.aproksha.uber.space>
This commit is contained in:
commit
2217c71ad8
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,3 +11,4 @@ DerivedData/
|
||||
.swiftpm/config/registries.json
|
||||
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
|
||||
.netrc
|
||||
/.vscode
|
||||
|
||||
16
CMakeLists.txt
Normal file
16
CMakeLists.txt
Normal file
@ -0,0 +1,16 @@
|
||||
cmake_minimum_required(VERSION 3.29)
|
||||
cmake_policy(SET CMP0157 NEW)
|
||||
|
||||
project(LevenshteinTransformations
|
||||
LANGUAGES Swift)
|
||||
|
||||
set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
add_subdirectory(Sources)
|
||||
|
||||
if(CMAKE_PROJECT_NAME STREQUAL "LevenshteinTransformations")
|
||||
add_subdirectory(Tests)
|
||||
endif()
|
||||
@ -23,12 +23,18 @@ let package = Package(
|
||||
],
|
||||
targets: [
|
||||
.target(
|
||||
name: "LevenshteinTransformations"
|
||||
name: "LevenshteinTransformations",
|
||||
exclude: [
|
||||
"CMakeLists.txt"
|
||||
]
|
||||
),
|
||||
.executableTarget(
|
||||
name: "LevenshteinTransformationsTests",
|
||||
dependencies: ["LevenshteinTransformations"],
|
||||
path: "Tests"
|
||||
path: "Tests",
|
||||
exclude: [
|
||||
"CMakeLists.txt"
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
1
Sources/CMakeLists.txt
Normal file
1
Sources/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
||||
add_subdirectory(LevenshteinTransformations)
|
||||
15
Sources/LevenshteinTransformations/CMakeLists.txt
Normal file
15
Sources/LevenshteinTransformations/CMakeLists.txt
Normal file
@ -0,0 +1,15 @@
|
||||
add_library(LevenshteinTransformations
|
||||
Extensions/Array.swift
|
||||
Extensions/String.swift
|
||||
AsyncFunctions.swift
|
||||
EditOperation.swift
|
||||
Functions.swift
|
||||
LevenshteinTransformations.swift
|
||||
Transformation.swift
|
||||
)
|
||||
|
||||
install(TARGETS LevenshteinTransformations
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
)
|
||||
11
Tests/CMakeLists.txt
Normal file
11
Tests/CMakeLists.txt
Normal file
@ -0,0 +1,11 @@
|
||||
add_executable(Tests
|
||||
LevenshteinTransformationsTests.swift
|
||||
)
|
||||
|
||||
target_compile_options(Tests PUBLIC
|
||||
-parse-as-library
|
||||
)
|
||||
|
||||
target_link_libraries(Tests PRIVATE
|
||||
LevenshteinTransformations
|
||||
)
|
||||
Loading…
x
Reference in New Issue
Block a user