ios: updates to build with xcode6+
authorBernhard Miklautz <bernhard.miklautz@shacknet.at>
Tue, 14 Apr 2015 09:43:24 +0000 (11:43 +0200)
committerBernhard Miklautz <bernhard.miklautz@thincast.com>
Tue, 21 Apr 2015 12:16:32 +0000 (14:16 +0200)
* update tool chain to use clang instead of gcc
* add compatibility function for fwrite

client/iOS/FreeRDP/ios_freerdp.m
cmake/iOSToolchain.cmake

index d5a8be8..6a9dc21 100644 (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);
+}
index d1af383..293036a 100644 (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}")