提交 dbd0075b 编写于 作者: D dzhwinter

Merge branch 'windows/support' into lb

...@@ -309,7 +309,7 @@ function(cc_test TARGET_NAME) ...@@ -309,7 +309,7 @@ function(cc_test TARGET_NAME)
if(WIN32) if(WIN32)
target_link_libraries(${TARGET_NAME} ${cc_test_DEPS} paddle_gtest_main lod_tensor memory gtest gflags glog shlwapi openblas) target_link_libraries(${TARGET_NAME} ${cc_test_DEPS} paddle_gtest_main lod_tensor memory gtest gflags glog shlwapi openblas)
else(WIN32) else(WIN32)
target_link_libraries(${TARGET_NAME} ${cc_test_DEPS} paddle_gtest_main lod_tensor memory gtest gflags glog openblas) target_link_libraries(${TARGET_NAME} ${cc_test_DEPS} paddle_gtest_main lod_tensor memory gtest gflags glog)
endif(WIN32) endif(WIN32)
add_dependencies(${TARGET_NAME} ${cc_test_DEPS} paddle_gtest_main lod_tensor memory gtest gflags glog) add_dependencies(${TARGET_NAME} ${cc_test_DEPS} paddle_gtest_main lod_tensor memory gtest gflags glog)
add_test(NAME ${TARGET_NAME} add_test(NAME ${TARGET_NAME}
......
...@@ -51,11 +51,18 @@ function(copy TARGET) ...@@ -51,11 +51,18 @@ function(copy TARGET)
COMMAND ${CMAKE_COMMAND} -E copy "${src_file}" "${dst}" COMMAND ${CMAKE_COMMAND} -E copy "${src_file}" "${dst}"
COMMENT "copying ${src_file} -> ${dst}") COMMENT "copying ${src_file} -> ${dst}")
endforeach() endforeach()
else() # not windows else(WIN32) # not windows
add_custom_command(TARGET ${TARGET} PRE_BUILD add_custom_command(TARGET ${TARGET} PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "${dst}" COMMAND mkdir -p "${dst}"
COMMAND ${CMAKE_COMMAND} -E copy "${src_files}" "${dst}" COMMAND cp -r "${src}" "${dst}"
COMMENT "copying ${src} -> ${dst}") COMMENT "copying ${src} -> ${dst}")
#add_custom_command(TARGET ${TARGET} PRE_BUILD
# COMMAND ${CMAKE_COMMAND} -E make_directory "${dst}")
#message("mkdir " ${TARGET})
#add_custom_command(TARGET ${TARGET} PRE_BUILD
# COMMAND ${CMAKE_COMMAND} -E make_directory "${dst}"
# COMMAND ${CMAKE_COMMAND} -E copy_directory "${src_files}" "${dst}"
# COMMENT "copying ${src} -> ${dst}")
endif(WIN32) endif(WIN32)
endforeach() endforeach()
endfunction() endfunction()
......
...@@ -17,8 +17,9 @@ limitations under the License. */ ...@@ -17,8 +17,9 @@ limitations under the License. */
namespace paddle { namespace paddle {
namespace framework { namespace framework {
namespace ir { namespace ir {
// msvc15 don't support constexpr in correct way.
#if !defined(_WIN32) #if !defined(_WIN32)
constexpr char Node::kControlDepVarName[] = "__control_var"; constexpr char Node::kControlDepVarName[];
#else #else
const char Node::kControlDepVarName[] = "__control_var"; const char Node::kControlDepVarName[] = "__control_var";
#endif #endif
......
...@@ -49,7 +49,7 @@ class SaveCombineOp : public framework::OperatorBase { ...@@ -49,7 +49,7 @@ class SaveCombineOp : public framework::OperatorBase {
} }
MkDirRecursively(DirName(filename).c_str()); MkDirRecursively(DirName(filename).c_str());
std::ofstream fout(filename); std::ofstream fout(filename, std::ios_base::out | std::ios_base::binary);
PADDLE_ENFORCE(static_cast<bool>(fout), "Cannot open %s to write", PADDLE_ENFORCE(static_cast<bool>(fout), "Cannot open %s to write",
filename); filename);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册