Skip to content

Commit

Permalink
cmake fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rectalogic committed Mar 22, 2024
1 parent 439ce5f commit 0a92c1e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
12 changes: 6 additions & 6 deletions builders/Linux/iwyu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
set -e

BUILD_TYPE=${BUILD_TYPE:-Debug}
mkdir -p /mediafx/build/Linux/${BUILD_TYPE}
cd /mediafx/build/Linux/${BUILD_TYPE}
if [ ! -f "qt${QT_VER}.imp" ]; then
curl -O https://raw.githubusercontent.com/include-what-you-use/include-what-you-use/clang_13/mapgen/iwyu-mapgen-qt.py
python3 iwyu-mapgen-qt.py ${QTDIR}/include > qt${QT_VER}.imp
MEDIAFX_BUILD=/mediafx/build/Linux/${BUILD_TYPE}
mkdir -p "${MEDIAFX_BUILD}"
if [ ! -f "${MEDIAFX_BUILD}/qt${QT_VER}.imp" ]; then
curl -o "${MEDIAFX_BUILD}/iwyu-mapgen-qt.py" https://raw.githubusercontent.com/include-what-you-use/include-what-you-use/clang_13/mapgen/iwyu-mapgen-qt.py
python3 "${MEDIAFX_BUILD}/iwyu-mapgen-qt.py" ${QTDIR}/include > "${MEDIAFX_BUILD}/qt${QT_VER}.imp"
fi
CC="clang" CXX="clang++" cmake -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="/usr/bin/iwyu;-Xiwyu;--mapping_file=/mediafx/build/Linux/${BUILD_TYPE}/qt${QT_VER}.imp;-Xiwyu;--mapping_file=/mediafx/builders/Linux/iwyu.imp;-Xiwyu;--cxx17ns;-Xiwyu;--no_comments" --install-prefix ${QTDIR} ../../.. && exec cmake --build . --parallel 4
CC="clang" CXX="clang++" cmake -S "${SOURCE_ROOT}" -B "$MEDIAFX_BUILD" -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="/usr/bin/iwyu;-Xiwyu;--mapping_file=${MEDIAFX_BUILD}/qt${QT_VER}.imp;-Xiwyu;--mapping_file=/mediafx/builders/Linux/iwyu.imp;-Xiwyu;--cxx17ns;-Xiwyu;--no_comments" --install-prefix ${QTDIR} && exec cmake --build "${MEDIAFX_BUILD}" --parallel 4
11 changes: 6 additions & 5 deletions builders/Linux/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
# SPDX-License-Identifier: GPL-3.0-or-later

BUILD_TYPE=${BUILD_TYPE:-Debug}
MEDIAFX_BUILD=/mediafx/build/Linux/${BUILD_TYPE}
mkdir -p /mediafx/build/Linux/${BUILD_TYPE}
cd /mediafx/build/Linux/${BUILD_TYPE}
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=${BUILD_TYPE} --install-prefix ${QTDIR} ../../.. || exit 1
cmake -S "${SOURCE_ROOT}" -B "$MEDIAFX_BUILD" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=${BUILD_TYPE} --install-prefix ${QTDIR} || exit 1
# Generate *.moc include files for tests
make tst_encoder_autogen/fast tst_decoder_autogen/fast tst_interval_autogen/fast || exit 1
cmake --build "${MEDIAFX_BUILD}" tst_encoder_autogen/fast tst_decoder_autogen/fast tst_interval_autogen/fast || exit 1

cd /mediafx
git config --global --add safe.directory /mediafx
FILES=$(git ls-files '**/*.cpp' '**/*.h')
/usr/bin/clang-tidy -p /mediafx/build/Linux/${BUILD_TYPE} $FILES || exit 1
/usr/bin/clazy-standalone -p /mediafx/build/Linux/${BUILD_TYPE}/compile_commands.json $FILES || exit 1
/usr/bin/clang-tidy -p "${MEDIAFX_BUILD}" $FILES || exit 1
/usr/bin/clazy-standalone -p "${MEDIAFX_BUILD}/compile_commands.json" $FILES || exit 1
2 changes: 1 addition & 1 deletion builders/mediafx-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ source "$CURRENT/versions"
BUILD_TYPE=${BUILD_TYPE:-Release}
MEDIAFX_BUILD="${BUILD_ROOT}/${BUILD_TYPE}"
mkdir -p "$MEDIAFX_BUILD"
cmake -S . -B "$MEDIAFX_BUILD" -DCMAKE_BUILD_TYPE=$BUILD_TYPE --install-prefix "${QTDIR}" && cmake --build "$MEDIAFX_BUILD" && ${SUDO} cmake --install "$MEDIAFX_BUILD" || exit 1
(cmake -S "${SOURCE_ROOT}" -B "$MEDIAFX_BUILD" -DCMAKE_BUILD_TYPE=$BUILD_TYPE --install-prefix "${QTDIR}" && cmake --build "$MEDIAFX_BUILD" && ${SUDO} cmake --install "$MEDIAFX_BUILD") || exit 1
1 change: 1 addition & 0 deletions builders/versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export QT_VER=6.6.2
export SOURCE_ROOT="${BASH_SOURCE%/*}/.."
BUILD_ROOT="${BASH_SOURCE%/*}/../build/$(uname)"
mkdir -p "${BUILD_ROOT}"
export BUILD_ROOT=$(cd "${BUILD_ROOT}"; pwd)
Expand Down

0 comments on commit 0a92c1e

Please sign in to comment.