mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-09 14:10:07 +00:00
Fix formatting
This commit is contained in:
parent
cbb18c237a
commit
ec628561c2
@ -1,9 +1,9 @@
|
||||
cmake_minimum_required(VERSION 3.8...3.28)
|
||||
|
||||
# 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})
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
# Determine if fmt is built as a subproject (using add_subdirectory)
|
||||
# or if it is the master project.
|
||||
@ -103,11 +103,12 @@ function(add_module_library name)
|
||||
DEPENDS ${pcm})
|
||||
endforeach ()
|
||||
endif ()
|
||||
if(CMAKE_VERSION VERSION_LESS 3.28)
|
||||
if (CMAKE_VERSION VERSION_LESS 3.28)
|
||||
target_sources(${name} PRIVATE ${sources})
|
||||
else()
|
||||
target_sources(${name} PUBLIC FILE_SET fmt_module TYPE CXX_MODULES FILES ${sources})
|
||||
endif()
|
||||
else ()
|
||||
target_sources(${name} PUBLIC FILE_SET fmt_module TYPE CXX_MODULES
|
||||
FILES ${sources})
|
||||
endif ()
|
||||
endfunction()
|
||||
|
||||
include(CMakeParseArguments)
|
||||
@ -166,10 +167,10 @@ set(FMT_SYSTEM_HEADERS_ATTRIBUTE "")
|
||||
if (FMT_SYSTEM_HEADERS)
|
||||
set(FMT_SYSTEM_HEADERS_ATTRIBUTE SYSTEM)
|
||||
endif ()
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "MSDOS")
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "MSDOS")
|
||||
set(FMT_TEST OFF)
|
||||
message(STATUS "MSDOS is incompatible with gtest")
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
# Get version from core.h
|
||||
file(READ include/fmt/core.h core_h)
|
||||
@ -338,7 +339,7 @@ if (BUILD_SHARED_LIBS)
|
||||
endif ()
|
||||
if (FMT_SAFE_DURATION_CAST)
|
||||
target_compile_definitions(fmt PUBLIC FMT_SAFE_DURATION_CAST)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
add_library(fmt-header-only INTERFACE)
|
||||
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_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>
|
||||
$<INSTALL_INTERFACE:${FMT_INC_DIR}>)
|
||||
|
||||
@ -399,10 +401,12 @@ if (FMT_INSTALL)
|
||||
FILE_SET fmt_module DESTINATION "${FMT_LIB_DIR}/cxx/miu"
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
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(FILES src/format.cc src/os.cc DESTINATION "${FMT_LIB_DIR}/cxx/miu/src")
|
||||
endif()
|
||||
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(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
|
||||
# imported targets.
|
||||
|
Loading…
Reference in New Issue
Block a user