Skip to content

Commit

Permalink
Build for Mac Catalyst.
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaRU committed Jan 29, 2020
1 parent a72334e commit f43e352
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 1 deletion.
72 changes: 72 additions & 0 deletions FastRTPSBridge.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
remoteGlobalIDString = 0A5B3F282364F62200BE5707;
remoteInfo = FastRTPS;
};
0A5F6F7E23E1F182006A6D5A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0A71306C2363503500817593 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 0A5F6F7A23E1F0B2006A6D5A;
remoteInfo = "FastRTPS catalyst";
};
0AD9938D2366F82F00D037A3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0A71306C2363503500817593 /* Project object */;
Expand All @@ -73,6 +80,7 @@
0A35C9F123A52D4100CF48D6 /* libfastcdr.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfastcdr.a; path = fastrtps/lib/libfastcdr.a; sourceTree = BUILT_PRODUCTS_DIR; };
0A35C9F323A52D5700CF48D6 /* libfoonathan_memory-0.6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libfoonathan_memory-0.6.2.a"; path = "fastrtps/lib/libfoonathan_memory-0.6.2.a"; sourceTree = BUILT_PRODUCTS_DIR; };
0A5B3F252364E63400BE5707 /* fastrtps_build_osx.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = fastrtps_build_osx.sh; sourceTree = "<group>"; };
0A5F6F7823E1EFDE006A6D5A /* fastrtps_build_catalyst.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = fastrtps_build_catalyst.sh; sourceTree = "<group>"; };
0A70B3202375A147007E05B6 /* FastRTPSNotifications.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FastRTPSNotifications.swift; sourceTree = "<group>"; };
0A7130752363503500817593 /* FastRTPSBridge.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FastRTPSBridge.framework; sourceTree = BUILT_PRODUCTS_DIR; };
0A7130782363503500817593 /* FastRTPSBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FastRTPSBridge.h; sourceTree = "<group>"; };
Expand All @@ -94,6 +102,7 @@
0A8A37CF2366D469008E8DC1 /* fastrtps_build_ios.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = fastrtps_build_ios.sh; sourceTree = "<group>"; };
0A8A37DB2366DB1B008E8DC1 /* FastRTPSBridge.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FastRTPSBridge.framework; sourceTree = BUILT_PRODUCTS_DIR; };
0AC08A7F2375F61900A80C2E /* FastRTPSNotifications.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FastRTPSNotifications.mm; sourceTree = "<group>"; };
0ACE0ECA23E2390300C83C55 /* maccatalyst.toolchain.cmake */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = maccatalyst.toolchain.cmake; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -125,7 +134,9 @@
0A71306B2363503500817593 = {
isa = PBXGroup;
children = (
0ACE0ECA23E2390300C83C55 /* maccatalyst.toolchain.cmake */,
0A5B3F252364E63400BE5707 /* fastrtps_build_osx.sh */,
0A5F6F7823E1EFDE006A6D5A /* fastrtps_build_catalyst.sh */,
0A8A37CF2366D469008E8DC1 /* fastrtps_build_ios.sh */,
0A7130772363503500817593 /* FastRTPSBridge */,
0A7130762363503500817593 /* Products */,
Expand Down Expand Up @@ -225,6 +236,20 @@
passBuildSettingsInEnvironment = 1;
productName = FastRTPS;
};
0A5F6F7A23E1F0B2006A6D5A /* FastRTPS catalyst */ = {
isa = PBXLegacyTarget;
buildArgumentsString = fastrtps_build_catalyst.sh;
buildConfigurationList = 0A5F6F7B23E1F0B2006A6D5A /* Build configuration list for PBXLegacyTarget "FastRTPS catalyst" */;
buildPhases = (
);
buildToolPath = /bin/bash;
buildWorkingDirectory = $SRCROOT;
dependencies = (
);
name = "FastRTPS catalyst";
passBuildSettingsInEnvironment = 1;
productName = FastRTPS;
};
0A8A37D22366D9AE008E8DC1 /* FastRTPS iOS */ = {
isa = PBXLegacyTarget;
buildArgumentsString = fastrtps_build_ios.sh;
Expand Down Expand Up @@ -276,6 +301,7 @@
buildRules = (
);
dependencies = (
0A5F6F7F23E1F182006A6D5A /* PBXTargetDependency */,
0AD9938E2366F82F00D037A3 /* PBXTargetDependency */,
);
name = "FastRTPSBridge iOS";
Expand Down Expand Up @@ -330,6 +356,7 @@
0A8A37DA2366DB1B008E8DC1 /* FastRTPSBridge iOS */,
0A5B3F282364F62200BE5707 /* FastRTPS macOS */,
0A8A37D22366D9AE008E8DC1 /* FastRTPS iOS */,
0A5F6F7A23E1F0B2006A6D5A /* FastRTPS catalyst */,
);
};
/* End PBXProject section */
Expand Down Expand Up @@ -394,8 +421,15 @@
target = 0A5B3F282364F62200BE5707 /* FastRTPS macOS */;
targetProxy = 0A5B3F2C236502D200BE5707 /* PBXContainerItemProxy */;
};
0A5F6F7F23E1F182006A6D5A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
platformFilter = maccatalyst;
target = 0A5F6F7A23E1F0B2006A6D5A /* FastRTPS catalyst */;
targetProxy = 0A5F6F7E23E1F182006A6D5A /* PBXContainerItemProxy */;
};
0AD9938E2366F82F00D037A3 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
platformFilter = ios;
target = 0A8A37D22366D9AE008E8DC1 /* FastRTPS iOS */;
targetProxy = 0AD9938D2366F82F00D037A3 /* PBXContainerItemProxy */;
};
Expand Down Expand Up @@ -431,6 +465,35 @@
};
name = Release;
};
0A5F6F7C23E1F0B2006A6D5A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CODE_SIGN_STYLE = Manual;
DEBUGGING_SYMBOLS = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 9BEQ8V4XH9;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
0A5F6F7D23E1F0B2006A6D5A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CODE_SIGN_STYLE = Manual;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 9BEQ8V4XH9;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
0A71307B2363503500817593 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
Expand Down Expand Up @@ -745,6 +808,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
0A5F6F7B23E1F0B2006A6D5A /* Build configuration list for PBXLegacyTarget "FastRTPS catalyst" */ = {
isa = XCConfigurationList;
buildConfigurations = (
0A5F6F7C23E1F0B2006A6D5A /* Debug */,
0A5F6F7D23E1F0B2006A6D5A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
0A71306F2363503500817593 /* Build configuration list for PBXProject "FastRTPSBridge" */ = {
isa = XCConfigurationList;
buildConfigurations = (
Expand Down
44 changes: 44 additions & 0 deletions fastrtps_build_catalyst.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash
#
# fastrtps_build_catalyst.sh
# Copyright © 2020 Dmitriy Borovikov. All rights reserved.
#
set -e

echo $CONFIGURATION # Build type
CATALYST_PRODUCTS_DIR="${BUILT_PRODUCTS_DIR}-maccatalyst"
if [ -f "$CATALYST_PRODUCTS_DIR/fastrtps/lib/libfastrtps.a" ]; then
echo Already build $CATALYST_PRODUCTS_DIR/fastrtps/lib/libfastrtps.a
exit 0
fi

export CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl hw.ncpu | awk '{print $2}')

if [ ! -d memory ]; then
git clone --quiet --recurse-submodules --depth 1 -b ios $Foonathan_memory_repo memory
fi
rm -rf "$PROJECT_TEMP_DIR/memory"
mkdir -p "$PROJECT_TEMP_DIR/memory" || true
cmake -Smemory -B"$PROJECT_TEMP_DIR/memory" \
-DCMAKE_INSTALL_PREFIX=$CATALYST_PRODUCTS_DIR/fastrtps \
-DCMAKE_TOOLCHAIN_FILE=$SRCROOT/maccatalyst.toolchain.cmake \
-DFOONATHAN_MEMORY_BUILD_EXAMPLES=OFF \
-DFOONATHAN_MEMORY_BUILD_TESTS=OFF \
-DFOONATHAN_MEMORY_BUILD_TOOLS=OFF \
-DCMAKE_BUILD_TYPE=Release
cmake --build "$PROJECT_TEMP_DIR/memory" --target install

rm -rf "$PROJECT_TEMP_DIR/Fast-RTPS"
if [ ! -d Fast-RTPS ]; then
git clone --quiet --recurse-submodules --depth 1 $FastRTPS_repo Fast-RTPS
fi
mkdir -p "$PROJECT_TEMP_DIR/Fast-RTPS" || true
cmake -SFast-RTPS -B"$PROJECT_TEMP_DIR/Fast-RTPS" \
-DCMAKE_INSTALL_PREFIX=$CATALYST_PRODUCTS_DIR/fastrtps \
-DCMAKE_TOOLCHAIN_FILE=$SRCROOT/maccatalyst.toolchain.cmake \
-Dfoonathan_memory_DIR=$CATALYST_PRODUCTS_DIR/fastrtps/share/foonathan_memory/cmake \
-DSQLITE3_SUPPORT=OFF \
-DTHIRDPARTY=ON \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=$CONFIGURATION
cmake --build "$PROJECT_TEMP_DIR/Fast-RTPS" --target install
1 change: 1 addition & 0 deletions fastrtps_build_ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ IOS_DEPLOYMENT_SDK_VERSION=$IPHONEOS_DEPLOYMENT_TARGET \
BUILD_SHARED_LIBS=NO \
CMAKE_INSTALL_PREFIX=$BUILT_PRODUCTS_DIR/fastrtps \
foonathan_memory_DIR=$BUILT_PRODUCTS_DIR/fastrtps/foonathan_memory/cmake \
SQLITE3_SUPPORT=OFF \
THIRDPARTY=ON \
COMPILE_EXAMPLES=OFF \
BUILD_DOCUMENTATION=OFF
4 changes: 3 additions & 1 deletion fastrtps_build_osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ git clone --quiet --recurse-submodules --depth 1 -b ios $Foonathan_memory_repo m
fi
rm -rf "$PROJECT_TEMP_DIR/memory"
mkdir -p "$PROJECT_TEMP_DIR/memory" || true
cmake -Smemory -B"$PROJECT_TEMP_DIR/memory" -DCMAKE_INSTALL_PREFIX=$BUILT_PRODUCTS_DIR/fastrtps \
cmake -Smemory -B"$PROJECT_TEMP_DIR/memory" \
-DCMAKE_INSTALL_PREFIX=$BUILT_PRODUCTS_DIR/fastrtps \
-DFOONATHAN_MEMORY_BUILD_EXAMPLES=OFF \
-DFOONATHAN_MEMORY_BUILD_TESTS=OFF \
-DFOONATHAN_MEMORY_BUILD_TOOLS=ON \
Expand All @@ -33,6 +34,7 @@ mkdir -p "$PROJECT_TEMP_DIR/Fast-RTPS" || true
cmake -SFast-RTPS -B"$PROJECT_TEMP_DIR/Fast-RTPS" \
-DCMAKE_INSTALL_PREFIX=$BUILT_PRODUCTS_DIR/fastrtps \
-Dfoonathan_memory_DIR=$BUILT_PRODUCTS_DIR/fastrtps/share/foonathan_memory/cmake \
-DSQLITE3_SUPPORT=OFF \
-DTHIRDPARTY=ON \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=$CONFIGURATION
Expand Down
7 changes: 7 additions & 0 deletions maccatalyst.toolchain.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
unset(CMAKE_XCODE_ATTRIBUTE_INSTALL_PATH)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
set(CMAKE_XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS "macosx")
set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-maccatalyst")
set(CMAKE_XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET "10.15")
set(CMAKE_C_FLAGS "-target x86_64-apple-ios13.0-macabi -Wno-overriding-t-option")
set(CMAKE_CXX_FLAGS "-target x86_64-apple-ios13.0-macabi -Wno-overriding-t-option")

0 comments on commit f43e352

Please sign in to comment.