2017-09-13 05:17:19 +01:00
# Copyright (c) 2014 Andrew Kelley
# This file is MIT licensed.
# See http://opensource.org/licenses/MIT
# LLVM_FOUND
# LLVM_INCLUDE_DIRS
# LLVM_LIBRARIES
2019-07-09 18:31:13 +01:00
# LLVM_LIBDIRS
2022-07-16 02:51:41 +01:00
# LLVM_LINK_MODE
2017-09-13 05:17:19 +01:00
2022-12-28 02:20:36 +00:00
if ( ZIG_USE_LLVM_CONFIG )
set ( LLVM_CONFIG_ERROR_MESSAGES "" )
while ( 1 )
unset ( LLVM_CONFIG_EXE CACHE )
find_program ( LLVM_CONFIG_EXE
2023-01-26 03:26:14 +00:00
N A M E S l l v m - c o n f i g - 1 6 l l v m - c o n f i g - 1 6 . 0 l l v m - c o n f i g 1 6 0 l l v m - c o n f i g 1 6 l l v m - c o n f i g N A M E S _ P E R _ D I R
2022-12-28 02:20:36 +00:00
P A T H S
" / m i n g w 6 4 / b i n "
" / c / m s y s 6 4 / m i n g w 6 4 / b i n "
" c : / m s y s 6 4 / m i n g w 6 4 / b i n "
2023-01-26 03:26:14 +00:00
" C : / L i b r a r i e s / l l v m - 1 6 . 0 . 0 / b i n " )
2022-12-28 02:20:36 +00:00
if ( "${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND" )
if ( NOT LLVM_CONFIG_ERROR_MESSAGES STREQUAL "" )
list ( JOIN LLVM_CONFIG_ERROR_MESSAGES "\n" LLVM_CONFIG_ERROR_MESSAGE )
message ( FATAL_ERROR ${ LLVM_CONFIG_ERROR_MESSAGE } )
else ( )
message ( FATAL_ERROR "unable to find llvm-config" )
endif ( )
endif ( )
2020-10-16 07:28:24 +01:00
2022-07-16 02:51:41 +01:00
# Check that this LLVM is the right version
execute_process (
C O M M A N D $ { L L V M _ C O N F I G _ E X E } - - v e r s i o n
O U T P U T _ V A R I A B L E L L V M _ C O N F I G _ V E R S I O N
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
2020-10-16 07:28:24 +01:00
2022-12-28 02:20:36 +00:00
get_filename_component ( LLVM_CONFIG_DIR "${LLVM_CONFIG_EXE}" DIRECTORY )
2023-01-26 03:26:14 +00:00
if ( "${LLVM_CONFIG_VERSION}" VERSION_LESS 16 OR "${LLVM_CONFIG_VERSION}" VERSION_EQUAL 17 OR "${LLVM_CONFIG_VERSION}" VERSION_GREATER 17 )
2022-12-28 02:20:36 +00:00
# Save the error message, in case this is the last llvm-config we find
2023-01-26 03:26:14 +00:00
list ( APPEND LLVM_CONFIG_ERROR_MESSAGES "expected LLVM 16.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}" )
2022-12-28 02:20:36 +00:00
# Ignore this directory and try the search again
list ( APPEND CMAKE_IGNORE_PATH "${LLVM_CONFIG_DIR}" )
continue ( )
2022-07-16 02:51:41 +01:00
endif ( )
2020-10-16 07:28:24 +01:00
2022-07-16 02:51:41 +01:00
# Check that this LLVM supports linking as a shared/static library, if requested
if ( ZIG_SHARED_LLVM OR ZIG_STATIC_LLVM )
if ( ZIG_SHARED_LLVM )
set ( STATIC_OR_SHARED_LINK "--link-shared" )
elseif ( ZIG_STATIC_LLVM )
set ( STATIC_OR_SHARED_LINK "--link-static" )
endif ( )
2020-03-28 03:43:21 +00:00
2022-07-16 02:51:41 +01:00
execute_process (
C O M M A N D $ { L L V M _ C O N F I G _ E X E } - - l i b s $ { S T A T I C _ O R _ S H A R E D _ L I N K }
O U T P U T _ Q U I E T
E R R O R _ V A R I A B L E L L V M _ C O N F I G _ E R R O R
2022-07-16 16:26:45 +01:00
E R R O R _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
2020-03-28 03:43:21 +00:00
2022-12-28 02:20:36 +00:00
if ( LLVM_CONFIG_ERROR )
# Save the error message, in case this is the last llvm-config we find
2022-07-16 02:51:41 +01:00
if ( ZIG_SHARED_LLVM )
2023-01-26 03:26:14 +00:00
list ( APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 16.x found at ${LLVM_CONFIG_EXE} does not support linking as a shared library" )
2022-07-16 02:51:41 +01:00
else ( )
2023-01-26 03:26:14 +00:00
list ( APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 16.x found at ${LLVM_CONFIG_EXE} does not support linking as a static library" )
2022-07-16 02:51:41 +01:00
endif ( )
2022-12-28 02:20:36 +00:00
# Ignore this directory and try the search again
list ( APPEND CMAKE_IGNORE_PATH "${LLVM_CONFIG_DIR}" )
continue ( )
2022-07-16 02:51:41 +01:00
endif ( )
endif ( )
2020-03-28 03:43:21 +00:00
2022-07-16 02:51:41 +01:00
execute_process (
C O M M A N D $ { L L V M _ C O N F I G _ E X E } - - t a r g e t s - b u i l t
O U T P U T _ V A R I A B L E L L V M _ T A R G E T S _ B U I L T _ S P A C E S
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
string ( REPLACE " " ";" LLVM_TARGETS_BUILT "${LLVM_TARGETS_BUILT_SPACES}" )
2023-01-03 19:04:48 +00:00
set ( ZIG_LLVM_REQUIRED_TARGETS "AArch64;AMDGPU;ARM;AVR;BPF;Hexagon;Lanai;Mips;MSP430;NVPTX;PowerPC;RISCV;Sparc;SystemZ;VE;WebAssembly;X86;XCore" )
set ( ZIG_LLVM_REQUIRED_TARGETS_ENABLED TRUE )
foreach ( TARGET_NAME IN LISTS ZIG_LLVM_REQUIRED_TARGETS )
2020-03-28 03:43:21 +00:00
list ( FIND LLVM_TARGETS_BUILT "${TARGET_NAME}" _index )
if ( ${ _index } EQUAL -1 )
2022-12-28 02:20:36 +00:00
# Save the error message, in case this is the last llvm-config we find
list ( APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM (according to ${LLVM_CONFIG_EXE}) is missing target ${TARGET_NAME}. Zig requires LLVM to be built with all default targets enabled." )
2022-12-22 13:12:10 +00:00
2022-12-28 02:20:36 +00:00
# Ignore this directory and try the search again
list ( APPEND CMAKE_IGNORE_PATH "${LLVM_CONFIG_DIR}" )
2023-01-03 19:04:48 +00:00
set ( ZIG_LLVM_REQUIRED_TARGETS_ENABLED FALSE )
break ( )
2022-12-28 02:20:36 +00:00
endif ( )
2023-01-03 19:04:48 +00:00
endforeach ( )
if ( NOT ZIG_LLVM_REQUIRED_TARGETS_ENABLED )
continue ( )
endif ( )
2020-03-28 03:43:21 +00:00
2022-12-28 02:20:36 +00:00
# Got it!
break ( )
2022-07-16 02:51:41 +01:00
endwhile ( )
if ( ZIG_SHARED_LLVM OR ZIG_STATIC_LLVM )
2020-03-28 03:43:21 +00:00
execute_process (
2022-07-16 02:51:41 +01:00
C O M M A N D $ { L L V M _ C O N F I G _ E X E } - - l i b f i l e s $ { S T A T I C _ O R _ S H A R E D _ L I N K }
2020-03-28 03:43:21 +00:00
O U T P U T _ V A R I A B L E L L V M _ L I B R A R I E S _ S P A C E S
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
string ( REPLACE " " ";" LLVM_LIBRARIES "${LLVM_LIBRARIES_SPACES}" )
execute_process (
2022-07-16 02:51:41 +01:00
C O M M A N D $ { L L V M _ C O N F I G _ E X E } - - l i b d i r $ { S T A T I C _ O R _ S H A R E D _ L I N K }
2020-03-28 03:43:21 +00:00
O U T P U T _ V A R I A B L E L L V M _ L I B D I R S _ S P A C E S
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
string ( REPLACE " " ";" LLVM_LIBDIRS "${LLVM_LIBDIRS_SPACES}" )
2022-07-16 02:51:41 +01:00
2022-07-16 16:26:45 +01:00
execute_process (
C O M M A N D $ { L L V M _ C O N F I G _ E X E } - - s y s t e m - l i b s $ { S T A T I C _ O R _ S H A R E D _ L I N K }
O U T P U T _ V A R I A B L E L L V M _ S Y S T E M _ L I B S _ S P A C E S
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
string ( REPLACE " " ";" LLVM_SYSTEM_LIBS "${LLVM_SYSTEM_LIBS_SPACES}" )
2022-07-16 02:51:41 +01:00
execute_process (
C O M M A N D $ { L L V M _ C O N F I G _ E X E } - - s h a r e d - m o d e $ { S T A T I C _ O R _ S H A R E D _ L I N K }
O U T P U T _ V A R I A B L E L L V M _ L I N K _ M O D E
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
else ( )
2020-03-28 03:43:21 +00:00
execute_process (
C O M M A N D $ { L L V M _ C O N F I G _ E X E } - - l i b s
O U T P U T _ V A R I A B L E L L V M _ L I B R A R I E S _ S P A C E S
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
string ( REPLACE " " ";" LLVM_LIBRARIES "${LLVM_LIBRARIES_SPACES}" )
execute_process (
C O M M A N D $ { L L V M _ C O N F I G _ E X E } - - l i b d i r
O U T P U T _ V A R I A B L E L L V M _ L I B D I R S _ S P A C E S
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
string ( REPLACE " " ";" LLVM_LIBDIRS "${LLVM_LIBDIRS_SPACES}" )
2022-07-16 02:51:41 +01:00
2022-07-16 16:26:45 +01:00
execute_process (
C O M M A N D $ { L L V M _ C O N F I G _ E X E } - - s y s t e m - l i b s
O U T P U T _ V A R I A B L E L L V M _ S Y S T E M _ L I B S _ S P A C E S
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
string ( REPLACE " " ";" LLVM_SYSTEM_LIBS "${LLVM_SYSTEM_LIBS_SPACES}" )
2022-07-16 02:51:41 +01:00
execute_process (
C O M M A N D $ { L L V M _ C O N F I G _ E X E } - - s h a r e d - m o d e
O U T P U T _ V A R I A B L E L L V M _ L I N K _ M O D E
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
2020-03-28 03:43:21 +00:00
endif ( )
2022-07-16 16:26:45 +01:00
if ( ${ LLVM_LINK_MODE } STREQUAL "shared" )
# We always ask for the system libs corresponding to static linking,
# since on some distros LLD is only available as a static library
# and we need these libraries to link it successfully
execute_process (
C O M M A N D $ { L L V M _ C O N F I G _ E X E } - - s y s t e m - l i b s - - l i n k - s t a t i c
O U T P U T _ V A R I A B L E L L V M _ S T A T I C _ S Y S T E M _ L I B S _ S P A C E S
E R R O R _ Q U I E T # Some installations have no static libs, we just ignore the failure
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
string ( REPLACE " " ";" LLVM_STATIC_SYSTEM_LIBS "${LLVM_STATIC_SYSTEM_LIBS_SPACES}" )
2022-07-16 02:51:41 +01:00
2022-07-16 16:26:45 +01:00
set ( LLVM_LIBRARIES ${ LLVM_LIBRARIES } ${ LLVM_SYSTEM_LIBS } ${ LLVM_STATIC_SYSTEM_LIBS } )
else ( )
set ( LLVM_LIBRARIES ${ LLVM_LIBRARIES } ${ LLVM_SYSTEM_LIBS } )
endif ( )
2020-03-28 03:43:21 +00:00
2022-07-16 02:51:41 +01:00
execute_process (
C O M M A N D $ { L L V M _ C O N F I G _ E X E } - - i n c l u d e d i r
O U T P U T _ V A R I A B L E L L V M _ I N C L U D E _ D I R S _ S P A C E S
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
string ( REPLACE " " ";" LLVM_INCLUDE_DIRS "${LLVM_INCLUDE_DIRS_SPACES}" )
2020-03-28 03:43:21 +00:00
link_directories ( "${CMAKE_PREFIX_PATH}/lib" )
link_directories ( "${LLVM_LIBDIRS}" )
else ( )
2020-03-28 02:24:15 +00:00
# Here we assume that we're cross compiling with Zig, of course. No reason
2020-10-07 08:46:05 +01:00
# to support more complicated setups.
2019-02-07 17:18:01 +00:00
2020-04-17 23:41:21 +01:00
macro ( FIND_AND_ADD_LLVM_LIB _libname_ )
string ( TOUPPER ${ _libname_ } _prettylibname_ )
2022-07-16 02:51:41 +01:00
find_library ( LLVM_ ${ _prettylibname_ } _LIB
N A M E S $ { _ l i b n a m e _ } N A M E S _ P E R _ D I R )
2020-04-17 23:41:21 +01:00
set ( LLVM_LIBRARIES ${ LLVM_LIBRARIES } ${ LLVM_${_prettylibname_ } _LIB} )
endmacro ( FIND_AND_ADD_LLVM_LIB )
2017-09-23 23:46:03 +01:00
2022-07-16 02:51:41 +01:00
set ( LLVM_LINK_MODE "static" )
2020-04-17 23:41:21 +01:00
# This list can be re-generated with `llvm-config --libfiles` and then
# reformatting using your favorite text editor. Note we do not execute
# `llvm-config` here because we are cross compiling.
FIND_AND_ADD_LLVM_LIB ( LLVMWindowsManifest )
2022-08-03 00:57:32 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMWindowsDriver )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMXRay )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMLibDriver )
FIND_AND_ADD_LLVM_LIB ( LLVMDlltoolDriver )
FIND_AND_ADD_LLVM_LIB ( LLVMCoverage )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMLineEditor )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMXCoreDisassembler )
FIND_AND_ADD_LLVM_LIB ( LLVMXCoreCodeGen )
FIND_AND_ADD_LLVM_LIB ( LLVMXCoreDesc )
FIND_AND_ADD_LLVM_LIB ( LLVMXCoreInfo )
2022-07-04 02:41:43 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMX86TargetMCA )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMX86Disassembler )
2020-10-05 20:15:57 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMX86AsmParser )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMX86CodeGen )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMX86Desc )
FIND_AND_ADD_LLVM_LIB ( LLVMX86Info )
FIND_AND_ADD_LLVM_LIB ( LLVMWebAssemblyDisassembler )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMWebAssemblyAsmParser )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMWebAssemblyCodeGen )
FIND_AND_ADD_LLVM_LIB ( LLVMWebAssemblyDesc )
2021-10-01 07:33:03 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMWebAssemblyUtils )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMWebAssemblyInfo )
2022-07-04 02:41:43 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMVEDisassembler )
FIND_AND_ADD_LLVM_LIB ( LLVMVEAsmParser )
FIND_AND_ADD_LLVM_LIB ( LLVMVECodeGen )
FIND_AND_ADD_LLVM_LIB ( LLVMVEDesc )
FIND_AND_ADD_LLVM_LIB ( LLVMVEInfo )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMSystemZDisassembler )
FIND_AND_ADD_LLVM_LIB ( LLVMSystemZAsmParser )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMSystemZCodeGen )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMSystemZDesc )
FIND_AND_ADD_LLVM_LIB ( LLVMSystemZInfo )
FIND_AND_ADD_LLVM_LIB ( LLVMSparcDisassembler )
FIND_AND_ADD_LLVM_LIB ( LLVMSparcAsmParser )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMSparcCodeGen )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMSparcDesc )
FIND_AND_ADD_LLVM_LIB ( LLVMSparcInfo )
FIND_AND_ADD_LLVM_LIB ( LLVMRISCVDisassembler )
FIND_AND_ADD_LLVM_LIB ( LLVMRISCVAsmParser )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMRISCVCodeGen )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMRISCVDesc )
FIND_AND_ADD_LLVM_LIB ( LLVMRISCVInfo )
FIND_AND_ADD_LLVM_LIB ( LLVMPowerPCDisassembler )
FIND_AND_ADD_LLVM_LIB ( LLVMPowerPCAsmParser )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMPowerPCCodeGen )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMPowerPCDesc )
FIND_AND_ADD_LLVM_LIB ( LLVMPowerPCInfo )
FIND_AND_ADD_LLVM_LIB ( LLVMNVPTXCodeGen )
FIND_AND_ADD_LLVM_LIB ( LLVMNVPTXDesc )
FIND_AND_ADD_LLVM_LIB ( LLVMNVPTXInfo )
FIND_AND_ADD_LLVM_LIB ( LLVMMSP430Disassembler )
FIND_AND_ADD_LLVM_LIB ( LLVMMSP430AsmParser )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMMSP430CodeGen )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMMSP430Desc )
FIND_AND_ADD_LLVM_LIB ( LLVMMSP430Info )
FIND_AND_ADD_LLVM_LIB ( LLVMMipsDisassembler )
FIND_AND_ADD_LLVM_LIB ( LLVMMipsAsmParser )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMMipsCodeGen )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMMipsDesc )
FIND_AND_ADD_LLVM_LIB ( LLVMMipsInfo )
FIND_AND_ADD_LLVM_LIB ( LLVMLanaiDisassembler )
FIND_AND_ADD_LLVM_LIB ( LLVMLanaiCodeGen )
FIND_AND_ADD_LLVM_LIB ( LLVMLanaiAsmParser )
FIND_AND_ADD_LLVM_LIB ( LLVMLanaiDesc )
FIND_AND_ADD_LLVM_LIB ( LLVMLanaiInfo )
FIND_AND_ADD_LLVM_LIB ( LLVMHexagonDisassembler )
FIND_AND_ADD_LLVM_LIB ( LLVMHexagonCodeGen )
FIND_AND_ADD_LLVM_LIB ( LLVMHexagonAsmParser )
FIND_AND_ADD_LLVM_LIB ( LLVMHexagonDesc )
FIND_AND_ADD_LLVM_LIB ( LLVMHexagonInfo )
FIND_AND_ADD_LLVM_LIB ( LLVMBPFDisassembler )
FIND_AND_ADD_LLVM_LIB ( LLVMBPFAsmParser )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMBPFCodeGen )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMBPFDesc )
FIND_AND_ADD_LLVM_LIB ( LLVMBPFInfo )
2020-10-05 20:15:57 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMAVRDisassembler )
FIND_AND_ADD_LLVM_LIB ( LLVMAVRAsmParser )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMAVRCodeGen )
2020-10-05 20:15:57 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMAVRDesc )
FIND_AND_ADD_LLVM_LIB ( LLVMAVRInfo )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMARMDisassembler )
FIND_AND_ADD_LLVM_LIB ( LLVMARMAsmParser )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMARMCodeGen )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMARMDesc )
FIND_AND_ADD_LLVM_LIB ( LLVMARMUtils )
FIND_AND_ADD_LLVM_LIB ( LLVMARMInfo )
2022-07-04 02:41:43 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMAMDGPUTargetMCA )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMAMDGPUDisassembler )
FIND_AND_ADD_LLVM_LIB ( LLVMAMDGPUAsmParser )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMAMDGPUCodeGen )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMAMDGPUDesc )
FIND_AND_ADD_LLVM_LIB ( LLVMAMDGPUUtils )
FIND_AND_ADD_LLVM_LIB ( LLVMAMDGPUInfo )
FIND_AND_ADD_LLVM_LIB ( LLVMAArch64Disassembler )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMAArch64AsmParser )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMAArch64CodeGen )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMAArch64Desc )
FIND_AND_ADD_LLVM_LIB ( LLVMAArch64Utils )
FIND_AND_ADD_LLVM_LIB ( LLVMAArch64Info )
FIND_AND_ADD_LLVM_LIB ( LLVMOrcJIT )
FIND_AND_ADD_LLVM_LIB ( LLVMMCJIT )
FIND_AND_ADD_LLVM_LIB ( LLVMJITLink )
FIND_AND_ADD_LLVM_LIB ( LLVMInterpreter )
FIND_AND_ADD_LLVM_LIB ( LLVMExecutionEngine )
FIND_AND_ADD_LLVM_LIB ( LLVMRuntimeDyld )
2021-10-01 07:33:03 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMOrcTargetProcess )
FIND_AND_ADD_LLVM_LIB ( LLVMOrcShared )
FIND_AND_ADD_LLVM_LIB ( LLVMDWP )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMDebugInfoGSYM )
FIND_AND_ADD_LLVM_LIB ( LLVMOption )
FIND_AND_ADD_LLVM_LIB ( LLVMObjectYAML )
2022-08-03 00:57:32 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMObjCopy )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMMCA )
FIND_AND_ADD_LLVM_LIB ( LLVMMCDisassembler )
FIND_AND_ADD_LLVM_LIB ( LLVMLTO )
FIND_AND_ADD_LLVM_LIB ( LLVMPasses )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMCFGuard )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMCoroutines )
FIND_AND_ADD_LLVM_LIB ( LLVMObjCARCOpts )
FIND_AND_ADD_LLVM_LIB ( LLVMipo )
FIND_AND_ADD_LLVM_LIB ( LLVMVectorize )
FIND_AND_ADD_LLVM_LIB ( LLVMLinker )
FIND_AND_ADD_LLVM_LIB ( LLVMInstrumentation )
FIND_AND_ADD_LLVM_LIB ( LLVMFrontendOpenMP )
FIND_AND_ADD_LLVM_LIB ( LLVMFrontendOpenACC )
FIND_AND_ADD_LLVM_LIB ( LLVMExtensions )
FIND_AND_ADD_LLVM_LIB ( LLVMDWARFLinker )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMGlobalISel )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMMIRParser )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMAsmPrinter )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMSelectionDAG )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMCodeGen )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMIRReader )
FIND_AND_ADD_LLVM_LIB ( LLVMAsmParser )
FIND_AND_ADD_LLVM_LIB ( LLVMInterfaceStub )
FIND_AND_ADD_LLVM_LIB ( LLVMFileCheck )
FIND_AND_ADD_LLVM_LIB ( LLVMFuzzMutate )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMTarget )
FIND_AND_ADD_LLVM_LIB ( LLVMScalarOpts )
FIND_AND_ADD_LLVM_LIB ( LLVMInstCombine )
FIND_AND_ADD_LLVM_LIB ( LLVMAggressiveInstCombine )
FIND_AND_ADD_LLVM_LIB ( LLVMTransformUtils )
FIND_AND_ADD_LLVM_LIB ( LLVMBitWriter )
FIND_AND_ADD_LLVM_LIB ( LLVMAnalysis )
FIND_AND_ADD_LLVM_LIB ( LLVMProfileData )
2022-08-03 00:57:32 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMSymbolize )
FIND_AND_ADD_LLVM_LIB ( LLVMDebugInfoPDB )
FIND_AND_ADD_LLVM_LIB ( LLVMDebugInfoMSF )
2022-07-04 02:41:43 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMDebugInfoDWARF )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMObject )
FIND_AND_ADD_LLVM_LIB ( LLVMTextAPI )
FIND_AND_ADD_LLVM_LIB ( LLVMMCParser )
FIND_AND_ADD_LLVM_LIB ( LLVMMC )
FIND_AND_ADD_LLVM_LIB ( LLVMDebugInfoCodeView )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMBitReader )
2022-08-03 00:57:32 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMFuzzerCLI )
2021-03-01 20:42:35 +00:00
FIND_AND_ADD_LLVM_LIB ( LLVMCore )
FIND_AND_ADD_LLVM_LIB ( LLVMRemarks )
FIND_AND_ADD_LLVM_LIB ( LLVMBitstreamReader )
2020-04-17 23:41:21 +01:00
FIND_AND_ADD_LLVM_LIB ( LLVMBinaryFormat )
FIND_AND_ADD_LLVM_LIB ( LLVMSupport )
FIND_AND_ADD_LLVM_LIB ( LLVMDemangle )
2022-07-16 02:51:41 +01:00
get_filename_component ( LLVM_LIBDIRS "${LLVM_LLVMCORE_LIB}" DIRECTORY )
find_path ( LLVM_INCLUDE_DIRS NAMES llvm/IR/IRBuilder.h )
2017-09-28 15:48:13 +01:00
endif ( )
2017-09-13 05:17:19 +01:00
include ( FindPackageHandleStandardArgs )
2020-03-25 22:43:28 +00:00
find_package_handle_standard_args ( llvm DEFAULT_MSG LLVM_LIBRARIES LLVM_INCLUDE_DIRS )
2017-09-13 05:17:19 +01:00
2019-07-09 18:31:13 +01:00
mark_as_advanced ( LLVM_INCLUDE_DIRS LLVM_LIBRARIES LLVM_LIBDIRS )