Skip to content

Commit

Permalink
chore: add required options for MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
ToruNiina committed Jun 15, 2024
1 parent 5ec3857 commit 74e5e49
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,19 @@ else()
)
endif()

# required options to use toml11 with MSVC
if(MSVC)
target_compile_options(toml11 PUBLIC "/utf-8")
if(MSVC_VERSION LESS 1910)
message(STATUS "MSVC < 1910. DEFINE_CONVERSION_NON_INTRUSIVE is disabled")
target_compile_definitions(toml11 PUBLIC -DTOML11_WITHOUT_DEFINE_NON_INTRUSIVE)
elseif(MSVC_VERSION LESS 1920) # MSVC 2017
target_compile_options(toml11 PUBLIC "/experimental:preprocessor")
else() # MSVC 2019
target_compile_options(toml11 PUBLIC "/Zc:preprocessor")
endif()
endif()

if(TOML11_INSTALL)

include(CMakePackageConfigHelpers)
Expand Down

0 comments on commit 74e5e49

Please sign in to comment.