mirror of
https://github.com/zeux/pugixml.git
synced 2024-12-25 20:14:10 +08:00
Warn if PUGIXML_STRING_VIEW is set without CMAKE_CXX_STANDARD (#638)
Even if the compiler supports C++17, we define CMAKE_CXX_STANDARD as 11 by default which implicitly disables string_view support; for now warn in this case.
This commit is contained in:
parent
13beda24b8
commit
23e617b158
@ -48,7 +48,7 @@ option(PUGIXML_INSTALL "Enable installation rules" ON)
|
||||
option(PUGIXML_NO_XPATH "Disable XPath" OFF)
|
||||
option(PUGIXML_NO_STL "Disable STL" OFF)
|
||||
option(PUGIXML_NO_EXCEPTIONS "Disable Exceptions" OFF)
|
||||
option(PUGIXML_STRING_VIEW "Enable std::string_view overloads" OFF) # requires C++17 and for PUGI_NO_STL to be OFF
|
||||
option(PUGIXML_STRING_VIEW "Enable std::string_view overloads" OFF) # requires C++17 and for PUGIXML_NO_STL to be OFF
|
||||
mark_as_advanced(PUGIXML_NO_XPATH PUGIXML_NO_STL PUGIXML_NO_EXCEPTIONS PUGIXML_STRING_VIEW)
|
||||
|
||||
set(PUGIXML_PUBLIC_DEFINITIONS
|
||||
@ -66,6 +66,10 @@ if (NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
|
||||
MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<NOT:$<BOOL:${PUGIXML_STATIC_CRT}>>:DLL>)
|
||||
endif()
|
||||
|
||||
if (PUGIXML_STRING_VIEW AND (NOT DEFINED CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD LESS 17))
|
||||
message(WARNING "PUGIXML_STRING_VIEW requires CMAKE_CXX_STANDARD to be set to 17 or later")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
endif()
|
||||
|
Loading…
x
Reference in New Issue
Block a user