소스 검색

Make it possible to disable building file provider module

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Claudio Cambra 2 년 전
부모
커밋
23e623ef0a
3개의 변경된 파일64개의 추가작업 그리고 46개의 파일을 삭제
  1. 3 0
      CMakeLists.txt
  2. 42 35
      shell_integration/MacOSX/CMakeLists.txt
  3. 19 11
      src/gui/CMakeLists.txt

+ 3 - 0
CMakeLists.txt

@@ -187,6 +187,9 @@ else()
     unset(CMAKE_CXX_CLANG_TIDY)
 endif()
 
+# build macOS File Provider module
+option(BUILD_FILE_PROVIDER_MODULE "BUILD_FILE_PROVIDER_MODULE" ON)
+
 # When this option is enabled, 5xx errors are not added to the blacklist
 # Normally you don't want to enable this option because if a particular file
 # triggers a bug on the server, you want the file to be blacklisted.

+ 42 - 35
shell_integration/MacOSX/CMakeLists.txt

@@ -1,42 +1,49 @@
 if(APPLE)
-  set(OC_OEM_SHARE_ICNS "${CMAKE_BINARY_DIR}/src/gui/${APPLICATION_ICON_NAME}.icns")
+    set(OC_OEM_SHARE_ICNS "${CMAKE_BINARY_DIR}/src/gui/${APPLICATION_ICON_NAME}.icns")
 
-  # The bundle identifier and application group need to have compatible values with the client
-  # to be able to open a Mach port across the extension's sandbox boundary.
-  # Pass the info through the xcodebuild command line and make sure that the project uses
-  # those user-defined settings to build the plist.
-  add_custom_target( mac_overlayplugin ALL
-    xcodebuild ARCHS=${CMAKE_OSX_ARCHITECTURES} ONLY_ACTIVE_ARCH=NO
-    -project ${CMAKE_SOURCE_DIR}/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj
-    -target FinderSyncExt -configuration Release "SYMROOT=${CMAKE_CURRENT_BINARY_DIR}"
-    "OC_OEM_SHARE_ICNS=${OC_OEM_SHARE_ICNS}"
-    "OC_APPLICATION_NAME=${APPLICATION_NAME}"
-    "OC_APPLICATION_REV_DOMAIN=${APPLICATION_REV_DOMAIN}"
-    "OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX=${SOCKETAPI_TEAM_IDENTIFIER_PREFIX}"
-    COMMENT building Mac Overlay icons
-    VERBATIM)
+    # The bundle identifier and application group need to have compatible values with the client
+    # to be able to open a Mach port across the extension's sandbox boundary.
+    # Pass the info through the xcodebuild command line and make sure that the project uses
+    # those user-defined settings to build the plist.
+    add_custom_target( mac_overlayplugin ALL
+        xcodebuild ARCHS=${CMAKE_OSX_ARCHITECTURES} ONLY_ACTIVE_ARCH=NO
+        -project ${CMAKE_SOURCE_DIR}/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj
+        -target FinderSyncExt -configuration Release "SYMROOT=${CMAKE_CURRENT_BINARY_DIR}"
+        "OC_OEM_SHARE_ICNS=${OC_OEM_SHARE_ICNS}"
+        "OC_APPLICATION_NAME=${APPLICATION_NAME}"
+        "OC_APPLICATION_REV_DOMAIN=${APPLICATION_REV_DOMAIN}"
+        "OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX=${SOCKETAPI_TEAM_IDENTIFIER_PREFIX}"
+        COMMENT building Mac Overlay icons
+        VERBATIM)
 
