Add version check for universal build. (#219)

This commit is contained in:
Dylan Liu 2023-05-18 19:54:50 +08:00 committed by GitHub
parent 2c1164b834
commit 951dd5f931
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -53,9 +53,16 @@ option(FRAMELESSHELPER_ENABLE_CFGUARD "Enable Control Flow Guard (CFG)." OFF)
option(FRAMELESSHELPER_EXAMPLES_STANDALONE "Build the demo projects as standalone CMake projects." OFF) option(FRAMELESSHELPER_EXAMPLES_STANDALONE "Build the demo projects as standalone CMake projects." OFF)
cmake_dependent_option(FRAMELESSHELPER_ENABLE_UNIVERSAL_BUILD "macOS only: build universal library/exemple for Mac." ON APPLE OFF) cmake_dependent_option(FRAMELESSHELPER_ENABLE_UNIVERSAL_BUILD "macOS only: build universal library/exemple for Mac." ON APPLE OFF)
if(NOT DEFINED QT_VERSION)
find_package(QT NAMES Qt6 Qt5 REQUIRED)
endif()
if(NOT APPLE AND FRAMELESSHELPER_ENABLE_UNIVERSAL_BUILD) if(NOT APPLE AND FRAMELESSHELPER_ENABLE_UNIVERSAL_BUILD)
message(WARNING "Your OS is not macOS, universal library will not be generated.") message(WARNING "Your OS is not macOS, universal library will not be generated.")
set(FRAMELESSHELPER_ENABLE_UNIVERSAL_BUILD OFF) set(FRAMELESSHELPER_ENABLE_UNIVERSAL_BUILD OFF)
elseif(APPLE AND ((QT_VERSION VERSION_LESS "6.2" AND QT_VERSION VERSION_GREATER_EQUAL "6.0") OR QT_VERSION VERSION_LESS "5.15.9"))
message(WARNING "Your Qt version ${QT_VERSION} doesn't support universal build, universal library will not be generated.")
set(FRAMELESSHELPER_ENABLE_UNIVERSAL_BUILD OFF)
endif() endif()
if(FRAMELESSHELPER_NO_BUNDLE_RESOURCE) if(FRAMELESSHELPER_NO_BUNDLE_RESOURCE)