aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/cmake/tf_cc_ops.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/contrib/cmake/tf_cc_ops.cmake')
-rw-r--r--tensorflow/contrib/cmake/tf_cc_ops.cmake36
1 files changed, 12 insertions, 24 deletions
diff --git a/tensorflow/contrib/cmake/tf_cc_ops.cmake b/tensorflow/contrib/cmake/tf_cc_ops.cmake
index 6e2ac203f9..45eeb11062 100644
--- a/tensorflow/contrib/cmake/tf_cc_ops.cmake
+++ b/tensorflow/contrib/cmake/tf_cc_ops.cmake
@@ -148,11 +148,7 @@ list(REMOVE_ITEM tf_cc_srcs ${tf_cc_test_srcs})
add_library(tf_cc OBJECT ${tf_cc_srcs})
add_dependencies(tf_cc tf_cc_framework tf_cc_ops)
-if (WIN32)
- set (pywrap_tensorflow_lib "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/pywrap_tensorflow_internal.lib")
-else (WIN32)
- set (pywrap_tensorflow_lib "${CMAKE_CURRENT_BINARY_DIR}/libpywrap_tensorflow_internal.so")
-endif (WIN32)
+set (pywrap_tensorflow_lib "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/pywrap_tensorflow_internal.lib")
add_custom_target(tf_extension_ops)
function(AddUserOps)
@@ -168,13 +164,15 @@ function(AddUserOps)
# create shared library from source and cuda obj
add_library(${_AT_TARGET} SHARED ${_AT_SOURCES} ${gpu_lib})
target_link_libraries(${_AT_TARGET} ${pywrap_tensorflow_lib})
- if (tensorflow_ENABLE_GPU AND _AT_GPUSOURCES)
- # some ops call out to cuda directly; need to link libs for the cuda dlls
- target_link_libraries(${_AT_TARGET} ${CUDA_LIBRARIES})
- endif()
- if (_AT_DISTCOPY)
- add_custom_command(TARGET ${_AT_TARGET} POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${_AT_TARGET}> ${_AT_DISTCOPY}/)
+ if(WIN32)
+ if (tensorflow_ENABLE_GPU AND _AT_GPUSOURCES)
+ # some ops call out to cuda directly; need to link libs for the cuda dlls
+ target_link_libraries(${_AT_TARGET} ${CUDA_LIBRARIES})
+ endif()
+ if (_AT_DISTCOPY)
+ add_custom_command(TARGET ${_AT_TARGET} POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${_AT_TARGET}> ${_AT_DISTCOPY}/)
+ endif()
endif()
if (_AT_DEPENDS)
add_dependencies(${_AT_TARGET} ${_AT_DEPENDS})
@@ -182,19 +180,9 @@ function(AddUserOps)
# make sure TF_COMPILE_LIBRARY is not defined for this target
get_target_property(target_compile_flags ${_AT_TARGET} COMPILE_FLAGS)
if(target_compile_flags STREQUAL "target_compile_flags-NOTFOUND")
- if (WIN32)
- set(target_compile_flags "/UTF_COMPILE_LIBRARY")
- else (WIN32)
- # gcc uses UTF as default
- set(target_compile_flags "-finput-charset=UTF-8")
- endif (WIN32)
+ set(target_compile_flags "/UTF_COMPILE_LIBRARY")
else()
- if (WIN32)
- set(target_compile_flags "${target_compile_flags} /UTF_COMPILE_LIBRARY")
- else (WIN32)
- # gcc uses UTF as default
- set(target_compile_flags "${target_compile_flags} -finput-charset=UTF-8")
- endif (WIN32)
+ set(target_compile_flags "${target_compile_flags} /UTF_COMPILE_LIBRARY")
endif()
set_target_properties(${_AT_TARGET} PROPERTIES COMPILE_FLAGS ${target_compile_flags})
add_dependencies(tf_extension_ops ${_AT_TARGET})