-  add_custom_target( mac_fileproviderplugin ALL
-    xcodebuild ARCHS=${CMAKE_OSX_ARCHITECTURES} ONLY_ACTIVE_ARCH=NO
-    -project ${CMAKE_SOURCE_DIR}/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj
-    -target FileProviderExt -configuration Release "SYMROOT=${CMAKE_CURRENT_BINARY_DIR}"
-    "OC_APPLICATION_EXECUTABLE_NAME=${APPLICATION_EXECUTABLE}"
-    "OC_APPLICATION_VENDOR=${APPLICATION_VENDOR}"
-    "OC_APPLICATION_NAME=${APPLICATION_NAME}"
-    "OC_APPLICATION_REV_DOMAIN=${APPLICATION_REV_DOMAIN}"
-    "OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX=${SOCKETAPI_TEAM_IDENTIFIER_PREFIX}"
-    COMMENT building macOS File Provider extension
-    VERBATIM)
+    if (BUILD_FILE_PROVIDER_MODULE)
+        add_custom_target( mac_fileproviderplugin ALL
+            xcodebuild ARCHS=${CMAKE_OSX_ARCHITECTURES} ONLY_ACTIVE_ARCH=NO
+            -project ${CMAKE_SOURCE_DIR}/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj
+            -target FileProviderExt -configuration Release "SYMROOT=${CMAKE_CURRENT_BINARY_DIR}"
+            "OC_APPLICATION_EXECUTABLE_NAME=${APPLICATION_EXECUTABLE}"
+            "OC_APPLICATION_VENDOR=${APPLICATION_VENDOR}"
+            "OC_APPLICATION_NAME=${APPLICATION_NAME}"
+            "OC_APPLICATION_REV_DOMAIN=${APPLICATION_REV_DOMAIN}"
+            "OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX=${SOCKETAPI_TEAM_IDENTIFIER_PREFIX}"
+            COMMENT building macOS File Provider extension
+            VERBATIM)
 
-  add_dependencies(mac_overlayplugin mac_fileproviderplugin nextcloud) # for the ownCloud.icns to be generated
+        add_dependencies(mac_overlayplugin mac_fileproviderplugin nextcloud) # for the ownCloud.icns to be generated
+    else()
+        add_dependencies(mac_overlayplugin nextcloud) # for the ownCloud.icns to be generated
+    endif()
 
-  if (BUILD_OWNCLOUD_OSX_BUNDLE)
-    install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Release/FinderSyncExt.appex
-      DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/PlugIns
-      USE_SOURCE_PERMISSIONS)
-    install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Release/FileProviderExt.appex
-      DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/PlugIns
-      USE_SOURCE_PERMISSIONS)
-  endif()
+    if (BUILD_OWNCLOUD_OSX_BUNDLE)
+        install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Release/FinderSyncExt.appex
+            DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/PlugIns
+            USE_SOURCE_PERMISSIONS)
+
+        if (BUILD_FILE_PROVIDER_MODULE)
+            install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Release/FileProviderExt.appex
+                DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/PlugIns
+                USE_SOURCE_PERMISSIONS)
+        endif()
+    endif()
 endif()
 

+ 19 - 11
src/gui/CMakeLists.txt

@@ -280,16 +280,19 @@ endif()
 IF( APPLE )
     list(APPEND client_SRCS cocoainitializer_mac.mm)
     list(APPEND client_SRCS systray.mm)
-    list(APPEND client_SRCS
-        macOS/fileprovider.h
-        macOS/fileprovider_mac.mm
-        macOS/fileproviderdomainmanager.h
-        macOS/fileproviderdomainmanager_mac.mm
-        macOS/fileprovidersocketcontroller.h
-        macOS/fileprovidersocketcontroller.cpp
-        macOS/fileprovidersocketserver.h
-        macOS/fileprovidersocketserver.cpp
-        macOS/fileprovidersocketserver_mac.mm)
+
+    if (BUILD_FILE_PROVIDER_MODULE)
+        list(APPEND client_SRCS
+            macOS/fileprovider.h
+            macOS/fileprovider_mac.mm
+            macOS/fileproviderdomainmanager.h
+            macOS/fileproviderdomainmanager_mac.mm
+            macOS/fileprovidersocketcontroller.h
+            macOS/fileprovidersocketcontroller.cpp
+            macOS/fileprovidersocketserver.h
+            macOS/fileprovidersocketserver.cpp
+            macOS/fileprovidersocketserver_mac.mm)
+    endif()
 
     if(SPARKLE_FOUND AND BUILD_UPDATER)
         # Define this, we need to check in updater.cpp
@@ -663,7 +666,12 @@ endif()
 
 if (APPLE)
     find_package(Qt5 COMPONENTS MacExtras)
-    target_link_libraries(nextcloudCore PUBLIC Qt5::MacExtras "-framework UserNotifications -framework FileProvider")
+
+    if (BUILD_FILE_PROVIDER_MODULE)
+        target_link_libraries(nextcloudCore PUBLIC Qt5::MacExtras "-framework UserNotifications -framework FileProvider")
+    else()
+        target_link_libraries(nextcloudCore PUBLIC Qt5::MacExtras "-framework UserNotifications")
+    endif()
 endif()
 
 if(WITH_CRASHREPORTER)