Skip to content

Commit

Permalink
CMake will now determine whether or not std::fmt is installed or not,…
Browse files Browse the repository at this point in the history
… and will automatically depend on libfmt instead if std::format was not found
  • Loading branch information
SimonCahill committed Sep 21, 2023
1 parent 3913541 commit 82d11cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ cmake_minimum_required(VERSION 3.12)
project(borr VERSION 1.0.1 LANGUAGES CXX DESCRIPTION "Borr; A simple cross-platform C++ language file parser" HOMEPAGE_URL "https://github.com/SimonCahill")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

include(cmake/resources.cmake)
include(cmake/format_support.cmake)

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_options(
Expand All @@ -24,7 +26,7 @@ include_directories(

file(GLOB_RECURSE FILES FOLLOW_SYMLINKS ${CMAKE_CURRENT_SOURCE_DIR} src/*.cpp)

if (DEFINED liblangparser_BUILD_STATIC)
if (DEFINED libborr_BUILD_STATIC)
add_library(${PROJECT_NAME} STATIC ${FILES})
else()
add_library(${PROJECT_NAME} SHARED ${FILES})
Expand All @@ -34,6 +36,7 @@ target_link_libraries(
${PROJECT_NAME}

# add potential dependencies here
${FMT_LIB_NAME}
)

target_include_directories(${PROJECT_NAME} PUBLIC include/ ${CMAKE_CURRENT_BINARY_DIR}/include)
Expand Down

0 comments on commit 82d11cb

Please sign in to comment.