cmake_minimum_required (VERSION 3.16)
project (glog
VERSION 0.6.0
DESCRIPTION "C++ implementation of the Google logging module"
HOMEPAGE_URL https://github.com/google/glog
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})
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include (CheckCXXCompilerFlag)
include (CheckCXXSourceCompiles)
include (CheckCXXSourceRuns)
include (CheckCXXSymbolExists)
include (CheckFunctionExists)
include (CheckIncludeFileCXX)
include (CheckLibraryExists)
include (CheckStructHasMember)
include (CheckTypeSize)
include (CMakeDependentOption)
include (CMakePackageConfigHelpers)
include (CMakePushCheckState)
include (CPack)
include (CTest)
include (DetermineGflagsNamespace)
include (GenerateExportHeader)
include (GetCacheVariables)
include (GNUInstallDirs)
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" ON)
option (WITH_GFLAGS "Use gflags" ON)
option (WITH_GTEST "Use Google Test" 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)
cmake_dependent_option (WITH_GMOCK "Use Google Mock" ON WITH_GTEST OFF)
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_POSITION_INDEPENDENT_CODE ON)
set (CMAKE_VISIBILITY_INLINES_HIDDEN ON)
set (CMAKE_DEBUG_POSTFIX d)
set (CMAKE_THREAD_PREFER_PTHREAD 1)
find_package (GTest NO_MODULE)
if (GTest_FOUND)
set (HAVE_LIB_GTEST 1)
endif (GTest_FOUND)
if (WITH_GMOCK AND TARGET GTest::gmock)
set (HAVE_LIB_GMOCK 1)
endif (WITH_GMOCK AND TARGET GTest::gmock)
if (WITH_GFLAGS)
find_package (gflags 2.2.2)
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)
else (Unwind_FOUND)
check_include_file_cxx (unwind.h HAVE_UNWIND_H)
# Check whether linking actually succeeds. ARM toolchains of LLVM unwind
# implementation do not necessarily provide the _Unwind_Backtrace function
# which causes the previous check to succeed but the linking to fail.
check_cxx_symbol_exists (_Unwind_Backtrace unwind.h HAVE__UNWIND_BACKTRACE)
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_SIGALTSTACK)
# 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)
cmake_push_check_state (RESET)
if (Threads_FOUND)
set (CMAKE_REQUIRED_LIBRARIES Threads::Threads)
endif (Threads_FOUND)
check_cxx_symbol_exists (pthread_threadid_np "pthread.h" HAVE_PTHREAD_THREADID_NP)
cmake_pop_check_state ()
# NOTE: Cannot use check_function_exists here since >=vc-14.0 can define
# snprintf as an inline function
check_cxx_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)
cmake_push_check_state (RESET)
set (CMAKE_REQUIRED_LIBRARIES Threads::Threads)
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)
cmake_pop_check_state ()
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), a
没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
收起资源包目录
GLOG源码
使用CMAKE之后生成了win32和win64的工程sln文件
在VS2019下编译成功,生成的库文件 (2000个子文件)
AUTHORS 1KB
BUILD.bazel 592B
BUILD.bazel 159B
HAVE_UINT16_T.bin 37KB
CMakeDetermineCompilerABI_CXX.bin 37KB
HAVE___UINT16.bin 37KB
glog.bzl 9KB
logging.cc 89KB
logging_unittest.cc 44KB
logging_custom_prefix_unittest.cc 41KB
demangle.cc 39KB
symbolize.cc 32KB
symbolize_unittest.cc 14KB
signalhandler.cc 14KB
utilities.cc 11KB
vlog_is_on.cc 10KB
stacktrace_unittest.cc 9KB
raw_logging.cc 6KB
stl_logging_unittest.cc 6KB
demangle_unittest.cc 6KB
signalhandler_unittest.cc 4KB
mock-log_unittest.cc 4KB
cleanup_with_absolute_prefix_unittest.cc 3KB
cleanup_with_relative_prefix_unittest.cc 3KB
cleanup_immediately_unittest.cc 3KB
port.cc 3KB
logging_striptest_main.cc 3KB
utilities_unittest.cc 2KB
logging_striptest10.cc 2KB
logging_striptest2.cc 2KB
main.cc 515B
glog_package_config.cc 107B
ChangeLog 4KB
cmake.check_cache 86B
.clang-format 4KB
.clang-tidy 3KB
CTestTestfile.cmake 71KB
CTestTestfile.cmake 71KB
cmake_install.cmake 7KB
cmake_install.cmake 7KB
CMakeCXXCompiler.cmake 5KB
CPackSourceConfig.cmake 4KB
CPackSourceConfig.cmake 4KB
glog-targets.cmake 3KB
glog-targets.cmake 3KB
glog-targets.cmake 3KB
CPackConfig.cmake 3KB
CPackConfig.cmake 3KB
glog-config-version.cmake 3KB
glog-config-version.cmake 3KB
glog-config.cmake 933B
glog-config.cmake 933B
glog-targets-relwithdebinfo.cmake 901B
glog-targets-minsizerel.cmake 881B
glog-targets-release.cmake 866B
glog-targets-debug.cmake 860B
glog-modules.cmake 718B
glog-modules.cmake 718B
CMakeSystem.cmake 395B
CMakeRCCompiler.cmake 212B
CONTRIBUTORS 2KB
COPYING 3KB
CMakeCXXCompilerId.cpp 26KB
HAVE___UINT16.cpp 1KB
HAVE_U_INT16_T.cpp 1KB
HAVE_UINT16_T.cpp 1KB
CheckFunctionExists.cxx 461B
CheckFunctionExists.cxx 461B
Browse.VC.db 47.93MB
Browse.VC.db 47.88MB
Solution.VC.db 6.57MB
Solution.VC.db 6.48MB
generate.stamp.depend 4KB
glogd.dll 366KB
glogd.dll 311KB
glog.dll 221KB
glog.dll 195KB
glog.dll 143KB
glog.dll 132KB
glog.dll 128KB
glog.dll 109KB
logging_custom_prefix_unittest.err 26KB
logging_unittest.err 22KB
logging_custom_prefix_unittest.exe 623KB
logging_unittest.exe 618KB
logging_custom_prefix_unittest.exe 522KB
logging_unittest.exe 518KB
stl_logging_unittest.exe 437KB
cleanup_with_relative_prefix_unittest.exe 398KB
cleanup_with_absolute_prefix_unittest.exe 398KB
cleanup_immediately_unittest.exe 397KB
demangle_unittest.exe 393KB
symbolize_unittest.exe 389KB
utilities_unittest.exe 389KB
stacktrace_unittest.exe 372KB
signalhandler_unittest.exe 369KB
stl_logging_unittest.exe 369KB
cleanup_immediately_unittest.exe 339KB
cleanup_with_relative_prefix_unittest.exe 339KB
cleanup_with_absolute_prefix_unittest.exe 339KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
MobileCard
- 粉丝: 1
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0