ios: updates to build with xcode6+

* update tool chain to use clang instead of gcc
* add compatibility function for fwrite
This commit is contained in:
Bernhard Miklautz 2015-04-14 11:43:24 +02:00 committed by Bernhard Miklautz
parent 23dfec9cc1
commit 43695bc15d
2 changed files with 10 additions and 6 deletions

View File

@ -303,3 +303,8 @@ void ios_uninit_freerdp()
}
/* compatibilty functions */
size_t fwrite$UNIX2003( const void *ptr, size_t size, size_t nmemb, FILE *stream )
{
return fwrite(ptr, size , nmemb, stream);
}

View File

@ -47,11 +47,10 @@ if (CMAKE_UNAME)
endif (CMAKE_UNAME)
# Force the compilers to gcc for iOS
if(NOT CMAKE_C_COMPILER)
include (CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER (gcc GNU)
CMAKE_FORCE_CXX_COMPILER (g++ GNU)
endif()
include (CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER (/usr/bin/clang Apple)
CMAKE_FORCE_CXX_COMPILER (/usr/bin/clang++ Apple)
set(CMAKE_AR ar CACHE FILEPATH "" FORCE)
# Skip the platform compiler checks for cross compiling
#set (CMAKE_CXX_COMPILER_WORKS TRUE)
@ -72,7 +71,7 @@ set (CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")
# Hidden visibilty is required for cxx on iOS
set (CMAKE_C_FLAGS_INIT "")
set (CMAKE_CXX_FLAGS_INIT "-headerpad_max_install_names -fvisibility=hidden -fvisibility-inlines-hidden")
set (CMAKE_CXX_FLAGS_INIT "-fvisibility=hidden -fvisibility-inlines-hidden -isysroot ${CMAKE_OSX_SYSROOT}")
set (CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
set (CMAKE_CXX_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")