Merge pull request #563 from zeux/cmake-oof

build: Fix CMake PUGIXML_STATIC_CRT behavior
This commit is contained in:
Arseny Kapoulkine 2023-04-22 08:01:01 -07:00 committed by GitHub
commit 80a531ee1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,10 @@
cmake_minimum_required(VERSION 3.4)
# Policy configuration; this *MUST* be specified before project is defined
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW) # Enables use of MSVC_RUNTIME_LIBRARY
endif()
project(pugixml VERSION 1.13 LANGUAGES CXX)
include(CMakePackageConfigHelpers)
@ -44,11 +50,6 @@ option(PUGIXML_NO_STL "Disable STL" OFF)
option(PUGIXML_NO_EXCEPTIONS "Disable Exceptions" OFF)
mark_as_advanced(PUGIXML_NO_XPATH PUGIXML_NO_STL PUGIXML_NO_EXCEPTIONS)
# Policy configuration
if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW) # Enables use of MSVC_RUNTIME_LIBRARY
endif()
set(PUGIXML_PUBLIC_DEFINITIONS
$<$<BOOL:${PUGIXML_WCHAR_MODE}>:PUGIXML_WCHAR_MODE>
$<$<BOOL:${PUGIXML_COMPACT}>:PUGIXML_COMPACT>