Skip to content

Commit c7208ee

Browse files
committed
refactor(cli): improve build with 'libomp' and codesign
1 parent dafc29b commit c7208ee

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

bin/install.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -624,11 +624,12 @@ function _install {
624624
fi
625625
fi
626626

627-
cp -f "$libomp" "$SOCKET_HOME/lib/$arch-desktop/$(basename "$libomp")"
627+
mkdir -p "$SOCKET_HOME/lib/$arch-desktop/codesign"
628+
cp -f "$libomp" "$SOCKET_HOME/lib/$arch-desktop/codesign/$(basename "$libomp")"
628629
echo "# copied '$libomp_path'"
629630

630631
echo "# modifying the install name of the copied 'libomp.dylib'"
631-
quiet install_name_tool -id "@rpath/$(basename "$libomp_path")" "$SOCKET_HOME/lib/$arch-desktop/$(basename "$libomp")"
632+
quiet install_name_tool -id "@rpath/$(basename "$libomp_path")" "$SOCKET_HOME/lib/$arch-desktop/codesign/$(basename "$libomp")"
632633
die $? "not ok - failed to modify the install name of copied 'libomp.dylib'"
633634
else
634635
if (( do_link == 1 )); then

src/cli/main.cc

+5-2
Original file line numberDiff line numberDiff line change
@@ -3094,7 +3094,10 @@ int main (int argc, char* argv[]) {
30943094
flags += " -I" + prefixFile();
30953095
flags += " -I" + prefixFile("include");
30963096
flags += " -L" + prefixFile("lib/" + platform.arch + "-desktop");
3097-
flags += " -Wl,-rpath,@executable_path";
3097+
if (flagCodeSign) {
3098+
flags += " -Wl,-rpath,@executable_path";
3099+
flags += " -L" + prefixFile("lib/" + platform.arch + "-desktop/codesign");
3100+
}
30983101
flags += " -fPIC";
30993102
flags += " -lsocket-runtime";
31003103
flags += " -lomp";
@@ -3251,7 +3254,7 @@ int main (int argc, char* argv[]) {
32513254

32523255
fs::create_directories(paths.pathPackage / pathBase / "MacOS");
32533256
fs::copy(
3254-
trim(prefixFile("lib/" + platform.arch + "-desktop/libomp.dylib")),
3257+
trim(prefixFile("lib/" + platform.arch + "-desktop/codesign/libomp.dylib")),
32553258
paths.pathPackage / pathBase / "MacOS" / "libomp.dylib",
32563259
fs::copy_options::overwrite_existing
32573260
);

0 commit comments

Comments
 (0)