-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* be able to test a locally cloned and hacker version
- Loading branch information
Showing
4 changed files
with
94 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 312eeb928..3e154785b 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -41,7 +41,7 @@ else (BUILD_SHARED_LIBS) | ||
endif (BUILD_SHARED_LIBS) | ||
option(protobuf_BUILD_SHARED_LIBS "Build Shared Libraries" ${protobuf_BUILD_SHARED_LIBS_DEFAULT}) | ||
include(CMakeDependentOption) | ||
-cmake_dependent_option(protobuf_MSVC_STATIC_RUNTIME "Link static runtime libraries" ON | ||
+cmake_dependent_option(protobuf_MSVC_STATIC_RUNTIME "Link static runtime libraries" OFF | ||
"NOT protobuf_BUILD_SHARED_LIBS" OFF) | ||
set(protobuf_WITH_ZLIB_DEFAULT ON) | ||
option(protobuf_WITH_ZLIB "Build with zlib support" ${protobuf_WITH_ZLIB_DEFAULT}) | ||
@@ -158,24 +158,16 @@ endif() | ||
|
||
set(_protobuf_FIND_ZLIB) | ||
if (protobuf_WITH_ZLIB) | ||
- find_package(ZLIB) | ||
- if (ZLIB_FOUND) | ||
- set(HAVE_ZLIB 1) | ||
- # FindZLIB module define ZLIB_INCLUDE_DIRS variable | ||
- # Set ZLIB_INCLUDE_DIRECTORIES for compatible | ||
- set(ZLIB_INCLUDE_DIRECTORIES ${ZLIB_INCLUDE_DIRECTORIES} ${ZLIB_INCLUDE_DIRS}) | ||
- # Using imported target if exists | ||
- if (TARGET ZLIB::ZLIB) | ||
- set(ZLIB_LIBRARIES ZLIB::ZLIB) | ||
- set(_protobuf_FIND_ZLIB "if(NOT ZLIB_FOUND)\n find_package(ZLIB)\nendif()") | ||
- endif (TARGET ZLIB::ZLIB) | ||
- else (ZLIB_FOUND) | ||
- set(HAVE_ZLIB 0) | ||
- # Explicitly set these to empty (override NOT_FOUND) so cmake doesn't | ||
- # complain when we use them later. | ||
- set(ZLIB_INCLUDE_DIRECTORIES) | ||
- set(ZLIB_LIBRARIES) | ||
- endif (ZLIB_FOUND) | ||
+ if (NOT TARGET ZLIB::ZLIB) | ||
+ find_package(ZLIB REQUIRED) | ||
+ endif() | ||
+ set(HAVE_ZLIB 1) | ||
+ # FindZLIB module define ZLIB_INCLUDE_DIRS variable | ||
+ # Set ZLIB_INCLUDE_DIRECTORIES for compatible | ||
+ set(ZLIB_INCLUDE_DIRECTORIES ${ZLIB_INCLUDE_DIRECTORIES} ${ZLIB_INCLUDE_DIRS}) | ||
+ # Using imported target if exists | ||
+ set(ZLIB_LIBRARIES ZLIB::ZLIB) | ||
+ set(_protobuf_FIND_ZLIB "if(NOT ZLIB_FOUND AND NOT TARGET ZLIB::ZLIB)\n find_package(ZLIB REQUIRED)\nendif()") | ||
endif (protobuf_WITH_ZLIB) | ||
|
||
# We need to link with libatomic on systems that do not have builtin atomics, or | ||
@@ -277,7 +269,6 @@ else (MSVC) | ||
endif (MSVC) | ||
|
||
include_directories( | ||
- ${ZLIB_INCLUDE_DIRECTORIES} | ||
${protobuf_BINARY_DIR} | ||
# Support #include-ing other top-level directories, i.e. upb_generator. | ||
${protobuf_SOURCE_DIR} | ||
diff --git a/cmake/install.cmake b/cmake/install.cmake | ||
index 52914a8ea..d7dc5f232 100644 | ||
--- a/cmake/install.cmake | ||
+++ b/cmake/install.cmake | ||
@@ -31,6 +31,7 @@ foreach(_library ${_protobuf_libraries}) | ||
set_property(TARGET ${_library} | ||
PROPERTY INTERFACE_INCLUDE_DIRECTORIES | ||
$<BUILD_INTERFACE:${protobuf_SOURCE_DIR}/src> | ||
+ $<BUILD_INTERFACE:${protobuf_SOURCE_DIR}> | ||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) | ||
if (UNIX AND NOT APPLE) | ||
set_property(TARGET ${_library} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters