add_library(standard_settings INTERFACE)
-# Not supported in CMake 3.4: target_compile_features(project_options INTERFACE
-# c_std_11 cxx_std_11)
-
if(CMAKE_CXX_COMPILER_ID MATCHES "^GNU|(Apple)?Clang$")
+ target_compile_options(
+ standard_settings
+ INTERFACE -include ${CMAKE_BINARY_DIR}/config.h
+ )
+
option(ENABLE_COVERAGE "Enable coverage reporting for GCC/Clang" FALSE)
if(ENABLE_COVERAGE)
target_compile_options(standard_settings INTERFACE --coverage -O0 -g)
include(StdAtomic)
elseif(MSVC)
- target_compile_options(standard_settings INTERFACE /std:c++latest /Zc:preprocessor /Zc:__cplusplus /D_CRT_SECURE_NO_WARNINGS)
+ target_compile_options(standard_settings INTERFACE /FI ${CMAKE_BINARY_DIR}/config.h)
+
+ target_compile_options(
+ standard_settings
+ INTERFACE /std:c++latest /Zc:preprocessor /Zc:__cplusplus /D_CRT_SECURE_NO_WARNINGS
+ )
endif()
# endif
#endif
+#ifdef __MINGW32__
+# define __USE_MINGW_ANSI_STDIO 1
+# define __STDC_FORMAT_MACROS 1
+#endif
+
// For example for vasprintf under i686-w64-mingw32-g++-posix. The later
// definition of _XOPEN_SOURCE disables certain features on Linux, so we need
// _GNU_SOURCE to re-enable them (makedev, tm_zone).
-// Copyright (C) 2010-2020 Joel Rosdahl and other contributors
+// Copyright (C) 2010-2021 Joel Rosdahl and other contributors
//
// See doc/AUTHORS.adoc for a complete list of contributors.
//
#pragma once
-#ifdef __MINGW32__
-# define __USE_MINGW_ANSI_STDIO 1
-# define __STDC_FORMAT_MACROS 1
-#endif
-
-#include "config.h"
-
#ifdef HAVE_SYS_FILE_H
# include <sys/file.h>
#endif
target_sources(third_party_lib PRIVATE win32/mktemp.c)
endif ()
-if(MSVC)
- target_compile_options(third_party_lib PRIVATE /FI ${CMAKE_BINARY_DIR}/config.h)
-else()
- target_compile_options(third_party_lib PRIVATE -include ${CMAKE_BINARY_DIR}/config.h)
-endif()
-
if(ENABLE_TRACING)
target_sources(third_party_lib PRIVATE minitrace.c)
endif()