Commit d07cbad6 authored by Philipp Götze's avatar Philipp Götze
Browse files

🔨 Using header only mode for fmt

parent a90b7380
Pipeline #162 passed with stages
in 20 minutes and 33 seconds
......@@ -14,18 +14,23 @@ if(NOT PMDK_INCLUDE_DIRS OR "${PMDK_INCLUDE_DIRS}" STREQUAL "")
endif()
message(STATUS " libpmem.h found in ${PMDK_INCLUDE_DIRS}")
mark_as_advanced(PMDK_LIBRARIES PMDK_INCLUDE_DIRS)
# Format ==================================================================== #
FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 5.3.0
)
)
FetchContent_GetProperties(fmt)
if(NOT fmt_POPULATED)
message(STATUS "Populating fmt (Format)")
FetchContent_Populate(fmt)
add_subdirectory(${fmt_SOURCE_DIR} ${fmt_BINARY_DIR} EXCLUDE_FROM_ALL)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DFMT_HEADER_ONLY=1")
file(COPY ${fmt_SOURCE_DIR}/include/fmt/core.h
${fmt_SOURCE_DIR}/include/fmt/format-inl.h
${fmt_SOURCE_DIR}/include/fmt/format.h
DESTINATION ${THIRD_PARTY_DIR}/fmt
)
endif()
......@@ -77,7 +82,7 @@ if(BUILD_BENCHMARKS)
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "" FORCE)
set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "" FORCE)
message(STATUS "Populating benchmark (google)")
FetchContent_Populate(benchmark)
FetchContent_Populate(benchmark)
add_subdirectory(${benchmark_SOURCE_DIR} ${benchmark_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
endif()
......
......@@ -70,6 +70,7 @@ endif()
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/generated/config.h)
include_directories(${PROJECT_SOURCE_DIR}
${THIRD_PARTY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/generated
)
add_library(nvmDS_deps STATIC ${PMDK_INCLUDE_DIRS})
......@@ -77,7 +78,6 @@ target_link_libraries(nvmDS_deps
Threads::Threads
stdc++fs
${PMDK_LIBRARIES} ndctl daxctl
fmt
)
set_target_properties(nvmDS_deps PROPERTIES LINKER_LANGUAGE CXX)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment