Skip to content

Commit

Permalink
fix: ensure bundled fmt includes have priority over system/homebrew i…
Browse files Browse the repository at this point in the history
…ncludes
  • Loading branch information
maxirmx committed Aug 30, 2024
1 parent bd91c9d commit 1803392
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -346,18 +346,23 @@ endif()

if(PREFER_SYSTEM_LIBFMT)
find_package(fmt 10 CONFIG)
else(PREFER_SYSTEM_LIBFMT)
include_directories(${fmt_SOURCE_DIR}/include)

else(PREFER_SYSTEM_LIBFMT)
include(FetchContent)

FetchContent_Declare(
fmt
GIT_REPOSITORY ${LIBFMT_GIT_REPO}
GIT_TAG 10.2.1
OVERRIDE_FIND_PACKAGE
)
FetchContent_MakeAvailable(fmt)


target_include_directories(fmt BEFORE PUBLIC
$<BUILD_INTERFACE:${fmt_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)

include_directories(BEFORE ${fmt_SOURCE_DIR}/include)
endif(PREFER_SYSTEM_LIBFMT)

find_package(Boost 1.67 REQUIRED COMPONENTS chrono iostreams program_options)
Expand Down
2 changes: 1 addition & 1 deletion fbthrift
Submodule fbthrift updated 970 files
2 changes: 1 addition & 1 deletion folly
Submodule folly updated 116 files

0 comments on commit 1803392

Please sign in to comment.