mingw64 build fixes

This commit is contained in:
2024-01-27 12:21:37 -06:00
parent 7698a62c1f
commit f6cdf2914c
5 changed files with 89 additions and 57 deletions

View File

@ -3,13 +3,12 @@
BUILD_TYPE=$1
BUILD_CLEAN=$2
IS_MINGW=$3
IS_WIN32=$4
if [ "${BUILD_TYPE}" == "" ]; then
BUILD_TYPE=Release
fi
if [ "${IS_MINGW}" == "1" ] || [ "${IS_WIN32}" == "1" ]; then
if [ "${IS_MINGW}" == "1" ]; then
BUILD_ROOT=build2
else
BUILD_ROOT=build
@ -41,7 +40,7 @@ if [ "${IS_MINGW}" == "1" ]; then
CMAKE_ADDITIONAL_OPTS=-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN}
fi
if [ "${IS_MINGW}" == "1" ] || [ "${IS_WIN32}" == "1" ]; then
if [ "${IS_MINGW}" == "1" ]; then
EXE_EXT=.exe
fi
@ -55,7 +54,7 @@ pushd ..
ln -sf ${BUILD_FOLDER}/compile_commands.json .
ln -sf ${BUILD_FOLDER}/repertory${EXE_EXT} .
ln -sf ${BUILD_FOLDER}/unittests${EXE_EXT} .
if [ "${IS_MINGW}" == "1" ] || [ "${IS_WIN32}" == "1" ]; then
if [ "${IS_MINGW}" == "1" ]; then
ln -sf ${BUILD_FOLDER}/winfsp-x64.dll .
fi
popd
@ -71,7 +70,7 @@ pushd ../${BUILD_ROOT}
ln -sf ${BUILD_FOLDER}/compile_commands.json .
ln -sf ${BUILD_FOLDER}/repertory${EXE_EXT} .
ln -sf ${BUILD_FOLDER}/unittests${EXE_EXT} .
if [ "${IS_MINGW}" == "1" ] || [ "${IS_WIN32}" == "1" ]; then
if [ "${IS_MINGW}" == "1" ]; then
ln -sf ${BUILD_FOLDER}/winfsp-x64.dll .
fi
popd

View File

@ -1,10 +1,15 @@
#!/bin/bash
# #!/bin/bash
#
# pushd "$(dirname "$0")/.."
# scripts/make_common.sh "${1}" "${2}" 1
# popd
#
NUM_JOBS=${MY_NUM_JOBS}
if [[ -z "${NUM_JOBS}" ]]; then
NUM_JOBS=$(getconf _NPROCESSORS_ONLN 2> /dev/null || getconf NPROCESSORS_ONLN 2> /dev/null || echo 1)
if [ "${NUM_JOBS}" -gt "2" ]; then
NUM_JOBS=$(expr ${NUM_JOBS} - 2)
elif [ "${NUM_JOBS}" -gt "1" ]; then
NUM_JOBS=$(expr ${NUM_JOBS} - 1)
fi
fi
BUILD_TYPE=$1
BUILD_CLEAN=$2
@ -18,6 +23,6 @@ docker stop repertory_${NAME}
docker rm repertory_${NAME}
docker build --build-arg NUM_JOBS=${MY_NUM_JOBS} -t repertory:${NAME} - < ${SOURCE_DIR}/docker/${BUILD_ARCH}/${NAME} &&
docker run -td -u $(id -u):$(id -g) --name repertory_${NAME} -w ${SOURCE_DIR} -v ${SOURCE_DIR}:${SOURCE_DIR}:rw,z repertory:${NAME} &&
docker exec repertory_${NAME} /bin/bash -c "${SOURCE_DIR}/scripts/make_common.sh ${BUILD_TYPE} "${BUILD_CLEAN}" 1"
docker exec repertory_${NAME} /bin/bash -c "${SOURCE_DIR}/scripts/make_common.sh ${BUILD_TYPE} \"${BUILD_CLEAN}\" 1"
docker stop repertory_${NAME}
docker rm repertory_${NAME}