Source release 16.4.0
This commit is contained in:
29
third_party/protobuf/cmake/CMakeLists.txt
vendored
29
third_party/protobuf/cmake/CMakeLists.txt
vendored
@@ -28,6 +28,14 @@ else()
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
endif()
|
||||
|
||||
# The Intel compiler isn't able to deal with noinline member functions of
|
||||
# template classses defined in headers. As such it spams the output with
|
||||
# warning #2196: routine is both "inline" and "noinline"
|
||||
# This silences that warning.
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES Intel)
|
||||
string(APPEND CMAKE_CXX_FLAGS " -diag-disable=2196")
|
||||
endif()
|
||||
|
||||
# Options
|
||||
option(protobuf_BUILD_TESTS "Build tests" ON)
|
||||
option(protobuf_BUILD_CONFORMANCE "Build conformance tests" OFF)
|
||||
@@ -132,6 +140,25 @@ if (HAVE_ZLIB)
|
||||
add_definitions(-DHAVE_ZLIB)
|
||||
endif (HAVE_ZLIB)
|
||||
|
||||
# We need to link with libatomic on systems that do not have builtin atomics, or
|
||||
# don't have builtin support for 8 byte atomics
|
||||
set(protobuf_LINK_LIBATOMIC false)
|
||||
if (NOT MSVC)
|
||||
include(CheckCXXSourceCompiles)
|
||||
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
|
||||
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} -std=c++11)
|
||||
check_cxx_source_compiles("
|
||||
#include <atomic>
|
||||
int main() {
|
||||
return std::atomic<int64_t>{};
|
||||
}
|
||||
" protobuf_HAVE_BUILTIN_ATOMICS)
|
||||
if (NOT protobuf_HAVE_BUILTIN_ATOMICS)
|
||||
set(protobuf_LINK_LIBATOMIC true)
|
||||
endif (NOT protobuf_HAVE_BUILTIN_ATOMICS)
|
||||
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
|
||||
endif (NOT MSVC)
|
||||
|
||||
if (protobuf_BUILD_SHARED_LIBS)
|
||||
set(protobuf_SHARED_OR_STATIC "SHARED")
|
||||
else (protobuf_BUILD_SHARED_LIBS)
|
||||
@@ -180,7 +207,7 @@ if (MSVC)
|
||||
configure_file(extract_includes.bat.in extract_includes.bat)
|
||||
|
||||
# Suppress linker warnings about files with no symbols defined.
|
||||
set(CMAKE_STATIC_LINKER_FLAGS /ignore:4221)
|
||||
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221")
|
||||
|
||||
# Configure Resource Compiler
|
||||
enable_language(RC)
|
||||
|
||||
Reference in New Issue
Block a user