Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Commit 0d56023

Browse files
authored
build: make the CTensorFlow module more SPM friendly (#1123)
Add the structure expected by SPM to enable building the CTensorFlow module as part of a Swift Package. It is no longer possible to build this package without X10 support.
1 parent cb61731 commit 0d56023

File tree

5 files changed

+39
-10
lines changed

5 files changed

+39
-10
lines changed

Sources/CTensorFlow/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
add_library(CTensorFlow INTERFACE)
22
if(NOT USE_BUNDLED_CTENSORFLOW)
33
target_include_directories(CTensorFlow INTERFACE
4-
${CMAKE_CURRENT_SOURCE_DIR})
4+
${CMAKE_CURRENT_SOURCE_DIR}/include)
55
endif()
66
target_link_directories(CTensorFlow INTERFACE
77
$<TARGET_FILE_DIR:x10>)
@@ -10,7 +10,7 @@ target_link_libraries(CTensorFlow INTERFACE
1010

1111
list(GET X10_INCLUDE_DIRS 0 X10_SOURCE_DIR)
1212

13-
install(FILES module.modulemap CTensorFlow.h
13+
install(FILES include/module.modulemap include/CTensorFlow.h
1414
DESTINATION lib/swift/tensorflow)
1515
install(DIRECTORY ${X10_SOURCE_DIR}/tensorflow/c
1616
DESTINATION lib/swift/tensorflow

Sources/CTensorFlow/CTensorFlow.c

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2020 TensorFlow Authors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#include "CTensorFlow.h"

Sources/CTensorFlow/CTensorFlow.h

-8
This file was deleted.
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2020 TensorFlow Authors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef CTensorFlow_CTensorFlow_h
16+
#define CTensorFlow_CTensorFlow_h
17+
18+
#include <tensorflow/c/c_api.h>
19+
#include <tensorflow/c/c_api_experimental.h>
20+
#include <tensorflow/c/eager/c_api.h>
21+
22+
#endif

0 commit comments

Comments
 (0)