diff --git a/coreapi/CMakeLists.txt b/coreapi/CMakeLists.txt index f0a3bfdd6..4a783cdda 100644 --- a/coreapi/CMakeLists.txt +++ b/coreapi/CMakeLists.txt @@ -207,7 +207,7 @@ if(ENABLE_STATIC) add_dependencies(linphone-static liblinphone-git-version) target_include_directories(linphone-static PUBLIC ${LINPHONE_INCLUDE_DIRS}) target_link_libraries(linphone-static INTERFACE ${LIBS}) - if(IOS) + if(APPLE) target_link_libraries(linphone-static INTERFACE "-framework Foundation" "-framework AVFoundation") endif() install(TARGETS linphone-static EXPORT ${EXPORT_TARGETS_NAME}Targets @@ -248,6 +248,9 @@ if(ENABLE_SHARED) add_dependencies(linphone liblinphone-git-version) target_include_directories(linphone PUBLIC ${LINPHONE_INCLUDE_DIRS}) target_link_libraries(linphone PRIVATE ${LIBS}) + if(APPLE) + target_link_libraries(linphone PRIVATE "-framework Foundation" "-framework AVFoundation") + endif() if(WIN32 AND CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") set_target_properties(linphone PROPERTIES PREFIX "lib") elseif(ANDROID) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 17bc2550b..37de6f4dd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -251,7 +251,7 @@ endforeach () set(LINPHONE_PRIVATE_HEADER_FILES ${LINPHONE_PRIVATE_HEADER_FILES} PARENT_SCOPE) bc_apply_compile_flags(LINPHONE_CXX_OBJECTS_SOURCE_FILES STRICT_OPTIONS_CPP STRICT_OPTIONS_CXX) -bc_apply_compile_flags(LINPHONE_OBJC_SOURCE_FILES STRICT_OPTIONS_CPP STRICT_OPTIONS_CXX STRICT_OPTIONS_OBJC) +bc_apply_compile_flags(LINPHONE_OBJC_SOURCE_FILES STRICT_OPTIONS_CPP STRICT_OPTIONS_OBJC) if (ENABLE_STATIC) add_library( diff --git a/src/core/core.cpp b/src/core/core.cpp index 2bc55abf6..8a587f74c 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -105,7 +105,7 @@ Core::Core (LinphoneCore *cCore) : Object(*new CorePrivate) { : MainDb::Sqlite3; else { backend = AbstractDb::Sqlite3; - uri = getDataPath() + "/" LINPHONE_DB; + uri = getDataPath() + LINPHONE_DB; } lInfo() << "Opening " LINPHONE_DB " at: " << uri; diff --git a/src/core/paths/paths-apple.mm b/src/core/paths/paths-apple.mm index 97bbef63b..55b35e59b 100644 --- a/src/core/paths/paths-apple.mm +++ b/src/core/paths/paths-apple.mm @@ -1,5 +1,5 @@ /* - * paths-apple.m + * paths-apple.mm * Copyright (C) 2010-2017 Belledonne Communications SARL * * This program is free software; you can redistribute it and/or @@ -19,37 +19,29 @@ #import "linphone/utils/utils.h" -#include "core/platform-helpers/platform-helpers.h" +#import "core/platform-helpers/platform-helpers.h" #import "paths-apple.h" -#ifdef __OBJC__ #import -#endif // ============================================================================= LINPHONE_BEGIN_NAMESPACE std::string SysPaths::getDataPath (PlatformHelpers *platformHelper) { -#ifdef __OBJC__ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); NSString *writablePath = [paths objectAtIndex:0]; NSString *fullPath = [writablePath stringByAppendingString:@"/linphone/"]; const char *ret = fullPath.UTF8String; return ret; -#endif - return Utils::getEmptyConstRefObject(); } std::string SysPaths::getConfigPath (PlatformHelpers *platformHelper) { -#ifdef __OBJC__ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); NSString *configPath = [paths objectAtIndex:0]; NSString *fullPath = [configPath stringByAppendingString:@"/Preferences/linphone/"]; const char *ret = fullPath.UTF8String; return ret; -#endif - return Utils::getEmptyConstRefObject(); } LINPHONE_END_NAMESPACE diff --git a/src/core/paths/paths-linux.cpp b/src/core/paths/paths-linux.cpp index 7261a326e..70b38c6d7 100644 --- a/src/core/paths/paths-linux.cpp +++ b/src/core/paths/paths-linux.cpp @@ -42,12 +42,12 @@ static string getBaseDirectory () { } string SysPaths::getDataPath (PlatformHelpers *platformHelper) { - static string dataPath = getBaseDirectory() + "/.local/share/linphone"; + static string dataPath = getBaseDirectory() + "/.local/share/linphone/"; return dataPath; } string SysPaths::getConfigPath (PlatformHelpers *platformHelper) { - static string configPath = getBaseDirectory() + "/.config/linphone"; + static string configPath = getBaseDirectory() + "/.config/linphone/"; return configPath; } diff --git a/src/core/paths/paths-windows.cpp b/src/core/paths/paths-windows.cpp index fd2ba5d27..39b10a80c 100644 --- a/src/core/paths/paths-windows.cpp +++ b/src/core/paths/paths-windows.cpp @@ -38,7 +38,7 @@ string SysPaths::getDataPath (PlatformHelpers *platformHelper) { // Get path for each computer, non-user specific and non-roaming data. if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, szPath))) { stringstream path; - path << boost::lexical_cast(szPath) << "/linphone"; + path << boost::lexical_cast(szPath) << "\\linphone\\"; string ret = path.str(); boost::replace_all(ret, "\\", "\\\\"); return ret;