2022-04-27 01:37:38 +00:00
## The Intel® QPL provides high performance implementations of data processing functions for existing hardware accelerator, and/or software path in case if hardware accelerator is not available.
2023-05-08 19:20:55 +00:00
set ( UUID_DIR "${ClickHouse_SOURCE_DIR}/contrib/qpl-cmake" )
2022-04-27 01:37:38 +00:00
set ( QPL_PROJECT_DIR "${ClickHouse_SOURCE_DIR}/contrib/qpl" )
set ( QPL_SRC_DIR "${ClickHouse_SOURCE_DIR}/contrib/qpl/sources" )
2022-07-05 18:08:44 +00:00
set ( QPL_BINARY_DIR "${ClickHouse_BINARY_DIR}/build/contrib/qpl" )
2022-12-07 21:41:12 +00:00
set ( EFFICIENT_WAIT OFF )
2022-04-27 01:37:38 +00:00
set ( BLOCK_ON_FAULT ON )
2022-04-27 17:54:57 +00:00
set ( LOG_HW_INIT OFF )
set ( SANITIZE_MEMORY OFF )
set ( SANITIZE_THREADS OFF )
set ( LIB_FUZZING_ENGINE OFF )
2023-04-25 18:52:28 +00:00
set ( DYNAMIC_LOADING_LIBACCEL_CONFIG OFF )
2022-04-27 17:54:57 +00:00
function ( GetLibraryVersion _content _outputVar )
2023-04-25 18:52:28 +00:00
string ( REGEX MATCHALL "QPL VERSION (.+) LANGUAGES" VERSION_REGEX "${_content}" )
2022-04-27 17:54:57 +00:00
SET ( ${ _outputVar } ${ CMAKE_MATCH_1 } PARENT_SCOPE )
endfunction ( )
FILE ( READ "${QPL_PROJECT_DIR}/CMakeLists.txt" HEADER_CONTENT )
GetLibraryVersion ( "${HEADER_CONTENT}" QPL_VERSION )
2022-04-27 01:37:38 +00:00
message ( STATUS "Intel QPL version: ${QPL_VERSION}" )
2022-07-06 14:34:22 +00:00
# There are 5 source subdirectories under $QPL_SRC_DIR: isal, c_api, core-sw, middle-layer, c_api.
2023-05-12 13:56:01 +00:00
# Generate 8 library targets: middle_layer_lib, isal, isal_asm, qplcore_px, qplcore_avx512, qplcore_sw_dispatcher, core_iaa, middle_layer_lib.
# Output ch_contrib::qpl by linking with 8 library targets.
2022-07-06 14:34:22 +00:00
2023-05-29 07:43:40 +00:00
# The qpl submodule comes with its own version of isal. It contains code which does not exist in upstream isal. It would be nice to link
# only upstream isal (ch_contrib::isal) but at this point we can't.
2022-04-27 01:37:38 +00:00
include ( "${QPL_PROJECT_DIR}/cmake/CompileOptions.cmake" )
2022-05-05 15:56:11 +00:00
# check nasm compiler
include ( CheckLanguage )
check_language ( ASM_NASM )
if ( NOT CMAKE_ASM_NASM_COMPILER )
2022-12-07 21:41:12 +00:00
message ( FATAL_ERROR "Please install NASM from 'https://www.nasm.us/' because NASM compiler can not be found!" )
2022-05-05 15:56:11 +00:00
endif ( )
2022-04-27 01:37:38 +00:00
# [SUBDIR]isal
enable_language ( ASM_NASM )
set ( ISAL_C_SRC ${ QPL_SRC_DIR } /isal/igzip/adler32_base.c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / h u f f _ c o d e s . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / h u f f t a b l e s _ c . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ b a s e . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / f l a t t e n _ l l . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / e n c o d e _ d f . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ i c f _ b a s e . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ i n f l a t e . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ i c f _ b o d y . c
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c _ b a s e . c
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 6 4 _ b a s e . c )
set ( ISAL_ASM_SRC ${ QPL_SRC_DIR } /isal/igzip/igzip_body.asm
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ g e n _ i c f _ m a p _ l h 1 _ 0 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ g e n _ i c f _ m a p _ l h 1 _ 0 6 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ d e c o d e _ b l o c k _ s t a t e l e s s _ 0 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ f i n i s h . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / e n c o d e _ d f _ 0 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / e n c o d e _ d f _ 0 6 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ d e c o d e _ b l o c k _ s t a t e l e s s _ 0 1 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / p r o c _ h e a p . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ i c f _ b o d y _ h 1 _ g r _ b t . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ i c f _ f i n i s h . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ i n f l a t e _ m u l t i b i n a r y . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ u p d a t e _ h i s t o g r a m _ 0 1 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ u p d a t e _ h i s t o g r a m _ 0 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / r f c 1 9 5 1 _ l o o k u p . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / a d l e r 3 2 _ s s e . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / a d l e r 3 2 _ a v x 2 _ 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ d e f l a t e _ h a s h . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ s e t _ l o n g _ i c f _ f g _ 0 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ s e t _ l o n g _ i c f _ f g _ 0 6 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ m u l t i b i n a r y . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / s t d m a c . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c _ m u l t i b i n a r y . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ g z i p _ r e f l _ b y 8 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ g z i p _ r e f l _ b y 8 _ 0 2 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ g z i p _ r e f l _ b y 1 6 _ 1 0 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i e e e _ 0 1 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i e e e _ 0 2 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i e e e _ b y 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i e e e _ b y 1 6 _ 1 0 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i s c s i _ 0 0 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i s c s i _ 0 1 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i s c s i _ b y 1 6 _ 1 0 . a s m )
# Adding ISA-L library target
add_library ( isal OBJECT ${ ISAL_C_SRC } )
add_library ( isal_asm OBJECT ${ ISAL_ASM_SRC } )
2023-05-12 13:56:01 +00:00
set_property ( GLOBAL APPEND PROPERTY QPL_LIB_DEPS
$ < T A R G E T _ O B J E C T S : i s a l > )
set_property ( GLOBAL APPEND PROPERTY QPL_LIB_DEPS
$ < T A R G E T _ O B J E C T S : i s a l _ a s m > )
2022-04-27 01:37:38 +00:00
# Setting external and internal interfaces for ISA-L library
target_include_directories ( isal
2023-05-12 13:56:01 +00:00
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / i s a l / i n c l u d e >
P R I V A T E $ { Q P L _ S R C _ D I R } / i s a l / i n c l u d e
P U B L I C $ { Q P L _ S R C _ D I R } / i s a l / i g z i p )
set_target_properties ( isal PROPERTIES
C X X _ S T A N D A R D 1 1
C _ S T A N D A R D 9 9 )
2022-04-27 01:37:38 +00:00
target_compile_options ( isal PRIVATE
" $ < $ < C _ C O M P I L E R _ I D : G N U > : $ { Q P L _ L I N U X _ T O O L C H A I N _ R E Q U I R E D _ F L A G S } > "
" $ < $ < C O N F I G : D e b u g > : > "
" $ < $ < C O N F I G : R e l e a s e > : > " )
2023-05-12 13:56:01 +00:00
# AS_FEATURE_LEVEL=10 means "Check SIMD capabilities of the target system at runtime and use up to AVX512 if available".
# HAVE_KNOWS_AVX512 means rely on AVX512 being available on the target system.
2022-12-07 21:41:12 +00:00
target_compile_options ( isal_asm PRIVATE "-I${QPL_SRC_DIR}/isal/include/"
P R I V A T E " - I $ { Q P L _ S R C _ D I R } / i s a l / i g z i p / "
P R I V A T E " - I $ { Q P L _ S R C _ D I R } / i s a l / c r c / "
2023-05-12 13:56:01 +00:00
P R I V A T E " - D H A V E _ A S _ K N O W S _ A V X 5 1 2 "
P R I V A T E " - D A S _ F E A T U R E _ L E V E L = 1 0 "
2022-12-07 21:41:12 +00:00
P R I V A T E " - D Q P L _ L I B " )
2022-07-06 16:19:37 +00:00
2022-07-06 14:34:22 +00:00
# Here must remove "-fno-sanitize=undefined" from COMPILE_OPTIONS.
# Otherwise nasm compiler would fail to proceed due to unrecognition of "-fno-sanitize=undefined"
2022-06-05 18:46:28 +00:00
if ( SANITIZE STREQUAL "undefined" )
get_target_property ( target_options isal_asm COMPILE_OPTIONS )
2022-06-29 02:52:11 +00:00
list ( REMOVE_ITEM target_options "-fno-sanitize=undefined" )
2022-06-05 18:46:28 +00:00
set_property ( TARGET isal_asm PROPERTY COMPILE_OPTIONS ${ target_options } )
endif ( )
2022-04-27 01:37:38 +00:00
target_compile_definitions ( isal PUBLIC
Q P L _ L I B
N D E B U G )
# [SUBDIR]core-sw
2023-05-12 13:56:01 +00:00
# Create set of libraries corresponding to supported platforms for SW fallback which are implemented by AVX512 and non-AVX512 instructions respectively.
2022-07-06 17:26:07 +00:00
# The upper level QPL API will check SIMD capabilities of the target system at runtime and decide to call AVX512 function or non-AVX512 function.
2023-05-12 13:56:01 +00:00
# Hence, here we don't need put ENABLE_AVX512 CMake switch.
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
get_list_of_supported_optimizations ( PLATFORMS_LIST )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
foreach ( PLATFORM_ID IN LISTS PLATFORMS_LIST )
# Find Core Sources
file ( GLOB SOURCES
$ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / c h e c k s u m s / * . c
$ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / f i l t e r i n g / * . c
$ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / o t h e r / * . c
$ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / c o m p r e s s i o n / * . c )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
file ( GLOB DATA_SOURCES
$ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / d a t a / * . c )
2022-07-06 17:26:07 +00:00
2023-05-12 13:56:01 +00:00
# Create library
add_library ( qplcore_ ${ PLATFORM_ID } OBJECT ${ SOURCES } )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
set_property ( GLOBAL APPEND PROPERTY QPL_LIB_DEPS
$ < T A R G E T _ O B J E C T S : q p l c o r e _ $ { P L A T F O R M _ I D } > )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
target_include_directories ( qplcore_ ${ PLATFORM_ID }
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - s w >
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - s w / i n c l u d e >
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / i n c l u d e >
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / c o m p r e s s i o n / i n c l u d e >
P R I V A T E $ < T A R G E T _ P R O P E R T Y : i s a l , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S > )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
set_target_properties ( qplcore_ ${ PLATFORM_ID } PROPERTIES
$ < $ < C _ C O M P I L E R _ I D : G N U > : C _ S T A N D A R D 1 7 > )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
target_compile_options ( qplcore_ ${ PLATFORM_ID }
P R I V A T E $ { Q P L _ L I N U X _ T O O L C H A I N _ R E Q U I R E D _ F L A G S }
P R I V A T E " $ < $ < C O N F I G : D e b u g > : > "
P R I V A T E " $ < $ < C O N F I G : R e l e a s e > : - O 3 ; - D _ F O R T I F Y _ S O U R C E = 2 > " )
2022-07-05 18:08:44 +00:00
2023-05-12 13:56:01 +00:00
# Set specific compiler options and/or definitions based on a platform
if ( ${ PLATFORM_ID } MATCHES "avx512" )
target_compile_definitions ( qplcore_ ${ PLATFORM_ID } PRIVATE PLATFORM=2 )
target_compile_options ( qplcore_ ${ PLATFORM_ID } PRIVATE -march=skylake-avx512 )
else ( ) # Create default px library
target_compile_definitions ( qplcore_ ${ PLATFORM_ID } PRIVATE PLATFORM=0 )
endif ( )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
target_link_libraries ( qplcore_ ${ PLATFORM_ID } isal )
endforeach ( )
2022-04-27 01:37:38 +00:00
#
2023-05-12 13:56:01 +00:00
# Create dispatcher between platforms and auto-generated wrappers
2022-04-27 01:37:38 +00:00
#
2023-05-12 13:56:01 +00:00
file ( GLOB SW_DISPATCHER_SOURCES ${ QPL_SRC_DIR } /core-sw/dispatcher/*.cpp )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
add_library ( qplcore_sw_dispatcher OBJECT ${ SW_DISPATCHER_SOURCES } )
set_property ( GLOBAL APPEND PROPERTY QPL_LIB_DEPS
$ < T A R G E T _ O B J E C T S : q p l c o r e _ s w _ d i s p a t c h e r > )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
target_include_directories ( qplcore_sw_dispatcher
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - s w / d i s p a t c h e r > )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
# Generate kernel wrappers
generate_unpack_kernel_arrays ( ${ QPL_BINARY_DIR } "${PLATFORMS_LIST}" )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
foreach ( PLATFORM_ID IN LISTS PLATFORMS_LIST )
file ( GLOB GENERATED_ ${ PLATFORM_ID } _TABLES_SRC ${ QPL_BINARY_DIR } /generated/ ${ PLATFORM_ID } _*.cpp )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
target_sources ( qplcore_sw_dispatcher PRIVATE ${ GENERATED_${PLATFORM_ID } _TABLES_SRC} )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
# Set specific compiler options and/or definitions based on a platform
if ( ${ PLATFORM_ID } MATCHES "avx512" )
set_source_files_properties ( ${ GENERATED_${PLATFORM_ID } _TABLES_SRC} PROPERTIES COMPILE_DEFINITIONS PLATFORM=2 )
else ( )
set_source_files_properties ( ${ GENERATED_${PLATFORM_ID } _TABLES_SRC} PROPERTIES COMPILE_DEFINITIONS PLATFORM=0 )
endif ( )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
target_include_directories ( qplcore_sw_dispatcher
P U B L I C $ < T A R G E T _ P R O P E R T Y : q p l c o r e _ $ { P L A T F O R M _ I D } , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S > )
endforeach ( )
set_target_properties ( qplcore_sw_dispatcher PROPERTIES CXX_STANDARD 17 )
# w/a for build compatibility with ISAL codebase
target_compile_definitions ( qplcore_sw_dispatcher PUBLIC -DQPL_LIB )
target_compile_options ( qplcore_sw_dispatcher
P R I V A T E $ < $ < C _ C O M P I L E R _ I D : G N U > : $ { Q P L _ L I N U X _ T O O L C H A I N _ R E Q U I R E D _ F L A G S } ;
$ { Q P L _ L I N U X _ T O O L C H A I N _ D Y N A M I C _ L I B R A R Y _ F L A G S } ;
$ < $ < C O N F I G : R e l e a s e > : - O 3 ; - D _ F O R T I F Y _ S O U R C E = 2 > >
P R I V A T E $ < $ < C O M P I L E _ L A N G _ A N D _ I D : C X X , G N U > : $ { Q P L _ L I N U X _ T O O L C H A I N _ C P P _ E M B E D D E D _ F L A G S } > )
2022-04-27 01:37:38 +00:00
# [SUBDIR]core-iaa
file ( GLOB HW_PATH_SRC ${ QPL_SRC_DIR } /core-iaa/sources/aecs/*.c
$ { Q P L _ S R C _ D I R } / c o r e - i a a / s o u r c e s / a e c s / * . c p p
$ { Q P L _ S R C _ D I R } / c o r e - i a a / s o u r c e s / d r i v e r _ l o a d e r / * . c
$ { Q P L _ S R C _ D I R } / c o r e - i a a / s o u r c e s / d r i v e r _ l o a d e r / * . c p p
$ { Q P L _ S R C _ D I R } / c o r e - i a a / s o u r c e s / d e s c r i p t o r s / * . c
$ { Q P L _ S R C _ D I R } / c o r e - i a a / s o u r c e s / d e s c r i p t o r s / * . c p p
$ { Q P L _ S R C _ D I R } / c o r e - i a a / s o u r c e s / b i t _ r e v . c )
# Create library
add_library ( core_iaa OBJECT ${ HW_PATH_SRC } )
2023-05-12 13:56:01 +00:00
set_property ( GLOBAL APPEND PROPERTY QPL_LIB_DEPS
$ < T A R G E T _ O B J E C T S : c o r e _ i a a > )
2022-04-27 01:37:38 +00:00
target_include_directories ( core_iaa
P R I V A T E $ { U U I D _ D I R }
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - i a a / i n c l u d e >
2023-04-25 18:52:28 +00:00
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - i a a / s o u r c e s / i n c l u d e >
P R I V A T E $ < B U I L D _ I N T E R F A C E : $ { Q P L _ P R O J E C T _ D I R } / i n c l u d e > # status.h in own_checkers.h
P R I V A T E $ < B U I L D _ I N T E R F A C E : $ { Q P L _ P R O J E C T _ D I R } / s o u r c e s / c _ a p i > # own_checkers.h
2023-05-12 13:56:01 +00:00
P R I V A T E $ < T A R G E T _ P R O P E R T Y : q p l c o r e _ s w _ d i s p a t c h e r , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S > )
set_target_properties ( core_iaa PROPERTIES
$ < $ < C _ C O M P I L E R _ I D : G N U > : C _ S T A N D A R D 1 7 >
C X X _ S T A N D A R D 1 7 )
2022-04-27 01:37:38 +00:00
target_compile_options ( core_iaa
P R I V A T E $ < $ < C _ C O M P I L E R _ I D : G N U > : $ { Q P L _ L I N U X _ T O O L C H A I N _ R E Q U I R E D _ F L A G S } ;
2022-07-05 18:08:44 +00:00
$ < $ < C O N F I G : R e l e a s e > : - O 3 ; - D _ F O R T I F Y _ S O U R C E = 2 > > )
2022-04-27 01:37:38 +00:00
target_compile_features ( core_iaa PRIVATE c_std_11 )
target_compile_definitions ( core_iaa PRIVATE QPL_BADARG_CHECK
P R I V A T E $ < $ < B O O L : $ { B L O C K _ O N _ F A U L T } > : B L O C K _ O N _ F A U L T _ E N A B L E D >
2023-05-12 13:56:01 +00:00
P R I V A T E $ < $ < B O O L : $ { L O G _ H W _ I N I T } > : L O G _ H W _ I N I T >
P R I V A T E $ < $ < B O O L : $ { D Y N A M I C _ L O A D I N G _ L I B A C C E L _ C O N F I G } > : D Y N A M I C _ L O A D I N G _ L I B A C C E L _ C O N F I G > )
2022-04-27 01:37:38 +00:00
# [SUBDIR]middle-layer
file ( GLOB MIDDLE_LAYER_SRC
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / a n a l y t i c s / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / c _ w r a p p e r / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / c h e c k s u m / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / c o m m o n / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / c o m p r e s s i o n / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / c o m p r e s s i o n / * / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / c o m p r e s s i o n / * / * / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / d i s p a t c h e r / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / o t h e r / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / u t i l / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / i n f l a t e / * . c p p
$ { Q P L _ S R C _ D I R } / c o r e - i a a / s o u r c e s / a c c e l e r a t o r / * . c p p ) # todo
add_library ( middle_layer_lib OBJECT
$ { M I D D L E _ L A Y E R _ S R C } )
2023-05-12 13:56:01 +00:00
set_property ( GLOBAL APPEND PROPERTY QPL_LIB_DEPS
$ < T A R G E T _ O B J E C T S : m i d d l e _ l a y e r _ l i b > )
2022-04-27 01:37:38 +00:00
target_compile_options ( middle_layer_lib
P R I V A T E $ < $ < C _ C O M P I L E R _ I D : G N U > : $ { Q P L _ L I N U X _ T O O L C H A I N _ R E Q U I R E D _ F L A G S } ;
$ { Q P L _ L I N U X _ T O O L C H A I N _ D Y N A M I C _ L I B R A R Y _ F L A G S } ;
$ < $ < C O N F I G : R e l e a s e > : - O 3 ; - D _ F O R T I F Y _ S O U R C E = 2 > >
2022-07-05 18:08:44 +00:00
P R I V A T E $ < $ < C O M P I L E _ L A N G _ A N D _ I D : C X X , G N U > : $ { Q P L _ L I N U X _ T O O L C H A I N _ C P P _ E M B E D D E D _ F L A G S } > )
2022-04-27 01:37:38 +00:00
target_compile_definitions ( middle_layer_lib
2022-04-27 17:54:57 +00:00
P U B L I C Q P L _ V E R S I O N = " $ { Q P L _ V E R S I O N } "
2022-04-27 01:37:38 +00:00
P U B L I C $ < $ < B O O L : $ { L O G _ H W _ I N I T } > : L O G _ H W _ I N I T >
P U B L I C $ < $ < B O O L : $ { E F F I C I E N T _ W A I T } > : Q P L _ E F F I C I E N T _ W A I T >
2023-05-12 13:56:01 +00:00
P U B L I C Q P L _ B A D A R G _ C H E C K
P U B L I C $ < $ < B O O L : $ { D Y N A M I C _ L O A D I N G _ L I B A C C E L _ C O N F I G } > : D Y N A M I C _ L O A D I N G _ L I B A C C E L _ C O N F I G > )
2022-04-27 01:37:38 +00:00
2023-05-12 13:56:01 +00:00
set_target_properties ( middle_layer_lib PROPERTIES CXX_STANDARD 17 )
2022-04-27 01:37:38 +00:00
target_include_directories ( middle_layer_lib
P R I V A T E $ { U U I D _ D I R }
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r >
P U B L I C $ < T A R G E T _ P R O P E R T Y : _ q p l , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S >
2023-05-12 13:56:01 +00:00
P U B L I C $ < T A R G E T _ P R O P E R T Y : q p l c o r e _ s w _ d i s p a t c h e r , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S >
2022-04-27 01:37:38 +00:00
P U B L I C $ < T A R G E T _ P R O P E R T Y : i s a l , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S >
P U B L I C $ < T A R G E T _ P R O P E R T Y : c o r e _ i a a , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S > )
target_compile_definitions ( middle_layer_lib PUBLIC -DQPL_LIB )
2022-07-06 14:34:22 +00:00
# [SUBDIR]c_api
2023-05-29 07:43:40 +00:00
file ( GLOB_RECURSE QPL_C_API_SRC
2022-04-27 01:37:38 +00:00
$ { Q P L _ S R C _ D I R } / c _ a p i / * . c
$ { Q P L _ S R C _ D I R } / c _ a p i / * . c p p )
2023-05-12 13:56:01 +00:00
get_property ( LIB_DEPS GLOBAL PROPERTY QPL_LIB_DEPS )
add_library ( _qpl STATIC ${ QPL_C_API_SRC } ${ LIB_DEPS } )
2022-04-27 01:37:38 +00:00
target_include_directories ( _qpl
2023-05-12 13:56:01 +00:00
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ P R O J E C T _ D I R } / i n c l u d e / > $ < I N S T A L L _ I N T E R F A C E : i n c l u d e >
2022-04-27 01:37:38 +00:00
P R I V A T E $ < T A R G E T _ P R O P E R T Y : m i d d l e _ l a y e r _ l i b , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S >
P R I V A T E $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c _ a p i > )
2023-05-12 13:56:01 +00:00
set_target_properties ( _qpl PROPERTIES
$ < $ < C _ C O M P I L E R _ I D : G N U > : C _ S T A N D A R D 1 7 >
C X X _ S T A N D A R D 1 7 )
2022-04-27 01:37:38 +00:00
target_compile_options ( _qpl
P R I V A T E $ < $ < C _ C O M P I L E R _ I D : G N U > : $ { Q P L _ L I N U X _ T O O L C H A I N _ R E Q U I R E D _ F L A G S } ;
$ { Q P L _ L I N U X _ T O O L C H A I N _ D Y N A M I C _ L I B R A R Y _ F L A G S } ;
$ < $ < C O N F I G : R e l e a s e > : - O 3 ; - D _ F O R T I F Y _ S O U R C E = 2 > >
2022-07-05 18:08:44 +00:00
P R I V A T E $ < $ < C O M P I L E _ L A N G _ A N D _ I D : C X X , G N U > : $ { Q P L _ L I N U X _ T O O L C H A I N _ C P P _ E M B E D D E D _ F L A G S } > )
2022-04-27 01:37:38 +00:00
target_compile_definitions ( _qpl
2022-07-05 18:08:44 +00:00
P R I V A T E - D Q P L _ L I B
P R I V A T E - D Q P L _ B A D A R G _ C H E C K
2023-05-12 13:56:01 +00:00
P R I V A T E $ < $ < B O O L : $ { D Y N A M I C _ L O A D I N G _ L I B A C C E L _ C O N F I G } > : D Y N A M I C _ L O A D I N G _ L I B A C C E L _ C O N F I G >
2022-07-05 18:08:44 +00:00
P U B L I C - D E N A B L E _ Q P L _ C O M P R E S S I O N )
2022-04-26 17:52:35 +00:00
2022-04-27 01:37:38 +00:00
target_link_libraries ( _qpl
2023-05-08 19:20:55 +00:00
P R I V A T E c h _ c o n t r i b : : a c c e l - c o n f i g
2023-05-12 13:56:01 +00:00
P R I V A T E c h _ c o n t r i b : : i s a l )
2022-04-26 17:52:35 +00:00
2023-04-25 18:52:28 +00:00
target_include_directories ( _qpl SYSTEM BEFORE
P U B L I C " $ { Q P L _ P R O J E C T _ D I R } / i n c l u d e "
P U B L I C $ { U U I D _ D I R } )
2023-05-08 19:20:55 +00:00
add_library ( ch_contrib::qpl ALIAS _qpl )