Skip to content

Commit

Permalink
Workaround non-conformant C++ in 1.8 preview (#74)
Browse files Browse the repository at this point in the history
This works around the DXC 1.8 preview build having non-conforant code by
passing `-fpermissive` to gcc.

Fixes #73
  • Loading branch information
llvm-beanz authored Nov 28, 2023
1 parent b1fd7e3 commit 074cd79
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion misc/build-dxc.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ URL=https://github.com/microsoft/DirectXShaderCompiler
FULLNAME=dxc-${VERSION}.tar.xz
OUTPUT=${ROOT}/${FULLNAME}
S3OUTPUT=
EXTRA_CMAKE_ARGS=
if [[ $2 =~ ^s3:// ]]; then
S3OUTPUT=$2
else
Expand All @@ -38,14 +39,18 @@ if [[ "${REVISION}" == "${LAST_REVISION}" ]]; then
exit
fi

if [[ "${VERSION}" == "1.8.2306-preview" ]]; then
EXTRA_CMAKE_ARGS="-DCMAKE_CXX_FLAGS=-fpermissive"
fi

BUILD_DIR=$(pwd)/dxc/build
DIR=$(pwd)/dxc
export PATH=${PATH}:/cmake/bin
git clone --recurse-submodules --depth 1 -b ${BRANCH} ${URL} ${DIR}

cd ${DIR}
mkdir -p ${BUILD_DIR}
cmake -S . -B ${BUILD_DIR} -G Ninja -DCMAKE_BUILD_TYPE=Release -C ./cmake/caches/PredefinedParams.cmake
cmake -S . -B ${BUILD_DIR} -G Ninja -DCMAKE_BUILD_TYPE=Release -C ./cmake/caches/PredefinedParams.cmake $EXTRA_CMAKE_ARGS
cmake --build ${BUILD_DIR}

export XZ_DEFAULTS="-T 0"
Expand Down

0 comments on commit 074cd79

Please sign in to comment.