Skip to content

Commit

Permalink
Allow to avoid inclusion of os.cc in fmt target
Browse files Browse the repository at this point in the history
Allows to avoid part of #1654
  • Loading branch information
kwesolowski committed Apr 30, 2020
1 parent 9ac1eeb commit 81b3d38
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ option(FMT_INSTALL "Generate the install target." ${MASTER_PROJECT})
option(FMT_TEST "Generate the test target." ${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)
project(FMT CXX)

# Get version from core.h
Expand Down Expand Up @@ -173,7 +173,11 @@ endfunction()
# Define the fmt library, its includes and the needed defines.
add_headers(FMT_HEADERS chrono.h color.h compile.h core.h format.h format-inl.h
locale.h os.h ostream.h posix.h printf.h ranges.h)
set(FMT_SOURCES src/format.cc src/os.cc)
if (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)
Expand Down

0 comments on commit 81b3d38

Please sign in to comment.