From 370ec5097b4a2a86257e3db75e60ca6337157236 Mon Sep 17 00:00:00 2001 From: Bernhard Miklautz Date: Mon, 25 Mar 2013 18:16:05 +0100 Subject: [PATCH 1/3] client/common: create a combined .a on mac Generate a combined archive of all the client related functions (channels/common..) to minimize dependencies for linking. The archive is called libfreerdp-client-combined.a and is only generated on iOS when doing a monolithic static build. --- client/common/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/client/common/CMakeLists.txt b/client/common/CMakeLists.txt index e249cd0db..ffec4c32e 100644 --- a/client/common/CMakeLists.txt +++ b/client/common/CMakeLists.txt @@ -61,3 +61,13 @@ if(BUILD_TESTING) add_subdirectory(test) endif() +if(IOS AND MONOLITHIC_BUILD AND (NOT BUILD_SHARED_LIBS)) +# generate combined library + foreach(af ${${MODULE_PREFIX}_LIBS}) + get_target_property(LOC ${af} LOCATION) + if ((NOT (${LOC} MATCHES ".*libfreerdp.a$")) AND (NOT (${LOC} MATCHES ".*libwinpr.a$"))) + set(ALIST ${ALIST} ${LOC}) + endif() + endforeach() + add_custom_command(TARGET ${MODULE_NAME} POST_BUILD COMMAND libtool -static -o libfreerdp-client-combined.a ${ALIST}) +endif() From 64fd026e2059096773e0a558fccc1c8a02bf029d Mon Sep 17 00:00:00 2001 From: Bernhard Miklautz Date: Tue, 26 Mar 2013 12:40:02 +0100 Subject: [PATCH 2/3] client/common: also include libfreerdp-client in combined archive --- client/common/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/common/CMakeLists.txt b/client/common/CMakeLists.txt index ffec4c32e..1bb4e27d1 100644 --- a/client/common/CMakeLists.txt +++ b/client/common/CMakeLists.txt @@ -69,5 +69,8 @@ if(IOS AND MONOLITHIC_BUILD AND (NOT BUILD_SHARED_LIBS)) set(ALIST ${ALIST} ${LOC}) endif() endforeach() + get_target_property(LOC ${MODULE_NAME} LOCATION) + set(ALIST ${ALIST} ${LOC}) + message(${ALIST}) add_custom_command(TARGET ${MODULE_NAME} POST_BUILD COMMAND libtool -static -o libfreerdp-client-combined.a ${ALIST}) endif() From 88fd7edf6d925220651517de6f895909be94c271 Mon Sep 17 00:00:00 2001 From: Bernhard Miklautz Date: Tue, 26 Mar 2013 12:59:03 +0100 Subject: [PATCH 3/3] ios: link against libfreerdp-client-combined.a --- client/iOS/iFreeRDP.xcodeproj/project.pbxproj.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/iOS/iFreeRDP.xcodeproj/project.pbxproj.cmake b/client/iOS/iFreeRDP.xcodeproj/project.pbxproj.cmake index 8cbdbd321..72e566561 100644 --- a/client/iOS/iFreeRDP.xcodeproj/project.pbxproj.cmake +++ b/client/iOS/iFreeRDP.xcodeproj/project.pbxproj.cmake @@ -118,6 +118,7 @@ C495F01816B937F90041304E /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C495F01616B937F90041304E /* libssl.a */; }; C495F01A16B938210041304E /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C495F01916B938210041304E /* Security.framework */; }; C495F01E16B938CB0041304E /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C495F01D16B938CA0041304E /* SystemConfiguration.framework */; }; + C4B6A8821701979900AA836E /* libfreerdp-client-combined.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C4B6A8811701979900AA836E /* libfreerdp-client-combined.a */; }; C4C31C6F16BAD1890087BB12 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C4C31C6E16BAD1890087BB12 /* Default-568h@2x.png */; }; /* End PBXBuildFile section */ @@ -280,6 +281,7 @@ C495F01616B937F90041304E /* libssl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libssl.a; path = @FREERDP_IOS_EXTERNAL_SSL_PATH@/lib/libssl.a; sourceTree = ""; }; C495F01916B938210041304E /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; C495F01D16B938CA0041304E /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; + C4B6A8811701979900AA836E /* libfreerdp-client-combined.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libfreerdp-client-combined.a"; path = "../common/libfreerdp-client-combined.a"; sourceTree = ""; }; C4C31C6E16BAD1890087BB12 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "Resources/Default-568h@2x.png"; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ @@ -297,6 +299,7 @@ C495EE3816B8372D0041304E /* CoreGraphics.framework in Frameworks */, C495F01A16B938210041304E /* Security.framework in Frameworks */, C495F01E16B938CB0041304E /* SystemConfiguration.framework in Frameworks */, + C4B6A8821701979900AA836E /* libfreerdp-client-combined.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -323,6 +326,7 @@ C495EE3216B8372D0041304E /* Frameworks */ = { isa = PBXGroup; children = ( + C4B6A8811701979900AA836E /* libfreerdp-client-combined.a */, C495EFAA16B912C40041304E /* libfreerdp.a */, C495EFAD16B913980041304E /* libwinpr.a */, C495F01516B937F80041304E /* libcrypto.a */, @@ -744,9 +748,7 @@ GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - ); + GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES;