git repos / blockattack-game

commit a0630906

Poul Sander · 2022-01-15 13:59
a0630906bb78d16b80741fd6adbdc5bee3d2f310 patch · browse files
parent f8deb5b97946f36c83e073c90acab9990464802d

Fix gitignore to not ignore CMakeLists.txt

Changed files

M .gitignore before
A source/misc/embedded_libs/fmt-8.1.1/CMakeLists.txt
A source/misc/embedded_libs/fmt-8.1.1/doc/CMakeLists.txt
A source/misc/embedded_libs/fmt-8.1.1/test/CMakeLists.txt
A source/misc/embedded_libs/fmt-8.1.1/test/add-subdirectory-test/CMakeLists.txt
A source/misc/embedded_libs/fmt-8.1.1/test/compile-error-test/CMakeLists.txt
A source/misc/embedded_libs/fmt-8.1.1/test/cuda-test/CMakeLists.txt
A source/misc/embedded_libs/fmt-8.1.1/test/find-package-test/CMakeLists.txt
A source/misc/embedded_libs/fmt-8.1.1/test/fuzzing/CMakeLists.txt
A source/misc/embedded_libs/fmt-8.1.1/test/gtest/CMakeLists.txt
A source/misc/embedded_libs/fmt-8.1.1/test/static-export-test/CMakeLists.txt
diff --git a/.gitignore b/.gitignore index f3ca6de..1bd0073 100644 --- a/.gitignore +++ b/.gitignore
@@ -16,7 +16,7 @@ Game/blockattack*
Game/mods/1.3.0.bricks.data
cmake_install.cmake
CMake*
--CMakeLists.txt
+!CMakeLists.txt
CPack*
Makefile
source/manual/
diff --git a/source/misc/embedded_libs/fmt-8.1.1/CMakeLists.txt b/source/misc/embedded_libs/fmt-8.1.1/CMakeLists.txt new file mode 100644 index 0000000..3bf80f8 --- /dev/null +++ b/source/misc/embedded_libs/fmt-8.1.1/CMakeLists.txt
@@ -0,0 +1,415 @@
+cmake_minimum_required(VERSION 3.1...3.18)
+
+# Fallback for using newer policies on CMake <3.12.
+if(${CMAKE_VERSION} VERSION_LESS 3.12)
+ cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
+endif()
+
+# Determine if fmt is built as a subproject (using add_subdirectory)
+# or if it is the master project.
+if (NOT DEFINED FMT_MASTER_PROJECT)
+ set(FMT_MASTER_PROJECT OFF)
+ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
+ set(FMT_MASTER_PROJECT ON)
+ message(STATUS "CMake version: ${CMAKE_VERSION}")
+ endif ()
+endif ()
+
+# Joins arguments and places the results in ${result_var}.
+function(join result_var)
+ set(result "")
+ foreach (arg ${ARGN})
+ set(result "${result}${arg}")
+ endforeach ()
+ set(${result_var} "${result}" PARENT_SCOPE)
+endfunction()
+
+function(enable_module target)
+ if (MSVC)
+ set(BMI ${CMAKE_CURRENT_BINARY_DIR}/${target}.ifc)
+ target_compile_options(${target}
+ PRIVATE /interface /ifcOutput ${BMI}
+ INTERFACE /reference fmt=${BMI})
+ endif ()
+ set_target_properties(${target} PROPERTIES ADDITIONAL_CLEAN_FILES ${BMI})
+ set_source_files_properties(${BMI} PROPERTIES GENERATED ON)
+endfunction()
+
+include(CMakeParseArguments)
+
+# Sets a cache variable with a docstring joined from multiple arguments:
+# set(<variable> <value>... CACHE <type> <docstring>...)
+# This allows splitting a long docstring for readability.
+function(set_verbose)
+ # cmake_parse_arguments is broken in CMake 3.4 (cannot parse CACHE) so use
+ # list instead.
+ list(GET ARGN 0 var)
+ list(REMOVE_AT ARGN 0)
+ list(GET ARGN 0 val)
+ list(REMOVE_AT ARGN 0)
+ list(REMOVE_AT ARGN 0)
+ list(GET ARGN 0 type)
+ list(REMOVE_AT ARGN 0)
+ join(doc ${ARGN})
+ set(${var} ${val} CACHE ${type} ${doc})
+endfunction()
+
+# Set the default CMAKE_BUILD_TYPE to Release.
+# This should be done before the project command since the latter can set
+# CMAKE_BUILD_TYPE itself (it does so for nmake).
+if (FMT_MASTER_PROJECT AND NOT CMAKE_BUILD_TYPE)
+ set_verbose(CMAKE_BUILD_TYPE Release CACHE STRING
+ "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or "
+ "CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
+endif ()
+
+project(FMT CXX)
+include(GNUInstallDirs)
+set_verbose(FMT_INC_DIR ${CMAKE_INSTALL_INCLUDEDIR} CACHE STRING
+ "Installation directory for include files, a relative path that "
+ "will be joined with ${CMAKE_INSTALL_PREFIX} or an absolute path.")
+
+option(FMT_PEDANTIC "Enable extra warnings and expensive tests." OFF)
+option(FMT_WERROR "Halt the compilation with an error on compiler warnings."
+ OFF)
+
+# Options that control generation of various targets.
+option(FMT_DOC "Generate the doc target." ${FMT_MASTER_PROJECT})
+option(FMT_INSTALL "Generate the install target." ${FMT_MASTER_PROJECT})
+option(FMT_TEST "Generate the test target." ${FMT_MASTER_PROJECT})
+option(FMT_FUZZ "Generate the fuzz target." OFF)
+option(FMT_CUDA_TEST "Generate the cuda-test target." OFF)
+option(FMT_OS "Include core requiring OS (Windows/Posix) " ON)
+option(FMT_MODULE "Build a module instead of a traditional library." OFF)
+option(FMT_SYSTEM_HEADERS "Expose headers with marking them as system." OFF)
+
+set(FMT_CAN_MODULE OFF)
+if (CMAKE_CXX_STANDARD GREATER 17 AND
+ # msvc 16.10-pre4
+ MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 19.29.30035)
+ set(FMT_CAN_MODULE OFF)
+endif ()
+if (NOT FMT_CAN_MODULE)
+ set(FMT_MODULE OFF)
+ message(STATUS "Module support is disabled.")
+endif ()
+if (FMT_TEST AND FMT_MODULE)
+ # The tests require {fmt} to be compiled as traditional library
+ message(STATUS "Testing is incompatible with build mode 'module'.")
+endif ()
+set(FMT_SYSTEM_HEADERS_ATTRIBUTE "")
+if (FMT_SYSTEM_HEADERS)
+ set(FMT_SYSTEM_HEADERS_ATTRIBUTE SYSTEM)
+endif ()
+
+# Get version from core.h
+file(READ include/fmt/core.h core_h)
+if (NOT core_h MATCHES "FMT_VERSION ([0-9]+)([0-9][0-9])([0-9][0-9])")
+ message(FATAL_ERROR "Cannot get FMT_VERSION from core.h.")
+endif ()
+# Use math to skip leading zeros if any.
+math(EXPR CPACK_PACKAGE_VERSION_MAJOR ${CMAKE_MATCH_1})
+math(EXPR CPACK_PACKAGE_VERSION_MINOR ${CMAKE_MATCH_2})
+math(EXPR CPACK_PACKAGE_VERSION_PATCH ${CMAKE_MATCH_3})
+join(FMT_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.
+ ${CPACK_PACKAGE_VERSION_PATCH})
+message(STATUS "Version: ${FMT_VERSION}")
+
+message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
+
+if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+endif ()
+
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
+ "${CMAKE_CURRENT_SOURCE_DIR}/support/cmake")
+
+include(cxx14)
+include(CheckCXXCompilerFlag)
+include(JoinPaths)
+
+list(FIND CMAKE_CXX_COMPILE_FEATURES "cxx_variadic_templates" index)
+if (${index} GREATER -1)
+ # Use cxx_variadic_templates instead of more appropriate cxx_std_11 for
+ # compatibility with older CMake versions.
+ set(FMT_REQUIRED_FEATURES cxx_variadic_templates)
+endif ()
+message(STATUS "Required features: ${FMT_REQUIRED_FEATURES}")
+
+if (FMT_MASTER_PROJECT AND NOT DEFINED CMAKE_CXX_VISIBILITY_PRESET)
+ set_verbose(CMAKE_CXX_VISIBILITY_PRESET hidden CACHE STRING
+ "Preset for the export of private symbols")
+ set_property(CACHE CMAKE_CXX_VISIBILITY_PRESET PROPERTY STRINGS
+ hidden default)
+endif ()
+
+if (FMT_MASTER_PROJECT AND NOT DEFINED CMAKE_VISIBILITY_INLINES_HIDDEN)
+ set_verbose(CMAKE_VISIBILITY_INLINES_HIDDEN ON CACHE BOOL
+ "Whether to add a compile flag to hide symbols of inline functions")
+endif ()
+
+if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ set(PEDANTIC_COMPILE_FLAGS -pedantic-errors -Wall -Wextra -pedantic
+ -Wold-style-cast -Wundef
+ -Wredundant-decls -Wwrite-strings -Wpointer-arith
+ -Wcast-qual -Wformat=2 -Wmissing-include-dirs
+ -Wcast-align
+ -Wctor-dtor-privacy -Wdisabled-optimization
+ -Winvalid-pch -Woverloaded-virtual
+ -Wconversion -Wundef
+ -Wno-ctor-dtor-privacy -Wno-format-nonliteral)
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6)
+ set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS}
+ -Wno-dangling-else -Wno-unused-local-typedefs)
+ endif ()
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
+ set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS} -Wdouble-promotion
+ -Wtrampolines -Wzero-as-null-pointer-constant -Wuseless-cast
+ -Wvector-operation-performance -Wsized-deallocation -Wshadow)
+ endif ()
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
+ set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS} -Wshift-overflow=2
+ -Wnull-dereference -Wduplicated-cond)
+ endif ()
+ set(WERROR_FLAG -Werror)
+endif ()
+
+if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ set(PEDANTIC_COMPILE_FLAGS -Wall -Wextra -pedantic -Wconversion -Wundef
+ -Wdeprecated -Wweak-vtables -Wshadow
+ -Wno-gnu-zero-variadic-macro-arguments)
+ check_cxx_compiler_flag(-Wzero-as-null-pointer-constant HAS_NULLPTR_WARNING)
+ if (HAS_NULLPTR_WARNING)
+ set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS}
+ -Wzero-as-null-pointer-constant)
+ endif ()
+ set(WERROR_FLAG -Werror)
+endif ()
+
+if (MSVC)
+ set(PEDANTIC_COMPILE_FLAGS /W3)
+ set(WERROR_FLAG /WX)
+endif ()
+
+if (FMT_MASTER_PROJECT AND CMAKE_GENERATOR MATCHES "Visual Studio")
+ # If Microsoft SDK is installed create script run-msbuild.bat that
+ # calls SetEnv.cmd to set up build environment and runs msbuild.
+ # It is useful when building Visual Studio projects with the SDK
+ # toolchain rather than Visual Studio.
+ include(FindSetEnv)
+ if (WINSDK_SETENV)
+ set(MSBUILD_SETUP "call \"${WINSDK_SETENV}\"")
+ endif ()
+ # Set FrameworkPathOverride to get rid of MSB3644 warnings.
+ join(netfxpath
+ "C:\\Program Files\\Reference Assemblies\\Microsoft\\Framework\\"
+ ".NETFramework\\v4.0")
+ file(WRITE run-msbuild.bat "
+ ${MSBUILD_SETUP}
+ ${CMAKE_MAKE_PROGRAM} -p:FrameworkPathOverride=\"${netfxpath}\" %*")
+endif ()
+
+set(strtod_l_headers stdlib.h)
+if (APPLE)
+ set(strtod_l_headers ${strtod_l_headers} xlocale.h)
+endif ()
+
+include(CheckSymbolExists)
+if (WIN32)
+ check_symbol_exists(_strtod_l "${strtod_l_headers}" HAVE_STRTOD_L)
+else ()
+ check_symbol_exists(strtod_l "${strtod_l_headers}" HAVE_STRTOD_L)
+endif ()
+
+function(add_headers VAR)
+ set(headers ${${VAR}})
+ foreach (header ${ARGN})
+ set(headers ${headers} include/fmt/${header})
+ endforeach()
+ set(${VAR} ${headers} PARENT_SCOPE)
+endfunction()
+
+# Define the fmt library, its includes and the needed defines.
+add_headers(FMT_HEADERS args.h chrono.h color.h compile.h core.h format.h
+ format-inl.h locale.h os.h ostream.h printf.h ranges.h
+ xchar.h)
+if (FMT_MODULE)
+ set(FMT_SOURCES src/fmt.cc)
+elseif (FMT_OS)
+ set(FMT_SOURCES src/format.cc src/os.cc)
+else()
+ set(FMT_SOURCES src/format.cc)
+endif ()
+
+add_library(fmt ${FMT_SOURCES} ${FMT_HEADERS} README.rst ChangeLog.rst)
+add_library(fmt::fmt ALIAS fmt)
+
+if (HAVE_STRTOD_L)
+ target_compile_definitions(fmt PUBLIC FMT_LOCALE)
+endif ()
+
+if (MINGW)
+ check_cxx_compiler_flag("-Wa,-mbig-obj" FMT_HAS_MBIG_OBJ)
+ if (${FMT_HAS_MBIG_OBJ})
+ target_compile_options(fmt PUBLIC "-Wa,-mbig-obj")
+ endif()
+endif ()
+
+if (FMT_WERROR)
+ target_compile_options(fmt PRIVATE ${WERROR_FLAG})
+endif ()
+if (FMT_PEDANTIC)
+ target_compile_options(fmt PRIVATE ${PEDANTIC_COMPILE_FLAGS})
+endif ()
+if (FMT_MODULE)
+ enable_module(fmt)
+endif ()
+
+target_compile_features(fmt INTERFACE ${FMT_REQUIRED_FEATURES})
+
+target_include_directories(fmt ${FMT_SYSTEM_HEADERS_ATTRIBUTE} PUBLIC
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
+ $<INSTALL_INTERFACE:${FMT_INC_DIR}>)
+
+set(FMT_DEBUG_POSTFIX d CACHE STRING "Debug library postfix.")
+
+set_target_properties(fmt PROPERTIES
+ VERSION ${FMT_VERSION} SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}
+ DEBUG_POSTFIX "${FMT_DEBUG_POSTFIX}")
+
+# Set FMT_LIB_NAME for pkg-config fmt.pc. We cannot use the OUTPUT_NAME target
+# property because it's not set by default.
+set(FMT_LIB_NAME fmt)
+if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+ set(FMT_LIB_NAME ${FMT_LIB_NAME}${FMT_DEBUG_POSTFIX})
+endif ()
+
+if (BUILD_SHARED_LIBS)
+ if (UNIX AND NOT APPLE AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS" AND
+ NOT EMSCRIPTEN)
+ # Fix rpmlint warning:
+ # unused-direct-shlib-dependency /usr/lib/libformat.so.1.1.0 /lib/libm.so.6.
+ target_link_libraries(fmt -Wl,--as-needed)
+ endif ()
+ target_compile_definitions(fmt PRIVATE FMT_EXPORT INTERFACE FMT_SHARED)
+endif ()
+if (FMT_SAFE_DURATION_CAST)
+ target_compile_definitions(fmt PUBLIC FMT_SAFE_DURATION_CAST)
+endif()
+
+add_library(fmt-header-only INTERFACE)
+add_library(fmt::fmt-header-only ALIAS fmt-header-only)
+
+target_compile_definitions(fmt-header-only INTERFACE FMT_HEADER_ONLY=1)
+target_compile_features(fmt-header-only INTERFACE ${FMT_REQUIRED_FEATURES})
+
+target_include_directories(fmt-header-only ${FMT_SYSTEM_HEADERS_ATTRIBUTE} INTERFACE
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
+ $<INSTALL_INTERFACE:${FMT_INC_DIR}>)
+
+# Install targets.
+if (FMT_INSTALL)
+ include(CMakePackageConfigHelpers)
+ set_verbose(FMT_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/fmt CACHE STRING
+ "Installation directory for cmake files, a relative path that "
+ "will be joined with ${CMAKE_INSTALL_PREFIX} or an absolute "
+ "path.")
+ set(version_config ${PROJECT_BINARY_DIR}/fmt-config-version.cmake)
+ set(project_config ${PROJECT_BINARY_DIR}/fmt-config.cmake)
+ set(pkgconfig ${PROJECT_BINARY_DIR}/fmt.pc)
+ set(targets_export_name fmt-targets)
+
+ set_verbose(FMT_LIB_DIR ${CMAKE_INSTALL_LIBDIR} CACHE STRING
+ "Installation directory for libraries, a relative path that "
+ "will be joined to ${CMAKE_INSTALL_PREFIX} or an absolute path.")
+
+ set_verbose(FMT_PKGCONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig CACHE PATH
+ "Installation directory for pkgconfig (.pc) files, a relative "
+ "path that will be joined with ${CMAKE_INSTALL_PREFIX} or an "
+ "absolute path.")
+
+ # Generate the version, config and target files into the build directory.
+ write_basic_package_version_file(
+ ${version_config}
+ VERSION ${FMT_VERSION}
+ COMPATIBILITY AnyNewerVersion)
+
+ join_paths(libdir_for_pc_file "\${exec_prefix}" "${FMT_LIB_DIR}")
+ join_paths(includedir_for_pc_file "\${prefix}" "${FMT_INC_DIR}")
+
+ configure_file(
+ "${PROJECT_SOURCE_DIR}/support/cmake/fmt.pc.in"
+ "${pkgconfig}"
+ @ONLY)
+ configure_package_config_file(
+ ${PROJECT_SOURCE_DIR}/support/cmake/fmt-config.cmake.in
+ ${project_config}
+ INSTALL_DESTINATION ${FMT_CMAKE_DIR})
+
+ set(INSTALL_TARGETS fmt fmt-header-only)
+
+ # Install the library and headers.
+ install(TARGETS ${INSTALL_TARGETS} EXPORT ${targets_export_name}
+ LIBRARY DESTINATION ${FMT_LIB_DIR}
+ ARCHIVE DESTINATION ${FMT_LIB_DIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+ # Use a namespace because CMake provides better diagnostics for namespaced
+ # imported targets.
+ export(TARGETS ${INSTALL_TARGETS} NAMESPACE fmt::
+ FILE ${PROJECT_BINARY_DIR}/${targets_export_name}.cmake)
+
+ # Install version, config and target files.
+ install(
+ FILES ${project_config} ${version_config}
+ DESTINATION ${FMT_CMAKE_DIR})
+ install(EXPORT ${targets_export_name} DESTINATION ${FMT_CMAKE_DIR}
+ NAMESPACE fmt::)
+
+ install(FILES $<TARGET_PDB_FILE:${INSTALL_TARGETS}>
+ DESTINATION ${FMT_LIB_DIR} OPTIONAL)
+ install(FILES ${FMT_HEADERS} DESTINATION "${FMT_INC_DIR}/fmt")
+ install(FILES "${pkgconfig}" DESTINATION "${FMT_PKGCONFIG_DIR}")
+endif ()
+
+if (FMT_DOC)
+ add_subdirectory(doc)
+endif ()
+
+if (FMT_TEST)
+ enable_testing()
+ add_subdirectory(test)
+endif ()
+
+# Control fuzzing independent of the unit tests.
+if (FMT_FUZZ)
+ add_subdirectory(test/fuzzing)
+
+ # The FMT_FUZZ macro is used to prevent resource exhaustion in fuzzing
+ # mode and make fuzzing practically possible. It is similar to
+ # FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION but uses a different name to
+ # avoid interfering with fuzzing of projects that use {fmt}.
+ # See also https://llvm.org/docs/LibFuzzer.html#fuzzer-friendly-build-mode.
+ target_compile_definitions(fmt PUBLIC FMT_FUZZ)
+endif ()
+
+set(gitignore ${PROJECT_SOURCE_DIR}/.gitignore)
+if (FMT_MASTER_PROJECT AND EXISTS ${gitignore})
+ # Get the list of ignored files from .gitignore.
+ file (STRINGS ${gitignore} lines)
+ list(REMOVE_ITEM lines /doc/html)
+ foreach (line ${lines})
+ string(REPLACE "." "[.]" line "${line}")
+ string(REPLACE "*" ".*" line "${line}")
+ set(ignored_files ${ignored_files} "${line}$" "${line}/")
+ endforeach ()
+ set(ignored_files ${ignored_files}
+ /.git /breathe /format-benchmark sphinx/ .buildinfo .doctrees)
+
+ set(CPACK_SOURCE_GENERATOR ZIP)
+ set(CPACK_SOURCE_IGNORE_FILES ${ignored_files})
+ set(CPACK_SOURCE_PACKAGE_FILE_NAME fmt-${FMT_VERSION})
+ set(CPACK_PACKAGE_NAME fmt)
+ set(CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR}/README.rst)
+ include(CPack)
+endif ()
diff --git a/source/misc/embedded_libs/fmt-8.1.1/doc/CMakeLists.txt b/source/misc/embedded_libs/fmt-8.1.1/doc/CMakeLists.txt new file mode 100644 index 0000000..0684845 --- /dev/null +++ b/source/misc/embedded_libs/fmt-8.1.1/doc/CMakeLists.txt
@@ -0,0 +1,17 @@
+find_program(DOXYGEN doxygen)
+if (NOT DOXYGEN)
+ message(STATUS "Target 'doc' disabled (requires doxygen)")
+ return ()
+endif ()
+
+find_package(PythonInterp QUIET REQUIRED)
+
+add_custom_target(doc
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/build.py
+ ${FMT_VERSION}
+ SOURCES api.rst syntax.rst usage.rst build.py conf.py _templates/layout.html)
+
+include(GNUInstallDirs)
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/fmt OPTIONAL
+ PATTERN ".doctrees" EXCLUDE)
diff --git a/source/misc/embedded_libs/fmt-8.1.1/test/CMakeLists.txt b/source/misc/embedded_libs/fmt-8.1.1/test/CMakeLists.txt new file mode 100644 index 0000000..7ed8d5f --- /dev/null +++ b/source/misc/embedded_libs/fmt-8.1.1/test/CMakeLists.txt
@@ -0,0 +1,244 @@
+add_subdirectory(gtest)
+
+set(TEST_MAIN_SRC test-main.cc gtest-extra.cc gtest-extra.h util.cc)
+add_library(test-main STATIC ${TEST_MAIN_SRC})
+target_include_directories(test-main PUBLIC
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
+target_link_libraries(test-main gtest)
+
+include(CheckCXXCompilerFlag)
+
+function(add_fmt_executable name)
+ add_executable(${name} ${ARGN})
+ if (MINGW)
+ target_link_libraries(${name} -static-libgcc -static-libstdc++)
+ endif ()
+ # (Wstringop-overflow) - [meta-bug] bogus/missing -Wstringop-overflow warnings
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443
+ # Bogus -Wstringop-overflow warning
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100395
+ # [10 Regression] spurious -Wstringop-overflow writing to a trailing array plus offset
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95353
+ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND
+ NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
+ target_link_libraries(${name} -Wno-stringop-overflow)
+ endif ()
+endfunction()
+
+# Adds a test.
+# Usage: add_fmt_test(name srcs...)
+function(add_fmt_test name)
+ cmake_parse_arguments(ADD_FMT_TEST "HEADER_ONLY;MODULE" "" "" ${ARGN})
+
+ set(sources ${name}.cc ${ADD_FMT_TEST_UNPARSED_ARGUMENTS})
+ if (ADD_FMT_TEST_HEADER_ONLY)
+ set(sources ${sources} ${TEST_MAIN_SRC} ../src/os.cc)
+ set(libs gtest fmt-header-only)
+ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS} -Wno-weak-vtables)
+ endif ()
+ elseif (ADD_FMT_TEST_MODULE)
+ set(libs gtest test-module)
+ set_source_files_properties(${name}.cc PROPERTIES OBJECT_DEPENDS test-module)
+ else ()
+ set(libs test-main fmt)
+ endif ()
+ add_fmt_executable(${name} ${sources})
+ target_link_libraries(${name} ${libs})
+
+ # Define if certain C++ features can be used.
+ if (FMT_PEDANTIC)
+ target_compile_options(${name} PRIVATE ${PEDANTIC_COMPILE_FLAGS})
+ endif ()
+ if (FMT_WERROR)
+ target_compile_options(${name} PRIVATE ${WERROR_FLAG})
+ endif ()
+ add_test(NAME ${name} COMMAND ${name})
+endfunction()
+
+add_fmt_test(args-test)
+add_fmt_test(assert-test)
+add_fmt_test(chrono-test)
+add_fmt_test(color-test)
+add_fmt_test(core-test)
+add_fmt_test(gtest-extra-test)
+add_fmt_test(format-test mock-allocator.h)
+if (MSVC)
+ target_compile_options(format-test PRIVATE /bigobj)
+endif ()
+if (NOT (MSVC AND BUILD_SHARED_LIBS))
+ add_fmt_test(format-impl-test HEADER_ONLY header-only-test.cc)
+endif ()
+add_fmt_test(ostream-test)
+add_fmt_test(compile-test)
+add_fmt_test(compile-fp-test HEADER_ONLY)
+if (MSVC)
+ # Without this option, MSVC returns 199711L for the __cplusplus macro.
+ target_compile_options(compile-fp-test PRIVATE /Zc:__cplusplus)
+endif()
+add_fmt_test(printf-test)
+add_fmt_test(ranges-test ranges-odr-test.cc)
+add_fmt_test(scan-test)
+add_fmt_test(unicode-test HEADER_ONLY)
+if (MSVC)
+ target_compile_options(unicode-test PRIVATE /utf-8)
+endif ()
+add_fmt_test(xchar-test)
+add_fmt_test(enforce-checks-test)
+target_compile_definitions(enforce-checks-test PRIVATE
+ -DFMT_ENFORCE_COMPILE_STRING)
+
+if (FMT_CAN_MODULE)
+ # The tests need {fmt} to be compiled as traditional library
+ # because of visibility of implementation details.
+ # If module support is present the module tests require a
+ # test-only module to be built from {fmt}
+ add_library(test-module OBJECT ${CMAKE_SOURCE_DIR}/src/fmt.cc)
+ target_compile_features(test-module PUBLIC ${FMT_REQUIRED_FEATURES})
+ target_include_directories(test-module PUBLIC
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
+ enable_module(test-module)
+
+ add_fmt_test(module-test MODULE test-main.cc)
+ if (MSVC)
+ target_compile_options(test-module PRIVATE /utf-8 /Zc:__cplusplus
+ /Zc:externConstexpr /Zc:inline)
+ target_compile_options(module-test PRIVATE /utf-8 /Zc:__cplusplus
+ /Zc:externConstexpr /Zc:inline)
+ endif ()
+endif ()
+
+if (NOT DEFINED MSVC_STATIC_RUNTIME AND MSVC)
+ foreach (flag_var
+ CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+ CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+ if (${flag_var} MATCHES "^(/|-)(MT|MTd)")
+ set(MSVC_STATIC_RUNTIME ON)
+ break()
+ endif()
+ endforeach()
+endif()
+
+if (NOT MSVC_STATIC_RUNTIME)
+ add_fmt_executable(posix-mock-test
+ posix-mock-test.cc ../src/format.cc ${TEST_MAIN_SRC})
+ target_include_directories(
+ posix-mock-test PRIVATE ${PROJECT_SOURCE_DIR}/include)
+ target_link_libraries(posix-mock-test gtest)
+ if (FMT_PEDANTIC)
+ target_compile_options(posix-mock-test PRIVATE ${PEDANTIC_COMPILE_FLAGS})
+ endif ()
+ if (HAVE_STRTOD_L)
+ target_compile_definitions(posix-mock-test PRIVATE FMT_LOCALE)
+ endif ()
+ add_test(NAME posix-mock-test COMMAND posix-mock-test)
+ add_fmt_test(os-test)
+endif ()
+
+message(STATUS "FMT_PEDANTIC: ${FMT_PEDANTIC}")
+
+if (FMT_PEDANTIC)
+ # Test that the library can be compiled with exceptions disabled.
+ # -fno-exception is broken in icc: https://github.com/fmtlib/fmt/issues/822.
+ if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ check_cxx_compiler_flag(-fno-exceptions HAVE_FNO_EXCEPTIONS_FLAG)
+ endif ()
+ if (HAVE_FNO_EXCEPTIONS_FLAG)
+ add_library(noexception-test ../src/format.cc noexception-test.cc)
+ target_include_directories(
+ noexception-test PRIVATE ${PROJECT_SOURCE_DIR}/include)
+ target_compile_options(noexception-test PRIVATE -fno-exceptions)
+ if (FMT_PEDANTIC)
+ target_compile_options(noexception-test PRIVATE ${PEDANTIC_COMPILE_FLAGS})
+ endif ()
+ endif ()
+
+ # Test that the library compiles without locale.
+ add_library(nolocale-test ../src/format.cc)
+ target_include_directories(
+ nolocale-test PRIVATE ${PROJECT_SOURCE_DIR}/include)
+ target_compile_definitions(
+ nolocale-test PRIVATE FMT_STATIC_THOUSANDS_SEPARATOR=1)
+endif ()
+
+# These tests are disabled on Windows because they take too long.
+if (FMT_PEDANTIC AND NOT WIN32)
+ # Test if incorrect API usages produce compilation error.
+ add_test(compile-error-test ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMAKE_CURRENT_SOURCE_DIR}/compile-error-test"
+ "${CMAKE_CURRENT_BINARY_DIR}/compile-error-test"
+ --build-generator ${CMAKE_GENERATOR}
+ --build-makeprogram ${CMAKE_MAKE_PROGRAM}
+ --build-options
+ "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
+ "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}"
+ "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}"
+ "-DFMT_DIR=${CMAKE_SOURCE_DIR}"
+ "-DSUPPORTS_USER_DEFINED_LITERALS=${SUPPORTS_USER_DEFINED_LITERALS}")
+
+ # Test if the targets are found from the build directory.
+ add_test(find-package-test ${CMAKE_CTEST_COMMAND}
+ -C ${CMAKE_BUILD_TYPE}
+ --build-and-test
+ "${CMAKE_CURRENT_SOURCE_DIR}/find-package-test"
+ "${CMAKE_CURRENT_BINARY_DIR}/find-package-test"
+ --build-generator ${CMAKE_GENERATOR}
+ --build-makeprogram ${CMAKE_MAKE_PROGRAM}
+ --build-options
+ "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
+ "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}"
+ "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}"
+ "-DFMT_DIR=${PROJECT_BINARY_DIR}"
+ "-DPEDANTIC_COMPILE_FLAGS=${PEDANTIC_COMPILE_FLAGS}"
+ "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
+
+ # Test if the targets are found when add_subdirectory is used.
+ add_test(add-subdirectory-test ${CMAKE_CTEST_COMMAND}
+ -C ${CMAKE_BUILD_TYPE}
+ --build-and-test
+ "${CMAKE_CURRENT_SOURCE_DIR}/add-subdirectory-test"
+ "${CMAKE_CURRENT_BINARY_DIR}/add-subdirectory-test"
+ --build-generator ${CMAKE_GENERATOR}
+ --build-makeprogram ${CMAKE_MAKE_PROGRAM}
+ --build-options
+ "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
+ "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}"
+ "-DPEDANTIC_COMPILE_FLAGS=${PEDANTIC_COMPILE_FLAGS}"
+ "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
+endif ()
+
+# This test are disabled on Windows because it is only *NIX issue.
+if (FMT_PEDANTIC AND NOT WIN32)
+ add_test(static-export-test ${CMAKE_CTEST_COMMAND}
+ -C ${CMAKE_BUILD_TYPE}
+ --build-and-test
+ "${CMAKE_CURRENT_SOURCE_DIR}/static-export-test"
+ "${CMAKE_CURRENT_BINARY_DIR}/static-export-test"
+ --build-generator ${CMAKE_GENERATOR}
+ --build-makeprogram ${CMAKE_MAKE_PROGRAM}
+ --build-options
+ "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
+ "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}"
+ "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
+endif ()
+
+# Activate optional CUDA tests if CUDA is found. For version selection see
+# https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#cpp14-language-features
+if (FMT_CUDA_TEST)
+ if (${CMAKE_VERSION} VERSION_LESS 3.15)
+ find_package(CUDA 9.0)
+ else ()
+ include(CheckLanguage)
+ check_language(CUDA)
+ if (CMAKE_CUDA_COMPILER)
+ enable_language(CUDA OPTIONAL)
+ set(CUDA_FOUND TRUE)
+ endif ()
+ endif ()
+
+ if (CUDA_FOUND)
+ add_subdirectory(cuda-test)
+ add_test(NAME cuda-test COMMAND fmt-in-cuda-test)
+ endif ()
+endif ()
diff --git a/source/misc/embedded_libs/fmt-8.1.1/test/add-subdirectory-test/CMakeLists.txt b/source/misc/embedded_libs/fmt-8.1.1/test/add-subdirectory-test/CMakeLists.txt new file mode 100644 index 0000000..e08d0cf --- /dev/null +++ b/source/misc/embedded_libs/fmt-8.1.1/test/add-subdirectory-test/CMakeLists.txt
@@ -0,0 +1,17 @@
+cmake_minimum_required(VERSION 3.1...3.18)
+
+project(fmt-test CXX)
+
+add_subdirectory(../.. fmt)
+
+add_executable(library-test main.cc)
+target_include_directories(library-test PUBLIC SYSTEM .)
+target_compile_options(library-test PRIVATE ${PEDANTIC_COMPILE_FLAGS})
+target_link_libraries(library-test fmt::fmt)
+
+if (TARGET fmt::fmt-header-only)
+ add_executable(header-only-test main.cc)
+ target_include_directories(header-only-test PUBLIC SYSTEM .)
+ target_compile_options(header-only-test PRIVATE ${PEDANTIC_COMPILE_FLAGS})
+ target_link_libraries(header-only-test fmt::fmt-header-only)
+endif ()
diff --git a/source/misc/embedded_libs/fmt-8.1.1/test/compile-error-test/CMakeLists.txt b/source/misc/embedded_libs/fmt-8.1.1/test/compile-error-test/CMakeLists.txt new file mode 100644 index 0000000..db7a942 --- /dev/null +++ b/source/misc/embedded_libs/fmt-8.1.1/test/compile-error-test/CMakeLists.txt
@@ -0,0 +1,203 @@
+# Test if compile errors are produced where necessary.
+
+cmake_minimum_required(VERSION 3.1...3.18)
+project(compile-error-test CXX)
+
+set(fmt_headers "
+ #include <fmt/format.h>
+ #include <fmt/xchar.h>
+")
+
+set(error_test_names "")
+set(non_error_test_content "")
+
+# For error tests (we expect them to produce compilation error):
+# * adds a name of test into `error_test_names` list
+# * generates a single source file (with the same name) for each test
+# For non-error tests (we expect them to compile successfully):
+# * adds a code segment as separate function to `non_error_test_content`
+function (expect_compile name code_fragment)
+ cmake_parse_arguments(EXPECT_COMPILE "ERROR" "" "" ${ARGN})
+ string(MAKE_C_IDENTIFIER "${name}" test_name)
+
+ if (EXPECT_COMPILE_ERROR)
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test/${test_name}.cc" "
+ ${fmt_headers}
+ void ${test_name}() {
+ ${code_fragment}
+ }
+ ")
+ set(error_test_names_copy "${error_test_names}")
+ list(APPEND error_test_names_copy "${test_name}")
+ set(error_test_names "${error_test_names_copy}" PARENT_SCOPE)
+ else()
+ set(non_error_test_content "
+ ${non_error_test_content}
+ void ${test_name}() {
+ ${code_fragment}
+ }" PARENT_SCOPE)
+ endif()
+endfunction ()
+
+# Generates a source file for non-error test with `non_error_test_content` and
+# CMake project file with all error and single non-error test targets.
+function (run_tests)
+ set(cmake_targets "")
+ foreach(test_name IN LISTS error_test_names)
+ set(cmake_targets "
+ ${cmake_targets}
+ add_library(test-${test_name} ${test_name}.cc)
+ target_link_libraries(test-${test_name} PRIVATE fmt::fmt)
+ ")
+ endforeach()
+
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test/non_error_test.cc" "
+ ${fmt_headers}
+ ${non_error_test_content}
+ ")
+ set(cmake_targets "
+ ${cmake_targets}
+ add_library(non-error-test non_error_test.cc)
+ target_link_libraries(non-error-test PRIVATE fmt::fmt)
+ ")
+
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test/CMakeLists.txt" "
+ cmake_minimum_required(VERSION 3.1...3.18)
+ project(tests CXX)
+ add_subdirectory(${FMT_DIR} fmt)
+ ${cmake_targets}
+ ")
+
+ set(build_directory "${CMAKE_CURRENT_BINARY_DIR}/test/build")
+ file(MAKE_DIRECTORY "${build_directory}")
+ execute_process(
+ COMMAND
+ "${CMAKE_COMMAND}"
+ "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
+ "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}"
+ "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}"
+ "-DCMAKE_GENERATOR=${CMAKE_GENERATOR}"
+ "-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}"
+ "-DFMT_DIR=${FMT_DIR}"
+ "${CMAKE_CURRENT_BINARY_DIR}/test"
+ WORKING_DIRECTORY "${build_directory}"
+ RESULT_VARIABLE result_var
+ OUTPUT_VARIABLE output_var
+ ERROR_VARIABLE output_var)
+ if (NOT result_var EQUAL 0)
+ message(FATAL_ERROR "Unable to configure:\n${output_var}")
+ endif()
+
+ foreach(test_name IN LISTS error_test_names)
+ execute_process(
+ COMMAND
+ "${CMAKE_COMMAND}" --build "${build_directory}" --target "test-${test_name}"
+ WORKING_DIRECTORY "${build_directory}"
+ RESULT_VARIABLE result_var
+ OUTPUT_VARIABLE output_var
+ ERROR_QUIET)
+ if (result_var EQUAL 0)
+ message(SEND_ERROR "No compile error for \"${test_name}\":\n${output_var}")
+ endif ()
+ endforeach()
+
+ execute_process(
+ COMMAND
+ "${CMAKE_COMMAND}" --build "${build_directory}" --target "non-error-test"
+ WORKING_DIRECTORY "${build_directory}"
+ RESULT_VARIABLE result_var
+ OUTPUT_VARIABLE output_var
+ ERROR_VARIABLE output_var)
+ if (NOT result_var EQUAL 0)
+ message(SEND_ERROR "Compile error for combined non-error test:\n${output_var}")
+ endif ()
+endfunction ()
+
+
+# check if the source file skeleton compiles
+expect_compile(check "")
+expect_compile(check-error "compilation_error" ERROR)
+
+# Formatting a wide character with a narrow format string is forbidden.
+expect_compile(wide-character-narrow-format-string "fmt::format(L\"{}\", L'a');")
+expect_compile(wide-character-narrow-format-string-error "fmt::format(\"{}\", L'a');" ERROR)
+
+# Formatting a wide string with a narrow format string is forbidden.
+expect_compile(wide-string-narrow-format-string "fmt::format(L\"{}\", L\"foo\");")
+expect_compile(wide-string-narrow-format-string-error "fmt::format(\"{}\", L\"foo\");" ERROR)
+
+# Formatting a narrow string with a wide format string is forbidden because
+# mixing UTF-8 with UTF-16/32 can result in an invalid output.
+expect_compile(narrow-string-wide-format-string "fmt::format(L\"{}\", L\"foo\");")
+expect_compile(narrow-string-wide-format-string-error "fmt::format(L\"{}\", \"foo\");" ERROR)
+
+expect_compile(cast-to-string "
+ struct S {
+ operator std::string() const { return std::string(); }
+ };
+ fmt::format(\"{}\", std::string(S()));
+")
+expect_compile(cast-to-string-error "
+ struct S {
+ operator std::string() const { return std::string(); }
+ };
+ fmt::format(\"{}\", S());
+" ERROR)
+
+# Formatting a function
+expect_compile(format-function "
+ void (*f)();
+ fmt::format(\"{}\", fmt::ptr(f));
+")
+expect_compile(format-function-error "
+ void (*f)();
+ fmt::format(\"{}\", f);
+" ERROR)
+
+# Make sure that compiler features detected in the header
+# match the features detected in CMake.
+if (SUPPORTS_USER_DEFINED_LITERALS)
+ set(supports_udl 1)
+else ()
+ set(supports_udl 0)
+endif ()
+expect_compile(udl-check "
+ #if FMT_USE_USER_DEFINED_LITERALS != ${supports_udl}
+ # error
+ #endif
+")
+
+if (CMAKE_CXX_STANDARD GREATER_EQUAL 20)
+ # Compile-time argument type check
+ expect_compile(format-string-number-spec "
+ #ifdef FMT_HAS_CONSTEVAL
+ fmt::format(\"{:d}\", 42);
+ #endif
+ ")
+ expect_compile(format-string-number-spec-error "
+ #ifdef FMT_HAS_CONSTEVAL
+ fmt::format(\"{:d}\", \"I am not a number\");
+ #else
+ #error
+ #endif
+ " ERROR)
+
+ # Compile-time argument name check
+ expect_compile(format-string-name "
+ #if defined(FMT_HAS_CONSTEVAL) && FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
+ using namespace fmt::literals;
+ fmt::print(\"{foo}\", \"foo\"_a=42);
+ #endif
+ ")
+ expect_compile(format-string-name-error "
+ #if defined(FMT_HAS_CONSTEVAL) && FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
+ using namespace fmt::literals;
+ fmt::print(\"{foo}\", \"bar\"_a=42);
+ #else
+ #error
+ #endif
+ " ERROR)
+endif ()
+
+# Run all tests
+run_tests()
diff --git a/source/misc/embedded_libs/fmt-8.1.1/test/cuda-test/CMakeLists.txt b/source/misc/embedded_libs/fmt-8.1.1/test/cuda-test/CMakeLists.txt new file mode 100644 index 0000000..be8685b --- /dev/null +++ b/source/misc/embedded_libs/fmt-8.1.1/test/cuda-test/CMakeLists.txt
@@ -0,0 +1,73 @@
+# We can find some usecases which follow the guide of CMake which uses
+# `enable_language(CUDA)` instead of `find_package(CUDA)` and let the CMake
+# built-in functions use NVCC.
+
+# See: https://cmake.org/cmake/help/latest/module/FindCUDA.html#replacement
+#
+# However, this requires CMake version 3.10 or higher and we can't be sure most
+# of the CUDA projects are using those.
+#
+# This test relies on `find_package(CUDA)` in the parent CMake config.
+
+# These can be updated when NVCC becomes ready for C++ 17 features
+# https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#cpp14-language-features
+set(CMAKE_CUDA_STANDARD 14)
+set(CMAKE_CUDA_STANDARD_REQUIRED 14)
+
+# In this test, we assume that the user is going to compile CUDA source code
+# with some libraries (fmt in this case).
+#
+# In addition to that, this test invokes both the C++ host compiler and NVCC
+# by providing another (non-CUDA) C++ source code.
+if (${CMAKE_VERSION} VERSION_LESS 3.15)
+ # https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html
+ list(APPEND CUDA_NVCC_FLAGS "-std=c++14")
+ if (MSVC)
+ # This is the solution of pytorch:
+ # https://github.com/pytorch/pytorch/pull/7118
+ list(APPEND CUDA_NVCC_FLAGS "-Xcompiler" "/std:c++14")
+ list(APPEND CUDA_NVCC_FLAGS "-Xcompiler" "/Zc:__cplusplus")
+ # for the reason of this -Xcompiler options, see below.
+ endif ()
+ cuda_add_executable(fmt-in-cuda-test cuda-cpp14.cu cpp14.cc)
+ target_compile_features(fmt-in-cuda-test PRIVATE cxx_std_14)
+ if (MSVC)
+ # This part is for (non-CUDA) C++ code. MSVC can define incorrect
+ # `__cplusplus` macro. Fix for the issue is to use additional compiler flag.
+ #
+ # See Also:
+ # https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
+ # https://github.com/Microsoft/vscode-cpptools/issues/2595
+ target_compile_options(fmt-in-cuda-test PRIVATE /Zc:__cplusplus /permissive-)
+ endif ()
+else()
+ # now using a "new" way of handling CUDA
+ add_executable(fmt-in-cuda-test cuda-cpp14.cu cpp14.cc)
+ set_target_properties(fmt-in-cuda-test PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
+ target_compile_features(fmt-in-cuda-test PRIVATE cxx_std_14)
+ if (MSVC)
+ # with MSVC, 'cxx_std_14' will only propagate to the host code (MSVC), but will
+ # not set __cplusplus correctly anyway, while nvcc will ignore it.
+ # If specified for nvcc on the command line as '-std=c++14' nvcc will emit this
+ # message instead:
+ # nvcc warning : The -std=c++14 flag is not supported with the configured host
+ # compiler. Flag will be ignored.
+ set_property(SOURCE cuda-cpp14.cu APPEND PROPERTY
+ COMPILE_OPTIONS -Xcompiler /std:c++14 -Xcompiler /Zc:__cplusplus)
+ set_property(SOURCE cpp14.cc APPEND PROPERTY
+ COMPILE_OPTIONS /std:c++14 /Zc:__cplusplus)
+ endif()
+endif()
+
+get_target_property(IN_USE_CUDA_STANDARD fmt-in-cuda-test CUDA_STANDARD)
+message(STATUS "cuda_standard: ${IN_USE_CUDA_STANDARD}")
+
+get_target_property(IN_USE_CUDA_STANDARD_REQUIRED
+ fmt-in-cuda-test CUDA_STANDARD_REQUIRED)
+message(STATUS "cuda_standard_required: ${IN_USE_CUDA_STANDARD_REQUIRED}")
+
+# We don't use PUBLIC or other keyword for reasons explained in the
+# CUDA_LINK_LIBRARIES_KEYWORD section in
+# https://cmake.org/cmake/help/latest/module/FindCUDA.html
+target_link_libraries(fmt-in-cuda-test fmt::fmt)
+
diff --git a/source/misc/embedded_libs/fmt-8.1.1/test/find-package-test/CMakeLists.txt b/source/misc/embedded_libs/fmt-8.1.1/test/find-package-test/CMakeLists.txt new file mode 100644 index 0000000..93d686e --- /dev/null +++ b/source/misc/embedded_libs/fmt-8.1.1/test/find-package-test/CMakeLists.txt
@@ -0,0 +1,17 @@
+cmake_minimum_required(VERSION 3.1...3.18)
+
+project(fmt-test)
+
+find_package(FMT REQUIRED)
+
+add_executable(library-test main.cc)
+target_link_libraries(library-test fmt::fmt)
+target_compile_options(library-test PRIVATE ${PEDANTIC_COMPILE_FLAGS})
+target_include_directories(library-test PUBLIC SYSTEM .)
+
+if (TARGET fmt::fmt-header-only)
+ add_executable(header-only-test main.cc)
+ target_link_libraries(header-only-test fmt::fmt-header-only)
+ target_compile_options(header-only-test PRIVATE ${PEDANTIC_COMPILE_FLAGS})
+ target_include_directories(header-only-test PUBLIC SYSTEM .)
+endif ()
diff --git a/source/misc/embedded_libs/fmt-8.1.1/test/fuzzing/CMakeLists.txt b/source/misc/embedded_libs/fmt-8.1.1/test/fuzzing/CMakeLists.txt new file mode 100644 index 0000000..0280c5c --- /dev/null +++ b/source/misc/embedded_libs/fmt-8.1.1/test/fuzzing/CMakeLists.txt
@@ -0,0 +1,30 @@
+# Copyright (c) 2019, Paul Dreik
+# License: see LICENSE.rst in the fmt root directory
+
+# Link in the main function. Useful for reproducing, kcov, gdb, afl, valgrind.
+# (Note that libFuzzer can also reproduce, just pass it the files.)
+option(FMT_FUZZ_LINKMAIN "Enables the reproduce mode, instead of libFuzzer" On)
+
+# For oss-fuzz - insert $LIB_FUZZING_ENGINE into the link flags, but only for
+# the fuzz targets, otherwise the CMake configuration step fails.
+set(FMT_FUZZ_LDFLAGS "" CACHE STRING "LDFLAGS for the fuzz targets")
+
+# Adds a binary for reproducing, i.e. no fuzzing, just enables replaying data
+# through the fuzzers.
+function(add_fuzzer source)
+ get_filename_component(basename ${source} NAME_WE)
+ set(name ${basename}-fuzzer)
+ add_executable(${name} ${source} fuzzer-common.h)
+ if (FMT_FUZZ_LINKMAIN)
+ target_sources(${name} PRIVATE main.cc)
+ endif ()
+ target_link_libraries(${name} PRIVATE fmt)
+ if (FMT_FUZZ_LDFLAGS)
+ target_link_libraries(${name} PRIVATE ${FMT_FUZZ_LDFLAGS})
+ endif ()
+ target_compile_features(${name} PRIVATE cxx_generic_lambdas)
+endfunction()
+
+foreach (source chrono-duration.cc chrono-timepoint.cc float.cc named-arg.cc one-arg.cc two-args.cc)
+ add_fuzzer(${source})
+endforeach ()
diff --git a/source/misc/embedded_libs/fmt-8.1.1/test/gtest/CMakeLists.txt b/source/misc/embedded_libs/fmt-8.1.1/test/gtest/CMakeLists.txt new file mode 100644 index 0000000..0cc4e1a --- /dev/null +++ b/source/misc/embedded_libs/fmt-8.1.1/test/gtest/CMakeLists.txt
@@ -0,0 +1,38 @@
+#------------------------------------------------------------------------------
+# Build the google test library
+
+# We compile Google Test ourselves instead of using pre-compiled libraries.
+# See the Google Test FAQ "Why is it not recommended to install a
+# pre-compiled copy of Google Test (for example, into /usr/local)?"
+# at http://code.google.com/p/googletest/wiki/FAQ for more details.
+add_library(gtest STATIC
+ gmock-gtest-all.cc gmock/gmock.h gtest/gtest.h gtest/gtest-spi.h)
+target_compile_definitions(gtest PUBLIC GTEST_HAS_STD_WSTRING=1)
+target_include_directories(gtest SYSTEM PUBLIC .)
+
+find_package(Threads)
+if (Threads_FOUND)
+ target_link_libraries(gtest ${CMAKE_THREAD_LIBS_INIT})
+else ()
+ target_compile_definitions(gtest PUBLIC GTEST_HAS_PTHREAD=0)
+endif ()
+
+# Workaround GTest bug https://github.com/google/googletest/issues/705.
+check_cxx_compiler_flag(
+ -fno-delete-null-pointer-checks HAVE_FNO_DELETE_NULL_POINTER_CHECKS)
+if (HAVE_FNO_DELETE_NULL_POINTER_CHECKS)
+ target_compile_options(gtest PUBLIC -fno-delete-null-pointer-checks)
+endif ()
+
+if (MSVC)
+ # Disable MSVC warnings of _CRT_INSECURE_DEPRECATE functions.
+ target_compile_definitions(gtest PRIVATE _CRT_SECURE_NO_WARNINGS)
+ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ # Disable MSVC warnings of POSIX functions.
+ target_compile_options(gtest PUBLIC -Wno-deprecated-declarations)
+ endif ()
+endif ()
+
+# Silence MSVC tr1 deprecation warning in gmock.
+target_compile_definitions(gtest
+ PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING=1)
diff --git a/source/misc/embedded_libs/fmt-8.1.1/test/static-export-test/CMakeLists.txt b/source/misc/embedded_libs/fmt-8.1.1/test/static-export-test/CMakeLists.txt new file mode 100644 index 0000000..7690d7b --- /dev/null +++ b/source/misc/embedded_libs/fmt-8.1.1/test/static-export-test/CMakeLists.txt
@@ -0,0 +1,30 @@
+cmake_minimum_required(VERSION 3.1...3.18)
+
+project(fmt-link CXX)
+
+set(BUILD_SHARED_LIBS OFF)
+set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
+set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
+
+# Broken LTO on GCC 4
+if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5)
+ set(BROKEN_LTO ON)
+endif ()
+
+if (NOT BROKEN_LTO AND CMAKE_VERSION VERSION_GREATER "3.8")
+ # CMake 3.9+
+ include(CheckIPOSupported)
+ check_ipo_supported(RESULT HAVE_IPO)
+ if (HAVE_IPO)
+ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
+ endif ()
+endif ()
+
+add_subdirectory(../.. fmt)
+set_property(TARGET fmt PROPERTY POSITION_INDEPENDENT_CODE ON)
+
+add_library(library-test SHARED library.cc)
+target_link_libraries(library-test PRIVATE fmt::fmt)
+
+add_executable(exe-test main.cc)
+target_link_libraries(exe-test PRIVATE library-test)