Skip to content

Commit 338ecfb

Browse files
committed
[libclc] Use VERSION_GREATER_EQUAL where appropriate. NFC
This was added in CMake 3.7, which might explain why it wasn't used before. Also reformat a couple of comments.
1 parent fb2a380 commit 338ecfb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

libclc/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
2020
spirv64/lib/SOURCES
2121
)
2222

23-
set( LIBCLC_MIN_LLVM "3.9.0" )
23+
set( LIBCLC_MIN_LLVM 3.9.0 )
2424

2525
set( LIBCLC_TARGETS_TO_BUILD "all"
2626
CACHE STRING "Semicolon-separated list of targets to build, or 'all'." )
@@ -32,7 +32,7 @@ include(AddLLVM)
3232

3333
message( STATUS "libclc LLVM version: ${LLVM_PACKAGE_VERSION}" )
3434

35-
if( ${LLVM_PACKAGE_VERSION} VERSION_LESS ${LIBCLC_MIN_LLVM} )
35+
if( LLVM_PACKAGE_VERSION VERSION_LESS LIBCLC_MIN_LLVM )
3636
message( FATAL_ERROR "libclc needs at least LLVM ${LIBCLC_MIN_LLVM}" )
3737
endif()
3838

@@ -66,7 +66,7 @@ set( LIBCLC_TARGETS_ALL
6666
)
6767

6868
# mesa3d environment is only available since LLVM 4.0
69-
if( ${LLVM_PACKAGE_VERSION} VERSION_GREATER "3.9.0" )
69+
if( LLVM_PACKAGE_VERSION VERSION_GREATER_EQUAL 4.0.0 )
7070
list( APPEND LIBCLC_TARGETS_ALL amdgcn-mesa-mesa3d )
7171
endif()
7272

@@ -102,7 +102,7 @@ set( LLVM_VERSION_DEFINE "-DHAVE_LLVM=0x${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MIN
102102

103103

104104
# LLVM 13 enables standard includes by default
105-
if( ${LLVM_PACKAGE_VERSION} VERSION_GREATER "12.99.99" )
105+
if( LLVM_PACKAGE_VERSION VERSION_GREATER_EQUAL 13.0.0 )
106106
set( CMAKE_LLAsm_FLAGS "${CMAKE_LLAsm_FLAGS} -cl-no-stdinc" )
107107
set( CMAKE_CLC_FLAGS "${CMAKE_CLC_FLAGS} -cl-no-stdinc" )
108108
endif()
@@ -205,7 +205,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
205205
list( APPEND dirs amdgpu )
206206
endif()
207207

208-
#nvptx is special
208+
# nvptx is special
209209
if( ${ARCH} STREQUAL nvptx OR ${ARCH} STREQUAL nvptx64 )
210210
set( DARCH ptx )
211211
else()
@@ -226,8 +226,8 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
226226
endforeach()
227227
endforeach()
228228

229-
# Add the generated convert.cl here to prevent adding
230-
# the one listed in SOURCES
229+
# Add the generated convert.cl here to prevent adding the one listed in
230+
# SOURCES
231231
if( NOT ${ARCH} STREQUAL "spirv" AND NOT ${ARCH} STREQUAL "spirv64" )
232232
if( NOT ENABLE_RUNTIME_SUBNORMAL AND NOT ${ARCH} STREQUAL "clspv" AND
233233
NOT ${ARCH} STREQUAL "clspv64" )

0 commit comments

Comments
 (0)