[PATCH] D131266: libclc: Allow building with only required LLVM libs and with custom CLC/LLAsm flags

Callum Fare via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 5 08:45:28 PDT 2022


callumfare created this revision.
Herald added subscribers: jvesely, mgorny.
Herald added a project: All.
callumfare requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

- Only call `llvm-config --system-libs` with the required libraries so libclc doesn't depend on all LLVM components being built.
- Handle `CMAKE_CLC_FLAGS` and `CMAKE_LLAsm_FLAGS` correctly so users can pass custom flags


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131266

Files:
  libclc/CMakeLists.txt


Index: libclc/CMakeLists.txt
===================================================================
--- libclc/CMakeLists.txt
+++ libclc/CMakeLists.txt
@@ -61,7 +61,7 @@
 	set( LIBCLC_TARGETS_TO_BUILD ${LIBCLC_TARGETS_ALL} )
 endif()
 
-execute_process( COMMAND ${LLVM_CONFIG} "--system-libs"
+execute_process( COMMAND ${LLVM_CONFIG} "--system-libs" "core" "bitreader" "bitwriter"
 	OUTPUT_VARIABLE LLVM_SYSTEM_LIBS
 	OUTPUT_STRIP_TRAILING_WHITESPACE )
 separate_arguments( LLVM_SYSTEM_LIBS )
@@ -136,8 +136,8 @@
 
 # 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 )
+				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 )


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131266.450304.patch
Type: text/x-patch
Size: 907 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220805/917d93f5/attachment.bin>


More information about the llvm-commits mailing list