本文首发于个人博客https://kezunlin.me/post/bb64e398/,欢迎阅读!
compile glog v0.3.5 and glags on windows from source.
Series
Guide
version
- glog: v0.3.5 https://github.com/google/glog/archive/v0.3.5.zip
- gflag: v2.2.1 https://github.com/schuhschuh/gflags/archive/v2.2.1.zip
gflags
do not use offical version,instead use
https://github.com/schuhschuh/gflags.git
git clone https://github.com/schuhschuh/gflags.git
cd gflags
mkdir windows-build
cd windows-build
cmake-gui ..
with options
BUILD_SHARED_LIBS ON
INSTALL_SHARED_LIBS ON
INSTALL_STATIC_LIBS OFF
CMAKE_CONFIGURATION_TYPES Release # Release
REGISTER_INSTALL_PREFIX OFF
CMAKE_INSTALL_PREFIX D:/gflags
#NAMESPACE google;gflags
NAMESPACE google
or command
cmake -DGFLAGS_NAMESPACE=google -DCMAKE_CXX_FLAGS=-fPIC ..
we get
include
andlib/gflags.lib
, andbin/gflags.dll
modify
CMAKE/CMAKE_INSTALL_PREFIX
to a non-system folder, otherwise you will need adminis