]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - easy-builder
readme: add instructions for freebsd and more knowledge about it
[xonotic/netradiant.git] / easy-builder
index 39857382c5ddad6fd2fe1c07cb0ab99f11cbff55..d2ff3da6e826d0bba53e7ba32514a895642ee3e5 100755 (executable)
@@ -14,6 +14,11 @@ install_dir="${project_source_dir}/install${SUBDIR:+/${SUBDIR}}"
 install_target='install/strip'
 build_type='Release'
 
+if [ "$(uname -s)" = 'FreeBSD' ]
+then
+       install_target='install'
+fi
+
 _job_count=4
 
 _nproc () {
@@ -25,9 +30,13 @@ _nproc () {
                        'Linux')
                                egrep "^processor" /proc/cpuinfo | wc -l
                                ;;
-                       'FreeBSD'|'Darwin')
+                       'FreeBSD')
                                sysctl -n hw.ncpu
                                ;;
+                       'Darwin')
+                               sysctl -n hw.logicalcpu \
+                               || sysctl -n hw.ncpu
+                               ;;
                        'MSYS_NT-'*|'CYGWIN_NT-'*|'MINGW'*'_NT-'*)
                                if command -v 'wmic' >/dev/null
                                then
@@ -77,19 +86,32 @@ do
        fi
 done
 
+case "$(uname -s)" in
+       'Darwin')
+               cmake_user_opts[${#cmake_user_opts[@]}]='-DBUILTIN_GTKGLEXT=ON -DBUILTIN_GTKTHEME_MOJAVE=ON'
+               ;;
+esac
+
 set -x
 
 "${fetch_submodules_cmd[@]}"
 
+mkdir -pv "${build_dir}"
+cd "${build_dir}"
+
 cmake \
        -G'Unix Makefiles' \
-       -S"${project_source_dir}" \
-       -B"${build_dir}" \
        -D'CMAKE_INSTALL_PREFIX'="${install_dir}" \
        -D'CMAKE_BUILD_TYPE'="${build_type}" \
        "${cmake_user_opts[@]}" \
        "${project_source_dir}"
 
+cmake \
+       --build "${build_dir}" \
+       -- \
+       -j"${job_count}" \
+       'builtins'
+
 cmake \
        --build "${build_dir}" \
        -- \