2021-02-04 19:06:44 +08:00
|
|
|
# Copyright 2019 Google LLC
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
2022-01-28 17:38:27 +08:00
|
|
|
# https://www.apache.org/licenses/LICENSE-2.0
|
2021-02-04 19:06:44 +08:00
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2022-01-25 20:48:07 +08:00
|
|
|
FetchContent_Declare(glog
|
|
|
|
GIT_REPOSITORY https://github.com/google/glog.git
|
|
|
|
GIT_TAG 3ba8976592274bc1f907c402ce22558011d6fc5e # 2020-02-16
|
2021-02-04 19:06:44 +08:00
|
|
|
)
|
|
|
|
# Force gflags from subdirectory
|
|
|
|
set(WITH_GFLAGS FALSE CACHE BOOL "" FORCE)
|
|
|
|
set(HAVE_LIB_GFLAGS TRUE CACHE STRING "" FORCE)
|
|
|
|
|
|
|
|
set(WITH_UNWIND FALSE CACHE BOOL "" FORCE)
|
|
|
|
set(UNWIND_LIBRARY FALSE)
|
|
|
|
|
2022-01-25 20:48:07 +08:00
|
|
|
set(HAVE_PWD_H FALSE)
|
2021-02-04 19:06:44 +08:00
|
|
|
set(WITH_PKGCONFIG TRUE CACHE BOOL "" FORCE)
|
|
|
|
|
|
|
|
set(BUILD_SHARED_LIBS ${SAPI_ENABLE_SHARED_LIBS})
|
|
|
|
|
2022-01-25 20:48:07 +08:00
|
|
|
FetchContent_MakeAvailable(glog)
|
2021-02-04 19:06:44 +08:00
|
|
|
target_include_directories(glog PUBLIC
|
2022-01-25 20:48:07 +08:00
|
|
|
$<BUILD_INTERFACE:${gflags_BINARY_DIR}/include>
|
|
|
|
$<BUILD_INTERFACE:${gflags_BINARY_DIR}>
|
2021-02-04 19:06:44 +08:00
|
|
|
)
|
|
|
|
add_library(gflags_nothreads STATIC IMPORTED)
|
|
|
|
set_target_properties(gflags_nothreads PROPERTIES
|
2022-01-25 20:48:07 +08:00
|
|
|
IMPORTED_LOCATION "${gflags_BINARY_DIR}/libgflags_nothreads.a"
|
|
|
|
)
|
2021-02-04 19:06:44 +08:00
|
|
|
target_link_libraries(glog PRIVATE
|
2022-04-29 17:13:32 +08:00
|
|
|
#-Wl,--whole-archive gflags_nothreads -Wl,--no-whole-archive
|
|
|
|
gflags_nothreads
|
2021-02-04 19:06:44 +08:00
|
|
|
)
|