aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorLaszlo Csomor <laszlocsomor@google.com>2017-03-30 14:12:44 +0200
committerLaszlo Csomor <laszlocsomor@google.com>2017-07-11 08:31:54 +0200
commite05e777d468c2486cea53764f1ac70859b5e98c4 (patch)
tree77cf85f401633bf95a42c4556dfe0e54878b9cec /cmake
parent9ab7c73f7c989afa777a40ff2a7c5f0f138be22c (diff)
downloadprotobuf-e05e777d468c2486cea53764f1ac70859b5e98c4.tar.gz
protobuf-e05e777d468c2486cea53764f1ac70859b5e98c4.tar.bz2
protobuf-e05e777d468c2486cea53764f1ac70859b5e98c4.zip
Windows: support long paths
Add implementations of open(2), mkdir(2), stat(2), etc. that support long paths under Windows (paths longer than MAX_PATH in <windows.h>, which is 260 characters). The implementations are in a separate namespace (google::protobuf::internal::win32), so they won't collide with the standard implementations in <io.h>, but after importing them with `using` they can be drop-in replacements. Fixes https://github.com/bazelbuild/bazel/issues/2634 Fixes https://github.com/google/protobuf/issues/2891
Diffstat (limited to 'cmake')
-rw-r--r--cmake/extract_includes.bat.in1
-rw-r--r--cmake/libprotobuf-lite.cmake1
-rw-r--r--cmake/libprotoc.cmake1
-rw-r--r--cmake/tests.cmake3
4 files changed, 6 insertions, 0 deletions
diff --git a/cmake/extract_includes.bat.in b/cmake/extract_includes.bat.in
index 1278ee87..549736a6 100644
--- a/cmake/extract_includes.bat.in
+++ b/cmake/extract_includes.bat.in
@@ -99,6 +99,7 @@ copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\casts.h" includ
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\common.h" include\google\protobuf\stubs\common.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\fastmem.h" include\google\protobuf\stubs\fastmem.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\hash.h" include\google\protobuf\stubs\hash.h
+copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\io_win32.h" include\google\protobuf\stubs\io_win32.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\logging.h" include\google\protobuf\stubs\logging.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\macros.h" include\google\protobuf\stubs\macros.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\mutex.h" include\google\protobuf\stubs\mutex.h
diff --git a/cmake/libprotobuf-lite.cmake b/cmake/libprotobuf-lite.cmake
index 1ee9b9c5..cf72e2fe 100644
--- a/cmake/libprotobuf-lite.cmake
+++ b/cmake/libprotobuf-lite.cmake
@@ -13,6 +13,7 @@ set(libprotobuf_lite_files
${protobuf_source_dir}/src/google/protobuf/stubs/bytestream.cc
${protobuf_source_dir}/src/google/protobuf/stubs/common.cc
${protobuf_source_dir}/src/google/protobuf/stubs/int128.cc
+ ${protobuf_source_dir}/src/google/protobuf/stubs/io_win32.cc
${protobuf_source_dir}/src/google/protobuf/stubs/once.cc
${protobuf_source_dir}/src/google/protobuf/stubs/status.cc
${protobuf_source_dir}/src/google/protobuf/stubs/statusor.cc
diff --git a/cmake/libprotoc.cmake b/cmake/libprotoc.cmake
index 51226540..8ac8d479 100644
--- a/cmake/libprotoc.cmake
+++ b/cmake/libprotoc.cmake
@@ -93,6 +93,7 @@ set(libprotoc_files
${protobuf_source_dir}/src/google/protobuf/compiler/ruby/ruby_generator.cc
${protobuf_source_dir}/src/google/protobuf/compiler/subprocess.cc
${protobuf_source_dir}/src/google/protobuf/compiler/zip_writer.cc
+ ${protobuf_source_dir}/src/google/protobuf/stubs/io_win32.cc
)
set(libprotoc_headers
diff --git a/cmake/tests.cmake b/cmake/tests.cmake
index 38dc0b52..31f22575 100644
--- a/cmake/tests.cmake
+++ b/cmake/tests.cmake
@@ -160,6 +160,8 @@ set(tests_files
${protobuf_source_dir}/src/google/protobuf/stubs/bytestream_unittest.cc
${protobuf_source_dir}/src/google/protobuf/stubs/common_unittest.cc
${protobuf_source_dir}/src/google/protobuf/stubs/int128_unittest.cc
+ ${protobuf_source_dir}/src/google/protobuf/stubs/io_win32.cc
+ ${protobuf_source_dir}/src/google/protobuf/stubs/io_win32_unittest.cc
${protobuf_source_dir}/src/google/protobuf/stubs/once_unittest.cc
${protobuf_source_dir}/src/google/protobuf/stubs/status_test.cc
${protobuf_source_dir}/src/google/protobuf/stubs/statusor_test.cc
@@ -198,6 +200,7 @@ target_link_libraries(tests libprotoc libprotobuf gmock_main)
set(test_plugin_files
${protobuf_source_dir}/src/google/protobuf/compiler/mock_code_generator.cc
+ ${protobuf_source_dir}/src/google/protobuf/stubs/io_win32.cc
${protobuf_source_dir}/src/google/protobuf/testing/file.cc
${protobuf_source_dir}/src/google/protobuf/testing/file.h
${protobuf_source_dir}/src/google/protobuf/compiler/test_plugin.cc