correct cmake options when building for nvidia with cuda installed
@@ -18,6 +18,13 @@ if [ "$AOMP_USE_NINJA" == 0 ] ; then
else
_set_ninja_gan="-G Ninja"
fi
+if [ "$TRUNK_BUILD_CUDA" == 0 ] ; then
+ _cuda_plugin="-DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+ _targets_to_build="-DLLVM_TARGETS_TO_BUILD='X86;AMDGPU'"
+else
+ _cuda_plugin="-DLIBOMPTARGET_BUILD_CUDA_PLUGIN=ON"
+ _targets_to_build="-DLLVM_TARGETS_TO_BUILD='X86;AMDGPU;NVPTX'"
+fi
# -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
# -DFLANG_ENABLE_WERROR=ON \
@@ -31,11 +38,11 @@ $_set_ninja_gan \
-DLLVM_ENABLE_PROJECTS='lld;clang;mlir;openmp' \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=$TRUNK_INSTALL_DIR \
--DLLVM_TARGETS_TO_BUILD='X86;AMDGPU;NVPTX' \
+$_targets_to_build \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_INSTALL_UTILS=ON \
-DCMAKE_CXX_STANDARD=17 \
--DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF \
+$_cuda_plugin \
-DCLANG_DEFAULT_PIE_ON_LINUX=OFF \
"
