From c1013d9bfcd0bf826d91fded00d7b682bbe9a63b Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Wed, 12 Dec 2018 20:43:50 +0100 Subject: [PATCH] CMake: Add more option validity checks --- build/cmake/init.cmake | 57 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index 2d67e48c90..cbbdb81dbf 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -134,9 +134,6 @@ if(NOT wxUSE_EXPAT) set(wxUSE_XRC OFF) endif() set(wxUSE_XML ${wxUSE_XRC}) -if(wxUSE_CONFIG) - set(wxUSE_CONFIG_NATIVE ON) -endif() if(DEFINED wxUSE_OLE AND wxUSE_OLE) set(wxUSE_OLE_AUTOMATION ON) @@ -146,6 +143,60 @@ if(wxUSE_OPENGL) set(wxUSE_GLCANVAS ON) endif() +if(wxUSE_ARCHIVE_STREAMS AND NOT wxUSE_STREAMS) + message(WARNING "wxArchive requires wxStreams... disabled") + wx_option_force_value(wxUSE_ARCHIVE_STREAMS OFF) +endif() + +if(wxUSE_ZIPSTREAM AND (NOT wxUSE_ARCHIVE_STREAMS OR NOT wxUSE_ZLIB)) + message(WARNING "wxZip requires wxArchive or wxZlib... disabled") + wx_option_force_value(wxUSE_ZIPSTREAM OFF) +endif() + +if(wxUSE_TARSTREAM AND NOT wxUSE_ARCHIVE_STREAMS) + message(WARNING "wxTar requires wxArchive... disabled") + wx_option_force_value(wxUSE_TARSTREAM OFF) +endif() + +if(wxUSE_FILESYSTEM AND (NOT wxUSE_STREAMS OR (NOT wxUSE_FILE AND NOT wxUSE_FFILE))) + message(WARNING "wxFileSystem requires wxStreams and wxFile or wxFFile... disabled") + wx_option_force_value(wxUSE_FILESYSTEM OFF) +endif() + +if(wxUSE_FS_ARCHIVE AND (NOT wxUSE_FILESYSTEM OR NOT wxUSE_ARCHIVE_STREAMS)) + message(WARNING "wxArchiveFSHandler requires wxArchive and wxFileSystem... disabled") + wx_option_force_value(wxUSE_FS_ARCHIVE OFF) +endif() + +if(wxUSE_FS_ARCHIVE AND (NOT wxUSE_FILESYSTEM OR NOT wxUSE_ARCHIVE_STREAMS)) + message(WARNING "wxArchiveFSHandler requires wxArchive and wxFileSystem... disabled") + wx_option_force_value(wxUSE_FS_ARCHIVE OFF) +endif() + +if(wxUSE_FS_ZIP AND NOT wxUSE_FS_ARCHIVE) + message(WARNING "wxZipFSHandler requires wxArchiveFSHandler... disabled") + wx_option_force_value(wxUSE_FS_ZIP OFF) +endif() + +if(wxUSE_TEXTFILE AND (NOT wxUSE_FILE OR NOT wxUSE_TEXTBUFFER)) + message(WARNING "wxTextFile requires wxFile and wxTextBuffer... disabled") + wx_option_force_value(wxUSE_TEXTFILE OFF) +endif() + +if(wxUSE_CONFIG) + if(NOT wxUSE_TEXTFILE) + message(WARNING "wxConfig requires wxTextFile... disabled") + wx_option_force_value(wxUSE_CONFIG OFF) + else() + set(wxUSE_CONFIG_NATIVE ON) + endif() +endif() + +if(wxUSE_INTL AND NOT wxUSE_FILE) + message(WARNING "I18n code requires wxFile... disabled") + wx_option_force_value(wxUSE_INTL OFF) +endif() + if(wxUSE_THREADS) find_package(Threads REQUIRED) endif()