Build macOS shell extensions with debug configuration in xcodebuild when CMAKE build...
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Fri, 12 May 2023 05:14:29 +0000 (13:14 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Fri, 12 May 2023 08:02:39 +0000 (16:02 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
shell_integration/MacOSX/CMakeLists.txt

index 96b9f171e1bf04d84a9cf083b5439815fdd19a31..85d901920db6d4dacec306e779429d0238e7c01a 100644 (file)
@@ -1,6 +1,12 @@
 if(APPLE)
     set(OC_OEM_SHARE_ICNS "${CMAKE_BINARY_DIR}/src/gui/${APPLICATION_ICON_NAME}.icns")
 
+    if (CMAKE_BUILD_TYPE MATCHES "Debug" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo")
+        set(XCODE_TARGET_CONFIGURATION "Debug")
+    else()
+        set(XCODE_TARGET_CONFIGURATION "Release")
+    endif()
+
     # 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
@@ -8,7 +14,7 @@ if(APPLE)
     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}"
+        -target FinderSyncExt -configuration ${XCODE_TARGET_CONFIGURATION} "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}"
@@ -20,7 +26,7 @@ if(APPLE)
         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}"
+            -target FileProviderExt -configuration ${XCODE_TARGET_CONFIGURATION} "SYMROOT=${CMAKE_CURRENT_BINARY_DIR}"
             "OC_APPLICATION_EXECUTABLE_NAME=${APPLICATION_EXECUTABLE}"
             "OC_APPLICATION_VENDOR=${APPLICATION_VENDOR}"
             "OC_APPLICATION_NAME=${APPLICATION_NAME}"