Skip to content

Commit 304eaa0

Browse files
authored
Works around windows x86 in-tree build if CMAKE_SIZEOF_VOID_P is not set (#413)
* Works around windows x86 build if CMAKE_SIZEOF_VOID_P is not set Determine windows binary suffix via LLVM_BUILD_32_BITS in windows x86 if CMAKE_SIZEOF_VOID_P is not set * Apply suggestions
1 parent 9f50367 commit 304eaa0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,15 @@ use_rtti(FALSE)
8888
use_eh(TRUE)
8989

9090
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
91-
set(ADDR 32)
91+
set(ADDR 32)
92+
elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
93+
set(ADDR 64)
9294
else ()
93-
set(ADDR 64)
95+
# CMAKE_SIZEOF_VOID_P might not be set on windows x86 in in-tree build
96+
message(WARNING "[OPENCL-CLANG] CMAKE_SIZEOF_VOID_P is not set")
97+
if (WIN32 AND LLVM_BUILD_32_BITS)
98+
set(ADDR 32)
99+
endif()
94100
endif (CMAKE_SIZEOF_VOID_P EQUAL 4)
95101

96102
# set windows binary suffix

0 commit comments

Comments
 (0)