Skip to content

Commit 73392bc

Browse files
scottp101igcbot
authored andcommitted
Fix IRBG build failure
Fix IRBG build failure
1 parent c526b64 commit 73392bc

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

IGC/cmake/IRBuilderGeneratorCodeGen.cmake

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ function(generate_irbuilder_headers)
9898
SET(OPAQUE_PTR_ARGS "-Xclang" "-no-opaque-pointers")
9999
endif()
100100

101+
# Check if clang headers directory exists
102+
set(NOSTDINC_FLAG "")
103+
set(CLANG_HEADERS_INCLUDE "")
104+
if(EXISTS ${CLANG_HEADERS})
105+
set(NOSTDINC_FLAG "-nostdinc")
106+
set(CLANG_HEADERS_INCLUDE "-I" ${CLANG_HEADERS})
107+
endif()
108+
101109
# Common clang options
102110
set(CLANG_OPTIONS
103111
-target x86_64-pc-windows
@@ -107,7 +115,8 @@ function(generate_irbuilder_headers)
107115
-emit-llvm
108116
-c
109117
-x c++
110-
-I ${CLANG_HEADERS}
118+
${NOSTDINC_FLAG}
119+
${CLANG_HEADERS_INCLUDE}
111120
${INCLUDE_FLAGS}
112121
-O2
113122
-g0

0 commit comments

Comments
 (0)