From 53d8e002757f170b0daa582d201f5da90dde9966 Mon Sep 17 00:00:00 2001 From: Frank Rast Date: Thu, 9 Aug 2018 09:20:51 +0200 Subject: [PATCH] CMake: fix option XML_DEV_URANDOM to use set() --- expat/CMakeLists.txt | 6 ++++-- expat/expat_config.h.cmake | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt index c06749f2..9e1de250 100644 --- a/expat/CMakeLists.txt +++ b/expat/CMakeLists.txt @@ -53,8 +53,10 @@ option(WARNINGS_AS_ERRORS "Treat all compiler warnings as errors" OFF) if(NOT WIN32) option(XML_DEV_URANDOM "Define to include code reading entropy from `/dev/urandom'." ON) if(XML_DEV_URANDOM) - add_definitions(-DXML_DEV_URANDOM) - endif() + set(XML_DEV_URANDOM 1) + else(XML_DEV_URANDOM) + set(XML_DEV_URANDOM 0) + endif(XML_DEV_URANDOM) endif() if(XML_DTD) diff --git a/expat/expat_config.h.cmake b/expat/expat_config.h.cmake index a93c9711..d2dcd801 100644 --- a/expat/expat_config.h.cmake +++ b/expat/expat_config.h.cmake @@ -94,6 +94,11 @@ /* Define to make XML Namespaces functionality available. */ #cmakedefine XML_NS +#if ! defined(_WIN32) +/* Define to extract entropy from /dev/urandom. */ +#cmakedefine XML_DEV_URANDOM +#endif + /* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */ #ifdef _MSC_VER # define __func__ __FUNCTION__ -- 2.40.0