Skip to content

Commit

Permalink
MB-38476: tlm: Find static spdlog and remove third_party
Browse files Browse the repository at this point in the history
Change-Id: Ieaa35dba5e06c051fe0451aaa2b0816e7b4549fb
Reviewed-on: http://review.couchbase.org/c/tlm/+/155989
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Ben Huddleston <ben.huddleston@couchbase.com>
  • Loading branch information
BenHuddleston authored and daverigby committed Sep 16, 2021
1 parent 23abbd2 commit 4cec2b9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 11 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -196,6 +196,7 @@ INCLUDE(FindCouchbaseNuma)
INCLUDE(FindCouchbaseFmt)
INCLUDE(FindCouchbaseLiburing)
include(FindCouchbaseGoogletest)
INCLUDE(FindCouchbaseSpdlog)

if (BUILD_ENTERPRISE)
# libuv is currently only used by the enterpise builds
Expand Down
28 changes: 28 additions & 0 deletions cmake/Modules/FindCouchbaseSpdlog.cmake
@@ -0,0 +1,28 @@
#
# Copyright 2021 Couchbase, Inc.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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.

# Locate https://github.com/gabime/spdlog library.

set(spdlog_ROOT ${CMAKE_BINARY_DIR}/tlm/deps/spdlog.exploded)
# When building with ThreadSanitizer, prepend its root dir so we pick up
# the TSan-enabled library ahead of the vanilla one.
if(CB_THREADSANITIZER)
list(PREPEND spdlog_ROOT ${CMAKE_BINARY_DIR}/tlm/deps/spdlog.exploded/tsan_root)
endif()

find_package(spdlog REQUIRED)
if(spdlog_FOUND)
message(STATUS "Found spdlog at: ${spdlog_DIR}")
endif()
1 change: 1 addition & 0 deletions deps/manifest.cmake
Expand Up @@ -57,6 +57,7 @@ DECLARE_DEP (rocksdb VERSION 5.18.3-cb6 PLATFORMS amzn2 centos7 debian9 debian10
ENDIF (NOT CB_PRODUCTION_BUILD)
DECLARE_DEP (snappy VERSION 1.1.8-cb4 PLATFORMS linux macosx windows_msvc2017)
DECLARE_DEP (v8 VERSION 8.3-cb4 PLATFORMS suse12)
DECLARE_DEP (spdlog VERSION v1.8.5-cb3 PLATFORMS amzn2 centos7 debian9 debian10 macosx suse12 suse15 ubuntu18.04 ubuntu20.04 windows_msvc2017)
DECLARE_DEP (v8 VERSION 8.3-cb5 PLATFORMS amzn2 centos7 debian9 debian10 macosx suse15 ubuntu18.04 ubuntu20.04 windows_msvc2017)
DECLARE_DEP (zlib V2 VERSION 1.2.11 BUILD 7 PLATFORMS amzn2 centos7 debian9 debian10 macosx suse12 suse15 ubuntu18.04 ubuntu20.04 windows_msvc2017)

Expand Down
11 changes: 0 additions & 11 deletions third-party-CMakeLists.txt
Expand Up @@ -34,14 +34,3 @@ endif()
# Disable building examples and tests for HdrHistogram.
set(HDR_HISTOGRAM_BUILD_PROGRAMS OFF CACHE BOOL "Build hdr_histogram tests and examples")
add_subdirectory(HdrHistogram_c)

set(SPDLOG_BUILD_EXAMPLES OFF CACHE BOOL "Build spdlog examples")
set(SPDLOG_BUILD_TESTING OFF CACHE BOOL "Build spdlog tests")
set(SPDLOG_BUILD_BENCH OFF CACHE BOOL "Build spdlog benchmarks")
set(SPDLOG_FMT_EXTERNAL ON CACHE BOOL "Use external fmt library instead of bundled")

add_subdirectory(spdlog)

# Define macro which renames spdlog's severity levels.
set(CUSTOM_LEVELS "{\"TRACE\",\ \"DEBUG\",\ \"INFO\",\ \"WARNING\",\ \"ERROR\",\ \"CRITICAL\",\ \"OFF\"}")
target_compile_definitions(spdlog PUBLIC -DSPDLOG_LEVEL_NAMES=${CUSTOM_LEVELS})

0 comments on commit 4cec2b9

Please sign in to comment.