From 181e284b55dd234320b0e4fd5fbc81a5dfa6b580 Mon Sep 17 00:00:00 2001 From: Jisi Liu Date: Wed, 8 Nov 2017 15:27:48 -0800 Subject: Fix Atomic32/AtomicWord on some platforms. - Removed the redefination in the atomicword_compat.h. Now Atomic32 will alwyas be intptr_t in 32bit platforms, the bridge is no longer needed. - Change NaCl 64bit to use intptr_t instead of int32 for Atomic32, otherwise AtmoicWord APIs will miss the definations. After this change, the AtmoicWord will always be either Atomic32 or Atmoic64 depending on the platforms. --- cmake/extract_includes.bat.in | 1 - 1 file changed, 1 deletion(-) (limited to 'cmake') diff --git a/cmake/extract_includes.bat.in b/cmake/extract_includes.bat.in index deb6de3b..5212d00a 100644 --- a/cmake/extract_includes.bat.in +++ b/cmake/extract_includes.bat.in @@ -83,7 +83,6 @@ copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops.h" in copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_arm64_gcc.h" include\google\protobuf\stubs\atomicops_internals_arm64_gcc.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_arm_gcc.h" include\google\protobuf\stubs\atomicops_internals_arm_gcc.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_arm_qnx.h" include\google\protobuf\stubs\atomicops_internals_arm_qnx.h -copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_atomicword_compat.h" include\google\protobuf\stubs\atomicops_internals_atomicword_compat.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_generic_c11_atomic.h" include\google\protobuf\stubs\atomicops_internals_generic_c11_atomic.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_generic_gcc.h" include\google\protobuf\stubs\atomicops_internals_generic_gcc.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_mips_gcc.h" include\google\protobuf\stubs\atomicops_internals_mips_gcc.h -- cgit v1.2.3 From cba18efe1861d1fc1eecd6dc2af86fc1f0d9922f Mon Sep 17 00:00:00 2001 From: Yangqing Jia Date: Mon, 13 Nov 2017 15:15:39 -0800 Subject: Allow one to omit building libprotoc and protoc binaries --- cmake/CMakeLists.txt | 7 +++++-- cmake/install.cmake | 32 ++++++++++++++++++++++---------- 2 files changed, 27 insertions(+), 12 deletions(-) (limited to 'cmake') diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index f159f60e..2351392d 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -14,6 +14,7 @@ project(protobuf C CXX) # Options option(protobuf_BUILD_TESTS "Build tests" ON) option(protobuf_BUILD_EXAMPLES "Build examples" OFF) +option(protobuf_BUILD_PROTOC_BINARIES "Build libprotoc and protoc compiler" ON) if (BUILD_SHARED_LIBS) set(protobuf_BUILD_SHARED_LIBS_DEFAULT ON) else (BUILD_SHARED_LIBS) @@ -184,8 +185,10 @@ endif (protobuf_UNICODE) include(libprotobuf-lite.cmake) include(libprotobuf.cmake) -include(libprotoc.cmake) -include(protoc.cmake) +if (protobuf_BUILD_PROTOC_BINARIES) + include(libprotoc.cmake) + include(protoc.cmake) +endif (protobuf_BUILD_PROTOC_BINARIES) if (protobuf_BUILD_TESTS) include(tests.cmake) diff --git a/cmake/install.cmake b/cmake/install.cmake index 441bf553..82036cb6 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake @@ -5,10 +5,12 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf.pc.cmake configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf-lite.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc @ONLY) -foreach(_library - libprotobuf-lite - libprotobuf - libprotoc) +set(_protobuf_libraries libprotobuf-lite libprotobuf) +if (protobuf_BUILD_PROTOC_BINARIES) + list(APPEND _protobuf_libraries libprotoc) +endif (protobuf_BUILD_PROTOC_BINARIES) + +foreach(_library ${_protobuf_libraries}) set_property(TARGET ${_library} PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ @@ -19,8 +21,10 @@ foreach(_library ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${_library}) endforeach() -install(TARGETS protoc EXPORT protobuf-targets - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc) +if (protobuf_BUILD_PROTOC_BINARIES) + install(TARGETS protoc EXPORT protobuf-targets + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc) +endif (protobuf_BUILD_PROTOC_BINARIES) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") @@ -101,10 +105,18 @@ configure_file(protobuf-options.cmake ${CMAKE_INSTALL_CMAKEDIR}/protobuf-options.cmake @ONLY) # Allows the build directory to be used as a find directory. -export(TARGETS libprotobuf-lite libprotobuf libprotoc protoc - NAMESPACE protobuf:: - FILE ${CMAKE_INSTALL_CMAKEDIR}/protobuf-targets.cmake -) + +if (protobuf_BUILD_PROTOC_BINARIES) + export(TARGETS libprotobuf-lite libprotobuf libprotoc protoc + NAMESPACE protobuf:: + FILE ${CMAKE_INSTALL_CMAKEDIR}/protobuf-targets.cmake + ) +else (protobuf_BUILD_PROTOC_BINARIES) + export(TARGETS libprotobuf-lite libprotobuf + NAMESPACE protobuf:: + FILE ${CMAKE_INSTALL_CMAKEDIR}/protobuf-targets.cmake + ) +endif (protobuf_BUILD_PROTOC_BINARIES) install(EXPORT protobuf-targets DESTINATION "${CMAKE_INSTALL_CMAKEDIR}" -- cgit v1.2.3