Skip to content

Commit 1111858

Browse files
feat: Enable change the system install path (#653)
#### Problem: The current `CMAKE_INSTALL_PREFIX` value for the `system` build mode is `/usr`. However, in`macOS` as an example, you cannot write to `/usr` without `sudo` permission. #### Proposed solution: Enable changing the value to `/usr/local` (or any other path). This change makes the script use the value of the environment variable `SYSTEM_INSTALL_PREFIX` to select the installation path. If the variable is not set, it fallback to the path `/usr`.
1 parent f3a746d commit 1111858

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

script/build-libgit2.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ if [ -z "${BUILD_SHARED_LIBS}" ]; then
4747
fi
4848

4949
if [ "${BUILD_SYSTEM}" = "ON" ]; then
50-
BUILD_INSTALL_PREFIX="/usr"
50+
BUILD_INSTALL_PREFIX=${SYSTEM_INSTALL_PREFIX-"/usr"}
5151
else
5252
BUILD_INSTALL_PREFIX="${BUILD_PATH}/install"
5353
mkdir -p "${BUILD_PATH}/install/lib"

0 commit comments

Comments
 (0)