Skip to content

Commit

Permalink
If exceptions are disabled, disable them in the bundled fmt as well
Browse files Browse the repository at this point in the history
  • Loading branch information
gabime committed May 28, 2023
1 parent c174c15 commit d1eb681
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,19 @@ foreach(
endif()
endforeach()

if(SPDLOG_NO_EXCEPTIONS AND NOT MSVC)
target_compile_options(spdlog PRIVATE -fno-exceptions)
# ---------------------------------------------------------------------------------------
# If exceptions are disabled, disable them in the bundled fmt as well
# ---------------------------------------------------------------------------------------
if(SPDLOG_NO_EXCEPTIONS)
if(NOT SPDLOG_FMT_EXTERNAL AND NOT SPDLOG_FMT_EXTERNAL_HO)
target_compile_definitions(spdlog PUBLIC FMT_EXCEPTIONS=0)
endif()
if(NOT MSVC)
target_compile_options(spdlog PRIVATE -fno-exceptions)
else()
target_compile_options(spdlog PRIVATE /EHsc)
endif()
endif()

# ---------------------------------------------------------------------------------------
# Build binaries
# ---------------------------------------------------------------------------------------
Expand Down

0 comments on commit d1eb681

Please sign in to comment.