зеркало из https://github.com/nextcloud/desktop.git
Merge pull request #6207 from nextcloud/bugfix/macos-legacy
Bug fixes for mac OS
This commit is contained in:
Коммит
d3562e6205
|
@ -214,6 +214,7 @@ if(BUILD_CLIENT)
|
||||||
find_package(OpenSSL 1.1 REQUIRED )
|
find_package(OpenSSL 1.1 REQUIRED )
|
||||||
|
|
||||||
find_package(ZLIB REQUIRED)
|
find_package(ZLIB REQUIRED)
|
||||||
|
find_package(SQLite3 3.9.0 REQUIRED)
|
||||||
|
|
||||||
if(NOT WIN32 AND NOT APPLE)
|
if(NOT WIN32 AND NOT APPLE)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
|
|
|
@ -1,60 +1,68 @@
|
||||||
# - Try to find SQLite3
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||||
# Once done this will define
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||||
#
|
|
||||||
# SQLITE3_FOUND - system has SQLite3
|
|
||||||
# SQLITE3_INCLUDE_DIRS - the SQLite3 include directory
|
|
||||||
# SQLITE3_LIBRARIES - Link these to use SQLite3
|
|
||||||
# SQLITE3_DEFINITIONS - Compiler switches required for using SQLite3
|
|
||||||
#
|
|
||||||
# Copyright (c) 2009-2013 Andreas Schneider <asn@cryptomilk.org>
|
|
||||||
#
|
|
||||||
# Redistribution and use is allowed according to the terms of the New
|
|
||||||
# BSD license.
|
|
||||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
||||||
#
|
|
||||||
|
|
||||||
|
#[=======================================================================[.rst:
|
||||||
|
FindSQLite3
|
||||||
|
-----------
|
||||||
|
|
||||||
if (UNIX)
|
.. versionadded:: 3.14
|
||||||
find_package(PkgConfig)
|
|
||||||
if (PKG_CONFIG_FOUND)
|
|
||||||
pkg_check_modules(_SQLITE3 sqlite3)
|
|
||||||
endif (PKG_CONFIG_FOUND)
|
|
||||||
endif (UNIX)
|
|
||||||
|
|
||||||
find_path(SQLITE3_INCLUDE_DIR
|
Find the SQLite libraries, v3
|
||||||
NAMES
|
|
||||||
sqlite3.h
|
|
||||||
PATHS
|
|
||||||
${_SQLITE3_INCLUDEDIR}
|
|
||||||
${SQLITE3_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
|
|
||||||
find_library(SQLITE3_LIBRARY
|
IMPORTED targets
|
||||||
NAMES
|
^^^^^^^^^^^^^^^^
|
||||||
sqlite3 sqlite3-0
|
|
||||||
PATHS
|
|
||||||
${_SQLITE3_LIBDIR}
|
|
||||||
${SQLITE3_LIBRARIES}
|
|
||||||
)
|
|
||||||
|
|
||||||
set(SQLITE3_INCLUDE_DIRS
|
This module defines the following :prop_tgt:`IMPORTED` target:
|
||||||
${SQLITE3_INCLUDE_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
if (SQLITE3_LIBRARY)
|
``SQLite::SQLite3``
|
||||||
set(SQLITE3_LIBRARIES
|
|
||||||
${SQLITE3_LIBRARIES}
|
|
||||||
${SQLITE3_LIBRARY}
|
|
||||||
)
|
|
||||||
endif (SQLITE3_LIBRARY)
|
|
||||||
|
|
||||||
if (SQLite3_FIND_VERSION AND _SQLITE3_VERSION)
|
Result variables
|
||||||
set(SQLite3_VERSION _SQLITE3_VERSION)
|
^^^^^^^^^^^^^^^^
|
||||||
endif (SQLite3_FIND_VERSION AND _SQLITE3_VERSION)
|
|
||||||
|
This module will set the following variables if found:
|
||||||
|
|
||||||
|
``SQLite3_INCLUDE_DIRS``
|
||||||
|
where to find sqlite3.h, etc.
|
||||||
|
``SQLite3_LIBRARIES``
|
||||||
|
the libraries to link against to use SQLite3.
|
||||||
|
``SQLite3_VERSION``
|
||||||
|
version of the SQLite3 library found
|
||||||
|
``SQLite3_FOUND``
|
||||||
|
TRUE if found
|
||||||
|
|
||||||
|
#]=======================================================================]
|
||||||
|
|
||||||
|
# Look for the necessary header
|
||||||
|
find_path(SQLite3_INCLUDE_DIR NAMES sqlite3.h)
|
||||||
|
mark_as_advanced(SQLite3_INCLUDE_DIR)
|
||||||
|
|
||||||
|
# Look for the necessary library
|
||||||
|
find_library(SQLite3_LIBRARY NAMES sqlite3 sqlite)
|
||||||
|
mark_as_advanced(SQLite3_LIBRARY)
|
||||||
|
|
||||||
|
# Extract version information from the header file
|
||||||
|
if(SQLite3_INCLUDE_DIR)
|
||||||
|
file(STRINGS ${SQLite3_INCLUDE_DIR}/sqlite3.h _ver_line
|
||||||
|
REGEX "^#define SQLITE_VERSION *\"[0-9]+\\.[0-9]+\\.[0-9]+\""
|
||||||
|
LIMIT_COUNT 1)
|
||||||
|
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+"
|
||||||
|
SQLite3_VERSION "${_ver_line}")
|
||||||
|
unset(_ver_line)
|
||||||
|
endif()
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
find_package_handle_standard_args(SQLite3 DEFAULT_MSG SQLITE3_LIBRARIES SQLITE3_INCLUDE_DIRS)
|
find_package_handle_standard_args(SQLite3
|
||||||
|
REQUIRED_VARS SQLite3_INCLUDE_DIR SQLite3_LIBRARY
|
||||||
# show the SQLITE3_INCLUDE_DIRS and SQLITE3_LIBRARIES variables only in the advanced view
|
VERSION_VAR SQLite3_VERSION)
|
||||||
mark_as_advanced(SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES)
|
|
||||||
|
|
||||||
|
# Create the imported target
|
||||||
|
if(SQLite3_FOUND)
|
||||||
|
set(SQLite3_INCLUDE_DIRS ${SQLite3_INCLUDE_DIR})
|
||||||
|
set(SQLite3_LIBRARIES ${SQLite3_LIBRARY})
|
||||||
|
if(NOT TARGET SQLite::SQLite3)
|
||||||
|
add_library(SQLite::SQLite3 UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(SQLite::SQLite3 PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${SQLite3_LIBRARY}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${SQLite3_INCLUDE_DIR}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
|
@ -106,6 +106,9 @@ if(WIN32)
|
||||||
elseif(UNIX AND NOT APPLE)
|
elseif(UNIX AND NOT APPLE)
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,relro -Wl,-z,now")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,relro -Wl,-z,now")
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,relro -Wl,-z,now")
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,relro -Wl,-z,now")
|
||||||
|
elseif(APPLE)
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-ld_classic")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-ld_classic")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(QML_IMPORT_PATH ${CMAKE_SOURCE_DIR}/theme CACHE STRING "" FORCE)
|
set(QML_IMPORT_PATH ${CMAKE_SOURCE_DIR}/theme CACHE STRING "" FORCE)
|
||||||
|
|
|
@ -19,8 +19,6 @@ include(DefineOptions.cmake)
|
||||||
|
|
||||||
include(DefineInstallationPaths)
|
include(DefineInstallationPaths)
|
||||||
|
|
||||||
find_package(SQLite3 3.8.0 REQUIRED)
|
|
||||||
|
|
||||||
include(ConfigureChecks.cmake)
|
include(ConfigureChecks.cmake)
|
||||||
include(../common/common.cmake)
|
include(../common/common.cmake)
|
||||||
|
|
||||||
|
@ -66,9 +64,6 @@ target_include_directories(
|
||||||
PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/std
|
PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/std
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(nextcloud_csync PUBLIC ${SQLITE3_INCLUDE_DIR})
|
|
||||||
target_link_libraries(nextcloud_csync PUBLIC ${SQLITE3_LIBRARIES})
|
|
||||||
|
|
||||||
generate_export_header(nextcloud_csync
|
generate_export_header(nextcloud_csync
|
||||||
EXPORT_MACRO_NAME OCSYNC_EXPORT
|
EXPORT_MACRO_NAME OCSYNC_EXPORT
|
||||||
EXPORT_FILE_NAME ocsynclib.h
|
EXPORT_FILE_NAME ocsynclib.h
|
||||||
|
@ -84,6 +79,7 @@ if(ZLIB_FOUND)
|
||||||
target_link_libraries(nextcloud_csync PUBLIC ZLIB::ZLIB)
|
target_link_libraries(nextcloud_csync PUBLIC ZLIB::ZLIB)
|
||||||
endif(ZLIB_FOUND)
|
endif(ZLIB_FOUND)
|
||||||
|
|
||||||
|
target_link_libraries(nextcloud_csync PRIVATE SQLite::SQLite3)
|
||||||
|
|
||||||
# For src/common/utility_mac.cpp
|
# For src/common/utility_mac.cpp
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче