Skip to content

Commit

Permalink
Revamp macOS build process: Prevent LC_RPATH in shared libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaRU committed Nov 5, 2019
1 parent eac2663 commit cff5e7e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions FastRTPSBridge.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
0A5B3F252364E63400BE5707 /* fastrtps_build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = fastrtps_build.sh; sourceTree = "<group>"; };
0A5B3F252364E63400BE5707 /* fastrtps_build_osx.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = fastrtps_build_osx.sh; 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>"; };
0A7130792363503500817593 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -147,7 +147,7 @@
0A71306B2363503500817593 = {
isa = PBXGroup;
children = (
0A5B3F252364E63400BE5707 /* fastrtps_build.sh */,
0A5B3F252364E63400BE5707 /* fastrtps_build_osx.sh */,
0A8A37CF2366D469008E8DC1 /* fastrtps_build_ios.sh */,
0A7130772363503500817593 /* FastRTPSBridge */,
0A7130762363503500817593 /* Products */,
Expand Down Expand Up @@ -234,7 +234,7 @@
/* Begin PBXLegacyTarget section */
0A5B3F282364F62200BE5707 /* FastRTPS macOS */ = {
isa = PBXLegacyTarget;
buildArgumentsString = "fastrtps_build.sh Release";
buildArgumentsString = "fastrtps_build_osx.sh Release";
buildConfigurationList = 0A5B3F292364F62200BE5707 /* Build configuration list for PBXLegacyTarget "FastRTPS macOS" */;
buildPhases = (
);
Expand Down
9 changes: 6 additions & 3 deletions fastrtps_build.sh → fastrtps_build_osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
set -e
set -x
echo "$1" # Build type
echo MACOSX_DEPLOYMENT_TARGET="$MACOSX_DEPLOYMENT_TARGET"
if [ ! -f "Framework/libfastrtps.1.dylib" ]; then
if [ ! -d memory ]; then
git clone --quiet --recurse-submodules -b ios $Foonathan_memory_repo memory
Expand All @@ -21,8 +20,12 @@ if [ ! -d Fast-RTPS ]; then
git clone --quiet --recurse-submodules $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=build/osx \
-Dfoonathan_memory_DIR=build/osx/share/foonathan_memory/cmake -DTHIRDPARTY=ON -DCMAKE_BUILD_TYPE="$1"
cmake -SFast-RTPS -B"$PROJECT_TEMP_DIR/Fast-RTPS" \
-DCMAKE_INSTALL_PREFIX=build/osx \
-Dfoonathan_memory_DIR=build/osx/share/foonathan_memory/cmake \
-DTHIRDPARTY=ON \
-DCMAKE_SKIP_RPATH=ON \
-DCMAKE_BUILD_TYPE="$1"
cmake --build "$PROJECT_TEMP_DIR/Fast-RTPS" --target install
mkdir Framework || true
cp build/osx/lib/libfastrtps.1.dylib Framework/
Expand Down

0 comments on commit cff5e7e

Please sign in to comment.