summaryrefslogtreecommitdiff
path: root/libclc
diff options
context:
space:
mode:
authorJan Vesely <jan.vesely@rutgers.edu>2021-07-15 10:41:50 +1000
committerDave Airlie <airlied@redhat.com>2021-07-15 10:43:26 +1000
commitea469b08b847cef5f4c8187228f1e4bbf881706a (patch)
tree634a33727213765c516f6ed9145cdb5cb2f84d57 /libclc
parenta7749c3f79a8b0df9ffe8a814a13f9450981b292 (diff)
downloadllvm-ea469b08b847cef5f4c8187228f1e4bbf881706a.tar.gz
libclc: Add -cl-no-stdinc to clang flags on clang >=13
cf3ef15a6ec5e5b45c6c54e8fbe3769255e815ce ("[OpenCL] Add builtin declarations by default.") switched behaviour to include "opencl-c-base.h". We don't want or need that for libclc so pass the flag to revert to old behaviour. Fixes build since cf3ef15a6ec5e5b45c6c54e8fbe3769255e815ce Reviewed By: tstellar Differential Revision: https://reviews.llvm.org/D99794
Diffstat (limited to 'libclc')
-rw-r--r--libclc/CMakeLists.txt10
1 files changed, 9 insertions, 1 deletions
diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index 7f8d81e9036a..ec39ea63f2d0 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -124,7 +124,6 @@ set( CMAKE_CLC_ARCHIVE ${LLVM_LINK} )
set( CMAKE_LLAsm_PREPROCESSOR ${LLVM_CLANG} )
set( CMAKE_LLAsm_COMPILER ${LLVM_AS} )
set( CMAKE_LLAsm_ARCHIVE ${LLVM_LINK} )
-enable_language( CLC LLAsm )
# Construct LLVM version define
string( REPLACE "." ";" LLVM_VERSION_LIST ${LLVM_VERSION} )
@@ -132,6 +131,15 @@ list( GET LLVM_VERSION_LIST 0 LLVM_MAJOR )
list( GET LLVM_VERSION_LIST 1 LLVM_MINOR )
set( LLVM_VERSION_DEFINE "-DHAVE_LLVM=0x${LLVM_MAJOR}0${LLVM_MINOR}" )
+
+# LLVM 13 enables standard includes by default
+if( ${LLVM_VERSION} VERSION_GREATER "12.99.99" )
+ set( CMAKE_LLAsm_FLAGS ${CMAKE_LLAsm_FLAGS} -cl-no-stdinc )
+ set( CMAKE_CLC_FLAGS ${CMAKE_CLC_FLAGS} -cl-no-stdinc )
+endif()
+
+enable_language( CLC LLAsm )
+
# This needs to be set before any target that needs it
link_directories( ${LLVM_LIBDIR} )