aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/cmake/tf_python.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/contrib/cmake/tf_python.cmake')
-rwxr-xr-xtensorflow/contrib/cmake/tf_python.cmake39
1 files changed, 20 insertions, 19 deletions
diff --git a/tensorflow/contrib/cmake/tf_python.cmake b/tensorflow/contrib/cmake/tf_python.cmake
index 35629ba3b3..983f976c95 100755
--- a/tensorflow/contrib/cmake/tf_python.cmake
+++ b/tensorflow/contrib/cmake/tf_python.cmake
@@ -686,19 +686,7 @@ set (pywrap_tensorflow_internal_src
"${tensorflow_source_dir}/tensorflow/python/lib/io/py_record_writer.cc"
"${tensorflow_source_dir}/tensorflow/python/util/kernel_registry.h"
"${tensorflow_source_dir}/tensorflow/python/util/kernel_registry.cc"
- "${tensorflow_source_dir}/tensorflow/c/c_api.cc"
- "${tensorflow_source_dir}/tensorflow/c/c_api.h"
- "${tensorflow_source_dir}/tensorflow/c/checkpoint_reader.cc"
- "${tensorflow_source_dir}/tensorflow/c/checkpoint_reader.h"
- "${tensorflow_source_dir}/tensorflow/c/tf_status_helper.cc"
- "${tensorflow_source_dir}/tensorflow/c/tf_status_helper.h"
- "${tensorflow_source_dir}/tensorflow/cc/framework/gradients.h"
- "${tensorflow_source_dir}/tensorflow/cc/framework/gradients.cc"
- "${tensorflow_source_dir}/tensorflow/cc/framework/grad_op_registry.h"
- "${tensorflow_source_dir}/tensorflow/cc/framework/grad_op_registry.cc"
- "${tensorflow_source_dir}/tensorflow/cc/framework/ops.h"
"${tensorflow_source_dir}/tensorflow/cc/framework/ops.cc"
- "${tensorflow_source_dir}/tensorflow/cc/framework/scope_internal.h"
"${tensorflow_source_dir}/tensorflow/cc/framework/scope.cc"
"${CMAKE_CURRENT_BINARY_DIR}/pywrap_tensorflow_internal.cc"
)
@@ -715,9 +703,11 @@ if(WIN32)
#
add_library(pywrap_tensorflow_internal_static STATIC
${pywrap_tensorflow_internal_src}
+ $<TARGET_OBJECTS:tf_c>
$<TARGET_OBJECTS:tf_core_lib>
$<TARGET_OBJECTS:tf_core_cpu>
$<TARGET_OBJECTS:tf_core_framework>
+ $<TARGET_OBJECTS:tf_cc>
$<TARGET_OBJECTS:tf_cc_ops>
$<TARGET_OBJECTS:tf_core_ops>
$<TARGET_OBJECTS:tf_core_direct_session>
@@ -727,33 +717,43 @@ if(WIN32)
$<$<BOOL:${tensorflow_ENABLE_GPU}>:$<TARGET_OBJECTS:tf_core_kernels_cpu_only>>
$<$<BOOL:${tensorflow_ENABLE_GPU}>:$<TARGET_OBJECTS:tf_stream_executor>>
)
+
target_include_directories(pywrap_tensorflow_internal_static PUBLIC
${PYTHON_INCLUDE_DIR}
${NUMPY_INCLUDE_DIR}
)
- target_link_libraries(pywrap_tensorflow_internal_static
- tf_protos_cc
- tf_python_protos_cc
+ #target_link_libraries(pywrap_tensorflow_internal_static
+ # tf_protos_cc
+ # tf_python_protos_cc
+ #)
+ add_dependencies(pywrap_tensorflow_internal_static tf_protos_cc tf_python_protos_cc)
+ set(pywrap_tensorflow_internal_static_dependencies
+ $<TARGET_FILE:pywrap_tensorflow_internal_static>
+ $<TARGET_FILE:tf_protos_cc>
+ $<TARGET_FILE:tf_python_protos_cc>
)
+
set(pywrap_tensorflow_deffile "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/pywrap_tensorflow.def")
set_source_files_properties(${pywrap_tensorflow_deffile} PROPERTIES GENERATED TRUE)
add_custom_command(TARGET pywrap_tensorflow_internal_static POST_BUILD
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tools/create_def_file.py
- --input $<TARGET_FILE:pywrap_tensorflow_internal_static>
- --output ${pywrap_tensorflow_deffile}
+ --input "${pywrap_tensorflow_internal_static_dependencies}"
+ --output "${pywrap_tensorflow_deffile}"
+ --target _pywrap_tensorflow_internal.pyd
)
endif(WIN32)
-
# pywrap_tensorflow_internal is a shared library containing all of the
# TensorFlow runtime and the standard ops and kernels. These are installed into
# tf_python/tensorflow/python/.
add_library(pywrap_tensorflow_internal SHARED
${pywrap_tensorflow_internal_src}
+ $<TARGET_OBJECTS:tf_c>
$<TARGET_OBJECTS:tf_core_lib>
$<TARGET_OBJECTS:tf_core_cpu>
$<TARGET_OBJECTS:tf_core_framework>
+ $<TARGET_OBJECTS:tf_cc>
$<TARGET_OBJECTS:tf_cc_ops>
$<TARGET_OBJECTS:tf_core_ops>
$<TARGET_OBJECTS:tf_core_direct_session>
@@ -773,7 +773,8 @@ target_include_directories(pywrap_tensorflow_internal PUBLIC
${PYTHON_INCLUDE_DIR}
${NUMPY_INCLUDE_DIR}
)
-target_link_libraries(pywrap_tensorflow_internal
+
+target_link_libraries(pywrap_tensorflow_internal PRIVATE
${tf_core_gpu_kernels_lib}
${tensorflow_EXTERNAL_LIBRARIES}
tf_protos_cc