cmake_minimum_required (VERSION 3.0)
if (POLICY CMP0042)
cmake_policy (SET CMP0042 NEW)
endif (POLICY CMP0042)
if (POLICY CMP0063)
cmake_policy (SET CMP0063 NEW)
endif (POLICY CMP0063)
project(glog VERSION 0.5.0 LANGUAGES CXX)
set (CPACK_PACKAGE_NAME glog)
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Google logging library")
set (CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set (CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set (CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set (CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
option (BUILD_SHARED_LIBS "Build shared libraries" ON)
option (PRINT_UNSYMBOLIZED_STACK_TRACES
"Print file offsets in traces instead of symbolizing" OFF)
option (WITH_CUSTOM_PREFIX "Enable support for user-generated message prefixes" OFF)
option (WITH_GFLAGS "Use gflags" ON)
option (WITH_GTEST "Use googletest" ON)
option (WITH_PKGCONFIG "Enable pkg-config support" ON)
option (WITH_SYMBOLIZE "Enable symbolize module" ON)
option (WITH_THREADS "Enable multithreading support" ON)
option (WITH_TLS "Enable Thread Local Storage (TLS) support" ON)
option (WITH_UNWIND "Enable libunwind support" ON)
if (NOT WITH_UNWIND)
set (CMAKE_DISABLE_FIND_PACKAGE_Unwind ON)
endif (NOT WITH_UNWIND)
if (NOT WITH_GTEST)
set (CMAKE_DISABLE_FIND_PACKAGE_GTest ON)
endif (NOT WITH_GTEST)
if (NOT WITH_THREADS)
set (CMAKE_DISABLE_FIND_PACKAGE_Threads ON)
endif (NOT WITH_THREADS)
set (CMAKE_C_VISIBILITY_PRESET hidden)
set (CMAKE_CXX_VISIBILITY_PRESET hidden)
set (CMAKE_VISIBILITY_INLINES_HIDDEN 1)
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include (CheckCXXSourceCompiles)
include (CheckCXXCompilerFlag)
include (CheckCXXSourceCompiles)
include (CheckCXXSourceRuns)
include (CheckFunctionExists)
include (CheckIncludeFileCXX)
include (CheckLibraryExists)
include (CheckStructHasMember)
include (CheckSymbolExists)
include (CheckTypeSize)
include (CMakePackageConfigHelpers)
include (CMakePushCheckState)
include (CPack)
include (CTest)
include (DetermineGflagsNamespace)
include (GenerateExportHeader)
include (GetCacheVariables)
include (GNUInstallDirs)
set (CMAKE_DEBUG_POSTFIX d)
set (CMAKE_THREAD_PREFER_PTHREAD 1)
find_package (GTest)
if (GTest_FOUND)
set (HAVE_LIB_GTEST 1)
endif (GTest_FOUND)
if (WITH_GFLAGS)
find_package (gflags 2.2.0)
if (gflags_FOUND)
set (HAVE_LIB_GFLAGS 1)
determine_gflags_namespace (gflags_NAMESPACE)
endif (gflags_FOUND)
endif (WITH_GFLAGS)
find_package (Threads)
find_package (Unwind)
if (Unwind_FOUND)
set (HAVE_LIB_UNWIND 1)
set (HAVE_UNWIND_H 1)
endif (Unwind_FOUND)
check_include_file_cxx (dlfcn.h HAVE_DLFCN_H)
check_include_file_cxx (execinfo.h HAVE_EXECINFO_H)
check_include_file_cxx (glob.h HAVE_GLOB_H)
check_include_file_cxx (inttypes.h HAVE_INTTYPES_H)
check_include_file_cxx (memory.h HAVE_MEMORY_H)
check_include_file_cxx (pwd.h HAVE_PWD_H)
check_include_file_cxx (stdint.h HAVE_STDINT_H)
check_include_file_cxx (strings.h HAVE_STRINGS_H)
check_include_file_cxx (sys/stat.h HAVE_SYS_STAT_H)
check_include_file_cxx (sys/syscall.h HAVE_SYS_SYSCALL_H)
check_include_file_cxx (sys/time.h HAVE_SYS_TIME_H)
check_include_file_cxx (sys/types.h HAVE_SYS_TYPES_H)
check_include_file_cxx (sys/utsname.h HAVE_SYS_UTSNAME_H)
check_include_file_cxx (sys/wait.h HAVE_SYS_WAIT_H)
check_include_file_cxx (syscall.h HAVE_SYSCALL_H)
check_include_file_cxx (syslog.h HAVE_SYSLOG_H)
check_include_file_cxx (ucontext.h HAVE_UCONTEXT_H)
check_include_file_cxx (unistd.h HAVE_UNISTD_H)
check_include_file_cxx ("ext/hash_map" HAVE_EXT_HASH_MAP)
check_include_file_cxx ("ext/hash_set" HAVE_EXT_HASH_SET)
check_include_file_cxx ("ext/slist" HAVE_EXT_SLIST)
check_include_file_cxx ("tr1/unordered_map" HAVE_TR1_UNORDERED_MAP)
check_include_file_cxx ("tr1/unordered_set" HAVE_TR1_UNORDERED_SET)
check_include_file_cxx ("unordered_map" HAVE_UNORDERED_MAP)
check_include_file_cxx ("unordered_set" HAVE_UNORDERED_SET)
check_type_size ("unsigned __int16" HAVE___UINT16 LANGUAGE CXX)
check_type_size (u_int16_t HAVE_U_INT16_T LANGUAGE CXX)
check_type_size (uint16_t HAVE_UINT16_T LANGUAGE CXX)
check_function_exists (dladdr HAVE_DLADDR)
check_function_exists (fcntl HAVE_FCNTL)
check_function_exists (pread HAVE_PREAD)
check_function_exists (pwrite HAVE_PWRITE)
check_function_exists (sigaction HAVE_SIGACTION)
check_function_exists (sigaltstack HAVE_SIGALSTACK)
# NOTE gcc does not fail if you pass a non-existent -Wno-* option as an
# argument. However, it will happily fail if you pass the corresponding -W*
# option. So, we check whether options that disable warnings exist by testing
# the availability of the corresponding option that enables the warning. This
# eliminates the need to check for compiler for several (mainly Clang) options.
check_cxx_compiler_flag (-Wdeprecated HAVE_NO_DEPRECATED)
check_cxx_compiler_flag (-Wunnamed-type-template-args
HAVE_NO_UNNAMED_TYPE_TEMPLATE_ARGS)
# NOTE: Cannot use check_function_exists here since >=vc-14.0 can define
# snprintf as an inline function
check_symbol_exists (snprintf cstdio HAVE_SNPRINTF)
check_library_exists (dbghelp UnDecorateSymbolName "" HAVE_DBGHELP)
check_cxx_source_compiles ("
#include <cstdlib>
static void foo(void) __attribute__ ((unused));
int main(void) { return 0; }
" HAVE___ATTRIBUTE__)
check_cxx_source_compiles ("
#include <cstdlib>
static void foo(void) __attribute__ ((visibility(\"default\")));
int main(void) { return 0; }
" HAVE___ATTRIBUTE__VISIBILITY_DEFAULT)
check_cxx_source_compiles ("
#include <cstdlib>
static void foo(void) __attribute__ ((visibility(\"hidden\")));
int main(void) { return 0; }
" HAVE___ATTRIBUTE__VISIBILITY_HIDDEN)
check_cxx_source_compiles ("
int main(void) { if (__builtin_expect(0, 0)) return 1; return 0; }
" HAVE___BUILTIN_EXPECT)
check_cxx_source_compiles ("
int main(void)
{
int a; if (__sync_val_compare_and_swap(&a, 0, 1)) return 1; return 0;
}
" HAVE___SYNC_VAL_COMPARE_AND_SWAP)
check_cxx_source_compiles ("
#define _XOPEN_SOURCE 500
#include <pthread.h>
int main(void)
{
pthread_rwlock_t l;
pthread_rwlock_init(&l, NULL);
pthread_rwlock_rdlock(&l);
return 0;
}
" HAVE_RWLOCK)
check_cxx_source_compiles ("
__declspec(selectany) int a;
int main(void) { return 0; }
" HAVE___DECLSPEC)
check_cxx_source_compiles ("
#include <vector>
vector<int> t; int main() { }
" STL_NO_NAMESPACE)
check_cxx_source_compiles ("
#include <vector>
std::vector<int> t; int main() { }
" STL_STD_NAMESPACE)
check_cxx_source_compiles ("
#include <iostream>
std::ostream& operator<<(std::ostream&, struct s);
using ::operator<<;
int main() { }
" HAVE_USING_OPERATOR)
check_cxx_source_compiles ("
namespace Outer { namespace Inner { int i = 0; }}
using namespace Outer::Inner;;
int main() { return i; }
" HAVE_NAMESPACES)
check_cxx_source_compiles ("
__thread int tls;
int main() { }
" HAVE_GCC_TLS)
check_cxx_source_compiles ("
__declspec(thread) int tls;
int main() { }
" HAVE_MSVC_TLS)
check_cxx_source_compiles ("
thread_local int tls;
int main() { }
" HAVE_CXX11_TLS)
check_cxx_source_compiles ("
#include <type_traits>
std::aligned_storage<sizeof(char), alignof(char)>::type data;
int main() { }
" HAVE_ALIGNED_STORAGE)
check_cxx_source_compiles ("
#include <atomic>
std::atomic<int> i;
int main() { }
" HAVE_CXX11_ATOMIC)
check_cxx_source_compiles ("
#include <cstddef>
void foo(std::nullptr_t) {}
int main(void) { foo(nullptr); }
" HAVE_CXX11_NULLPTR_T)
if (WITH_TLS)
# Cygwin does not support the thread attribute. Don't bother.
if (HAVE_GCC_TLS)
set (GLOG_THREAD_LOCAL_STORAGE "__thread")
elseif (HAVE_MSVC_TLS)
set (GLOG_THREAD_LOCAL_STORAGE "__declspec(thread)")
elseif (HAVE_CXX11_TLS)
set (GLOG_THREAD_LOCAL_STORAGE thread_local)
endif (HAVE_GCC_TLS)
endif (WITH_TLS)
set (_PC_FIELDS
"gregs[REG_PC]"
"gregs[REG_EIP]"
"gregs[REG_RIP]"
"sc_ip"
"uc_regs->gregs[PT_NIP]"
"gregs[R15]"
"arm_pc"
"mc_eip"
"mc_rip"
"__gregs[REG_EIP]"
"__gregs[REG_RIP]"
"ss.eip"
"__ss.__eip"
"ss.rip"
"__
没有合适的资源?快使用搜索试试~ 我知道了~
glog-0.5.0安装包
需积分: 0 0 下载量 106 浏览量
2024-05-25
21:42:36
上传
评论
收藏 179KB GZ 举报
温馨提示
共94个文件
cc:22个
cmake:20个
h:18个
glog-0.5.0安装包
资源推荐
资源详情
资源评论
收起资源包目录
glog-0.5.0.tar.gz (94个子文件)
glog-0.5.0
BUILD.bazel 78B
glog-modules.cmake.in 686B
CMakeLists.txt 26KB
bazel
glog.bzl 8KB
example
BUILD.bazel 159B
main.cc 515B
ChangeLog 3KB
libglog.pc.in 218B
.travis.yml 3KB
WORKSPACE 331B
.github
workflows
windows-builds.yml 3KB
src
utilities.cc 11KB
demangle_unittest.cc 6KB
symbolize.cc 32KB
mock-log.h 6KB
stacktrace_x86-inl.h 5KB
logging_unittest.err 22KB
demangle.h 4KB
stacktrace_x86_64-inl.h 3KB
logging_custom_prefix_unittest.cc 41KB
symbolize_unittest.cc 13KB
stacktrace_generic-inl.h 2KB
logging_striptest_main.cc 3KB
signalhandler.cc 13KB
windows
port.h 6KB
dirent.h 26KB
preprocess.sh 5KB
port.cc 3KB
stacktrace_unittest.cc 8KB
logging_striptest2.cc 2KB
signalhandler_unittest.sh 4KB
vlog_is_on.cc 9KB
logging_striptest10.cc 2KB
utilities_unittest.cc 2KB
symbolize.h 6KB
base
commandlineflags.h 6KB
googleinit.h 2KB
mutex.h 13KB
raw_logging.cc 6KB
stacktrace_libunwind-inl.h 3KB
logging_striplog_test.sh 3KB
demangle.cc 39KB
signalhandler_unittest.cc 4KB
demangle_unittest.txt 5KB
package_config_unittest
working_config
CMakeLists.txt 246B
glog_package_config.cc 107B
stacktrace_windows-inl.h 2KB
logging.cc 85KB
demangle_unittest.sh 3KB
logging_unittest.cc 40KB
glog
logging.h.in 76KB
stl_logging.h.in 8KB
vlog_is_on.h.in 6KB
log_severity.h 4KB
raw_logging.h.in 7KB
config.h.cmake.in 6KB
stl_logging_unittest.cc 6KB
stacktrace_powerpc-inl.h 6KB
stacktrace.h 2KB
logging_custom_prefix_unittest.err 26KB
utilities.h 7KB
googletest.h 19KB
mock-log_test.cc 4KB
toolchains
mingw-cxx17.cmake 337B
vs-14-2015-sdk-8-1.cmake 49B
gcc-cxx98.cmake 337B
vs-15-2017-win64-cxx17.cmake 82B
linux-mingw-w64-gnuxx11.cmake 1KB
vs-14-2015-win64.cmake 30B
linux-mingw-w64-cxx11.cmake 1KB
mingw-cxx11.cmake 337B
gcc-cxx11.cmake 337B
linux-mingw-w64-cxx17.cmake 1KB
mingw-gnuxx11.cmake 337B
vs-15-2017-win64.cmake 30B
gcc-cxx17.cmake 337B
clang-cxx17.cmake 343B
.gitignore 54B
gcc-gnuxx11.cmake 336B
AUTHORS 924B
README.rst 31KB
cmake
DetermineGflagsNamespace.cmake 2KB
TestInitPackageConfig.cmake 361B
FindUnwind.cmake 3KB
TestPackageConfig.cmake 1KB
GetCacheVariables.cmake 2KB
CONTRIBUTORS 2KB
.travis.ubuntu.sh 550B
.bazelci
presubmit.yml 862B
.gitignore 150B
appveyor.yml 3KB
COPYING 3KB
Dockerfile.ubuntu.template 347B
glog-config.cmake.in 378B
共 94 条
- 1
资源评论
资深可爱鉴定师
- 粉丝: 29
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功