diff --git a/src/libsync/CMakeLists.txt b/src/libsync/CMakeLists.txt index 8d0789cef195a..40a98e1c995b5 100644 --- a/src/libsync/CMakeLists.txt +++ b/src/libsync/CMakeLists.txt @@ -60,23 +60,6 @@ set(libsync_SRCS creds/keychainchunk.cpp ) -if (WIN32) - #set(libsync_SRCS ${libsync_SRCS} - #vfs/cfapi/cfapiwrapper.cpp - #vfs/cfapi/hydrationjob.cpp - #vfs/cfapi/vfs_cfapi.cpp - #) - add_definitions(-D_WIN32_WINNT=_WIN32_WINNT_WIN10) - list(APPEND OS_SPECIFIC_LINK_LIBRARIES cldapi) -elseif(LINUX) # elseif(LINUX OR APPLE) - #set(libsync_SRCS ${libsync_SRCS} vfs/xattr/vfs_xattr.cpp) - #if (APPLE) - #set(libsync_SRCS ${libsync_SRCS} vfs/xattr/xattrwrapper_mac.cpp) - #else() - #set(libsync_SRCS ${libsync_SRCS} vfs/xattr/xattrwrapper_linux.cpp) - #endif() -endif() - if(TOKEN_AUTH_ONLY) set (libsync_SRCS ${libsync_SRCS} creds/tokencredentials.cpp) else() diff --git a/src/libsync/vfs/cfapi/CMakeLists.txt b/src/libsync/vfs/cfapi/CMakeLists.txt index 8bf3cd68f964f..3a6f39b9d166b 100644 --- a/src/libsync/vfs/cfapi/CMakeLists.txt +++ b/src/libsync/vfs/cfapi/CMakeLists.txt @@ -1,39 +1,40 @@ if (WIN32) -add_library("${synclib_NAME}_vfs_cfapi" SHARED - cfapiwrapper.cpp - hydrationjob.cpp - vfs_cfapi.cpp -) + add_definitions(-D_WIN32_WINNT=_WIN32_WINNT_WIN10) -target_link_libraries("${synclib_NAME}_vfs_cfapi" - "${synclib_NAME}" - cldapi -) + add_library("${synclib_NAME}_vfs_cfapi" SHARED + cfapiwrapper.cpp + hydrationjob.cpp + vfs_cfapi.cpp + ) -set_target_properties("${synclib_NAME}_vfs_cfapi" PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} - RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} - PREFIX "" - AUTOMOC TRUE -) + target_link_libraries("${synclib_NAME}_vfs_cfapi" + "${synclib_NAME}" + cldapi + ) -if(APPLE) - # for being loadable when client run from build dir - set(vfs_buildoutputdir "${BIN_OUTPUT_DIRECTORY}/${OWNCLOUD_OSX_BUNDLE}/Contents/PlugIns/") - set_target_properties("${synclib_NAME}_vfs_cfapi" - PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${vfs_buildoutputdir} - RUNTIME_OUTPUT_DIRECTORY ${vfs_buildoutputdir} + set_target_properties("${synclib_NAME}_vfs_cfapi" PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} + RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} + PREFIX "" + AUTOMOC TRUE ) - # For being lodable when client run from install dir (after make macdeployqt) - set(vfs_installdir "${LIB_INSTALL_DIR}/../PlugIns") -else() - set(vfs_installdir "${PLUGINDIR}") -endif() -INSTALL(TARGETS "${synclib_NAME}_vfs_cfapi" - LIBRARY DESTINATION "${vfs_installdir}" - RUNTIME DESTINATION "${vfs_installdir}" -) + if(APPLE) + # for being loadable when client run from build dir + set(vfs_buildoutputdir "${BIN_OUTPUT_DIRECTORY}/${OWNCLOUD_OSX_BUNDLE}/Contents/PlugIns/") + set_target_properties("${synclib_NAME}_vfs_cfapi" + PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${vfs_buildoutputdir} + RUNTIME_OUTPUT_DIRECTORY ${vfs_buildoutputdir} + ) + # For being lodable when client run from install dir (after make macdeployqt) + set(vfs_installdir "${LIB_INSTALL_DIR}/../PlugIns") + else() + set(vfs_installdir "${PLUGINDIR}") + endif() + INSTALL(TARGETS "${synclib_NAME}_vfs_cfapi" + LIBRARY DESTINATION "${vfs_installdir}" + RUNTIME DESTINATION "${vfs_installdir}" + ) endif() diff --git a/src/libsync/vfs/cfapi/cfapiwrapper.h b/src/libsync/vfs/cfapi/cfapiwrapper.h index 1cb2691abcac2..d8db32e656326 100644 --- a/src/libsync/vfs/cfapi/cfapiwrapper.h +++ b/src/libsync/vfs/cfapi/cfapiwrapper.h @@ -28,7 +28,7 @@ class VfsCfApi; namespace CfApiWrapper { -class ConnectionKey +class OWNCLOUDSYNC_EXPORT ConnectionKey { public: ConnectionKey(); @@ -38,7 +38,7 @@ class ConnectionKey std::unique_ptr _data; }; -class FileHandle +class OWNCLOUDSYNC_EXPORT FileHandle { public: using Deleter = void (*)(void *); @@ -53,7 +53,7 @@ class FileHandle std::unique_ptr _data; }; -class PlaceHolderInfo +class OWNCLOUDSYNC_EXPORT PlaceHolderInfo { public: using Deleter = void (*)(CF_PLACEHOLDER_BASIC_INFO *); @@ -71,11 +71,11 @@ class PlaceHolderInfo std::unique_ptr _data; }; -Result registerSyncRoot(const QString &path, const QString &providerName, const QString &providerVersion, const QString &folderAlias, const QString &displayName, const QString &accountDisplayName); -Result unregisterSyncRoot(const QString &path, const QString &providerName, const QString &accountDisplayName); +OWNCLOUDSYNC_EXPORT Result registerSyncRoot(const QString &path, const QString &providerName, const QString &providerVersion, const QString &folderAlias, const QString &displayName, const QString &accountDisplayName); +OWNCLOUDSYNC_EXPORT Result unregisterSyncRoot(const QString &path, const QString &providerName, const QString &accountDisplayName); -Result connectSyncRoot(const QString &path, VfsCfApi *context); -Result disconnectSyncRoot(ConnectionKey &&key); +OWNCLOUDSYNC_EXPORT Result connectSyncRoot(const QString &path, VfsCfApi *context); +OWNCLOUDSYNC_EXPORT Result disconnectSyncRoot(ConnectionKey &&key); bool isSparseFile(const QString &path); diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7c15878e500ed..c10fa33956a79 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -66,7 +66,7 @@ if (WIN32) nextcloud_add_test(LongWinPath) nextcloud_add_test(SyncCfApi) elseif(LINUX) # elseif(LINUX OR APPLE) - #nextcloud_add_test(SyncXAttr) + nextcloud_add_test(SyncXAttr) endif() nextcloud_add_benchmark(LargeSync)