mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
Use pragams instead of compile options
This commit is contained in:
parent
b8fdc9bf5d
commit
29b24f9e72
@ -57,11 +57,6 @@ function(spdlog_prepare_test test_target spdlog_lib)
|
|||||||
endif()
|
endif()
|
||||||
add_test(NAME ${test_target} COMMAND ${test_target})
|
add_test(NAME ${test_target} COMMAND ${test_target})
|
||||||
set_tests_properties(${test_target} PROPERTIES RUN_SERIAL ON)
|
set_tests_properties(${test_target} PROPERTIES RUN_SERIAL ON)
|
||||||
|
|
||||||
# Workaround GCC 12 false positive
|
|
||||||
if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND "${CMAKE_CXX_COMPILER_VERSION}" MATCHES "^12\..*")
|
|
||||||
target_compile_options(${test_target} PRIVATE "-Wno-maybe-uninitialized")
|
|
||||||
endif()
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# The compiled library tests
|
# The compiled library tests
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
|
#if defined (__GNUC__) && __GNUC__ == 12
|
||||||
|
# pragma GCC diagnostic push
|
||||||
|
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // Workaround for GCC 12
|
||||||
|
#endif
|
||||||
#include "catch.hpp"
|
#include "catch.hpp"
|
||||||
|
#if defined (__GNUC__) && __GNUC__ == 12
|
||||||
|
# pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
@ -24,4 +33,4 @@
|
|||||||
#include "spdlog/sinks/ostream_sink.h"
|
#include "spdlog/sinks/ostream_sink.h"
|
||||||
#include "spdlog/sinks/rotating_file_sink.h"
|
#include "spdlog/sinks/rotating_file_sink.h"
|
||||||
#include "spdlog/sinks/stdout_color_sinks.h"
|
#include "spdlog/sinks/stdout_color_sinks.h"
|
||||||
#include "spdlog/pattern_formatter.h"
|
#include "spdlog/pattern_formatter.h"
|
||||||
|
@ -1,2 +1,11 @@
|
|||||||
|
#if defined (__GNUC__) && __GNUC__ == 12
|
||||||
|
# pragma GCC diagnostic push
|
||||||
|
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // Workaround for GCC 12
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CATCH_CONFIG_MAIN
|
#define CATCH_CONFIG_MAIN
|
||||||
#include "catch.hpp"
|
#include "catch.hpp"
|
||||||
|
|
||||||
|
#if defined (__GNUC__) && __GNUC__ == 12
|
||||||
|
# pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user