prepare test with SPDLOG_FMT_EXTERNAL

pull/1438/head
ClausKlein 6 years ago
parent e8158c9e8e
commit 9b250b81b1

@ -61,8 +61,8 @@ option(SPDLOG_BUILD_EXAMPLE "Build example" ${SPDLOG_MASTER_PROJECT})
option(SPDLOG_BUILD_EXAMPLE_HO "Build header only example" OFF)
# testing options
option(SPDLOG_BUILD_TESTS "Build tests" ${SPDLOG_MASTER_PROJECT})
option(SPDLOG_BUILD_TESTS_HO "Build tests using the header only version" ${SPDLOG_MASTER_PROJECT})
# option(SPDLOG_BUILD_TESTS "Build tests" ${SPDLOG_MASTER_PROJECT})
# option(SPDLOG_BUILD_TESTS_HO "Build tests using the header only version" ${SPDLOG_MASTER_PROJECT})
# bench options
option(SPDLOG_BUILD_BENCH "Build benchmarks (Requires https://github.com/google/benchmark.git to be installed)" OFF)
@ -72,7 +72,7 @@ option(SPDLOG_SANITIZE_ADDRESS "Enable address sanitizer in tests" OFF)
# install options
option(SPDLOG_INSTALL "Generate the install target" ${SPDLOG_MASTER_PROJECT})
option(SPDLOG_FMT_EXTERNAL "Use external fmt library instead of bundled" OFF)
option(SPDLOG_FMT_EXTERNAL "Use external fmt library instead of bundled" ON)
option(SPDLOG_FMT_EXTERNAL_HO "Use external fmt header-only library instead of bundled" OFF)
option(SPDLOG_NO_EXCEPTIONS "Compile with -fno-exceptions. Call abort() on any spdlog exceptions" OFF)

@ -8,7 +8,8 @@ MAKEFLAGS+= --no-builtin-rules
.PHONY: setup show all test lcov install check format clean distclean
PROJECT_NAME:=$(shell basename $${PWD})
# PROJECT_NAME:=$(shell basename $${PWD})
PROJECT_NAME:=spdlog
##################################################
# begin of config part
@ -29,15 +30,15 @@ CHECKS?='-*,cppcoreguidelines-*,-cppcoreguidelines-macro-usage'
# prevent hard config of find_package(asio 1.14.1 CONFIG CMAKE_FIND_ROOT_PATH_BOTH)
ifeq (NO${CROSS_COMPILE},NO)
CC:=/opt/local/bin/clang
CXX:=/opt/local/bin/clang++
CC:=/opt/local/bin/gcc
CXX:=/opt/local/bin/g++
# NOTE: Do not uses with DESTDIR! CMAKE_INSTALL_PREFIX?=/
DESTDIR?=/tmp/staging/$(PROJECT_NAME)
export DESTDIR
CMAKE_STAGING_PREFIX?=/usr/local
CMAKE_PREFIX_PATH?="${DESTDIR}/${CMAKE_STAGING_PREFIX};/opt/local;/usr"
CMAKE_PREFIX_PATH?="${DESTDIR}/${CMAKE_STAGING_PREFIX};/usr/local;/opt/local;/usr"
else
CMAKE_STAGING_PREFIX?=/tmp/staging/${CROSS_COMPILE}$(PROJECT_NAME)
CMAKE_PREFIX_PATH?="${CMAKE_STAGING_PREFIX}"
@ -87,7 +88,7 @@ setup: $(BUILD_DIR) .clang-tidy compile_commands.json
-DUSE_LCOV=$(USE_LOCV) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \
-DCMAKE_PREFIX_PATH=$(CMAKE_PREFIX_PATH) \
-DCMAKE_STAGING_PREFIX=$(CMAKE_STAGING_PREFIX) \
-DSPDLOG_BUILD_EXAMPLE_HO=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DSPDLOG_BUILD_EXAMPLE_HO=off -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} $(CURDIR)
touch $@

@ -1,11 +1,12 @@
# Copyright(c) 2019 spdlog authors
# Distributed under the MIT License (http://opensource.org/licenses/MIT)
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.12)
project(spdlog_examples CXX)
if(NOT TARGET spdlog)
# Stand-alone build
include(../cmake/utils.cmake)
find_package(spdlog REQUIRED)
endif()

Loading…
Cancel
Save