Fix formatting

This commit is contained in:
Victor Zverovich 2023-11-13 06:41:28 -10:00
parent cbb18c237a
commit ec628561c2

View File

@ -1,9 +1,9 @@
cmake_minimum_required(VERSION 3.8...3.28) cmake_minimum_required(VERSION 3.8...3.28)
# Fallback for using newer policies on CMake <3.12. # Fallback for using newer policies on CMake <3.12.
if(${CMAKE_VERSION} VERSION_LESS 3.12) if (${CMAKE_VERSION} VERSION_LESS 3.12)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
endif() endif ()
# Determine if fmt is built as a subproject (using add_subdirectory) # Determine if fmt is built as a subproject (using add_subdirectory)
# or if it is the master project. # or if it is the master project.
@ -103,11 +103,12 @@ function(add_module_library name)
DEPENDS ${pcm}) DEPENDS ${pcm})
endforeach () endforeach ()
endif () endif ()
if(CMAKE_VERSION VERSION_LESS 3.28) if (CMAKE_VERSION VERSION_LESS 3.28)
target_sources(${name} PRIVATE ${sources}) target_sources(${name} PRIVATE ${sources})
else() else ()
target_sources(${name} PUBLIC FILE_SET fmt_module TYPE CXX_MODULES FILES ${sources}) target_sources(${name} PUBLIC FILE_SET fmt_module TYPE CXX_MODULES
endif() FILES ${sources})
endif ()
endfunction() endfunction()
include(CMakeParseArguments) include(CMakeParseArguments)
@ -166,10 +167,10 @@ set(FMT_SYSTEM_HEADERS_ATTRIBUTE "")
if (FMT_SYSTEM_HEADERS) if (FMT_SYSTEM_HEADERS)
set(FMT_SYSTEM_HEADERS_ATTRIBUTE SYSTEM) set(FMT_SYSTEM_HEADERS_ATTRIBUTE SYSTEM)
endif () endif ()
if(CMAKE_SYSTEM_NAME STREQUAL "MSDOS") if (CMAKE_SYSTEM_NAME STREQUAL "MSDOS")
set(FMT_TEST OFF) set(FMT_TEST OFF)
message(STATUS "MSDOS is incompatible with gtest") message(STATUS "MSDOS is incompatible with gtest")
endif() endif ()
# Get version from core.h # Get version from core.h
file(READ include/fmt/core.h core_h) file(READ include/fmt/core.h core_h)
@ -338,7 +339,7 @@ if (BUILD_SHARED_LIBS)
endif () endif ()
if (FMT_SAFE_DURATION_CAST) if (FMT_SAFE_DURATION_CAST)
target_compile_definitions(fmt PUBLIC FMT_SAFE_DURATION_CAST) target_compile_definitions(fmt PUBLIC FMT_SAFE_DURATION_CAST)
endif() endif ()
add_library(fmt-header-only INTERFACE) add_library(fmt-header-only INTERFACE)
add_library(fmt::fmt-header-only ALIAS fmt-header-only) add_library(fmt::fmt-header-only ALIAS fmt-header-only)
@ -346,7 +347,8 @@ add_library(fmt::fmt-header-only ALIAS fmt-header-only)
target_compile_definitions(fmt-header-only INTERFACE FMT_HEADER_ONLY=1) target_compile_definitions(fmt-header-only INTERFACE FMT_HEADER_ONLY=1)
target_compile_features(fmt-header-only INTERFACE cxx_std_11) target_compile_features(fmt-header-only INTERFACE cxx_std_11)
target_include_directories(fmt-header-only ${FMT_SYSTEM_HEADERS_ATTRIBUTE} INTERFACE target_include_directories(fmt-header-only
${FMT_SYSTEM_HEADERS_ATTRIBUTE} INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${FMT_INC_DIR}>) $<INSTALL_INTERFACE:${FMT_INC_DIR}>)
@ -399,10 +401,12 @@ if (FMT_INSTALL)
FILE_SET fmt_module DESTINATION "${FMT_LIB_DIR}/cxx/miu" FILE_SET fmt_module DESTINATION "${FMT_LIB_DIR}/cxx/miu"
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if(FMT_MODULE AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.28) if (FMT_MODULE AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.28)
#Install format.cc and os.cc which are #included by the fmt.cc module interface file # Install format.cc and os.cc which are included by the fmt.cc module
install(FILES src/format.cc src/os.cc DESTINATION "${FMT_LIB_DIR}/cxx/miu/src") # interface file.
endif() install(FILES src/format.cc src/os.cc
DESTINATION "${FMT_LIB_DIR}/cxx/miu/src")
endif ()
# Use a namespace because CMake provides better diagnostics for namespaced # Use a namespace because CMake provides better diagnostics for namespaced
# imported targets. # imported targets.