Skip to content

Copy sources from Differentiation before building #34193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 37 additions & 8 deletions stdlib/public/Differentiation_NoTgMath/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,45 @@
#===--- CMakeLists.txt - Differentiable programming support library ------===#
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2019 - 2020 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
#
#===----------------------------------------------------------------------===#

set(SOURCES_FOLDER ../Differentiation)

set(DIFF_SOURCE_FILES
Differentiable.swift
DifferentialOperators.swift
DifferentiationUtilities.swift
AnyDifferentiable.swift
ArrayDifferentiation.swift
OptionalDifferentiation.swift)

set(GYB_SOURCE_FILES
FloatingPointDifferentiation.swift.gyb
SIMDDifferentiation.swift.gyb)

# The logic handling gyb files gets confused if we want to pull the sources
# directly from ../Differentiation -- for now prefer copying those files
# in the current source directory
# A better solution would be to use symlinks, however
# those could not readily available under Windows
# (see https://github.com/git-for-windows/git/wiki/Symbolic-Links)
foreach(CURRENT_FILE IN LISTS DIFF_SOURCE_FILES GYB_SOURCE_FILES)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${SOURCES_FOLDER}/${CURRENT_FILE}
${CMAKE_CURRENT_SOURCE_DIR} COPYONLY)
endforeach()

add_swift_target_library(swift_Differentiation ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
${SOURCES_FOLDER}/Differentiable.swift
${SOURCES_FOLDER}/DifferentialOperators.swift
${SOURCES_FOLDER}/DifferentiationUtilities.swift
${SOURCES_FOLDER}/AnyDifferentiable.swift
${SOURCES_FOLDER}/ArrayDifferentiation.swift
${SOURCES_FOLDER}/OptionalDifferentiation.swift
${DIFF_SOURCE_FILES}

GYB_SOURCES
${SOURCES_FOLDER}/FloatingPointDifferentiation.swift.gyb
${SOURCES_FOLDER}/SIMDDifferentiation.swift.gyb
${GYB_SOURCE_FILES}

SWIFT_COMPILE_FLAGS
${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
Expand Down