proxmark3/client/deps/hardnested.cmake

167 lines
6.3 KiB
CMake
Raw Normal View History

2020-05-06 20:45:02 +08:00
add_library(pm3rrg_rdv4_hardnested_nosimd OBJECT
2020-04-16 16:57:53 +08:00
hardnested/hardnested_bf_core.c
hardnested/hardnested_bitarray_core.c)
target_compile_options(pm3rrg_rdv4_hardnested_nosimd PRIVATE -Wall -Werror -O3)
2020-05-06 20:45:02 +08:00
set_property(TARGET pm3rrg_rdv4_hardnested_nosimd PROPERTY POSITION_INDEPENDENT_CODE ON)
2020-04-23 00:58:53 +08:00
2020-05-06 20:45:02 +08:00
target_include_directories(pm3rrg_rdv4_hardnested_nosimd PRIVATE
2020-04-16 16:57:53 +08:00
../../common
2020-08-30 04:54:55 +08:00
../../include
../src)
2020-04-16 16:57:53 +08:00
2022-03-29 23:19:35 +08:00
target_compile_definitions(pm3rrg_rdv4_hardnested_nosimd PRIVATE NOSIMD_BUILD)
2020-04-23 00:58:53 +08:00
## CPU-specific code
## These are mostly for x86-based architectures, which is not useful for many Android devices.
## Mingw platforms: AMD64
set(X86_CPUS x86 x86_64 i686 AMD64)
set(ARM64_CPUS arm64 aarch64)
2023-03-11 00:47:24 +08:00
set(ARM32_CPUS armel armhf armv7-a)
2020-04-16 16:57:53 +08:00
message(STATUS "CMAKE_SYSTEM_PROCESSOR := ${CMAKE_SYSTEM_PROCESSOR}")
if ("${CMAKE_SYSTEM_PROCESSOR}" IN_LIST X86_CPUS)
message(STATUS "Building optimised x86/x86_64 binaries")
2020-04-23 00:58:53 +08:00
2020-05-06 20:45:02 +08:00
target_compile_options(pm3rrg_rdv4_hardnested_nosimd BEFORE PRIVATE
2020-04-16 16:57:53 +08:00
-mno-mmx -mno-sse2 -mno-avx -mno-avx2 -mno-avx512f)
## x86 / MMX
2020-05-06 20:45:02 +08:00
add_library(pm3rrg_rdv4_hardnested_mmx OBJECT
2020-04-16 16:57:53 +08:00
hardnested/hardnested_bf_core.c
hardnested/hardnested_bitarray_core.c)
target_compile_options(pm3rrg_rdv4_hardnested_mmx PRIVATE -Wall -Werror -O3)
2020-05-06 20:45:02 +08:00
target_compile_options(pm3rrg_rdv4_hardnested_mmx BEFORE PRIVATE
2020-04-16 16:57:53 +08:00
-mmmx -mno-sse2 -mno-avx -mno-avx2 -mno-avx512f)
2020-05-06 20:45:02 +08:00
set_property(TARGET pm3rrg_rdv4_hardnested_mmx PROPERTY POSITION_INDEPENDENT_CODE ON)
2020-04-16 16:57:53 +08:00
2020-05-06 20:45:02 +08:00
target_include_directories(pm3rrg_rdv4_hardnested_mmx PRIVATE
2020-04-16 16:57:53 +08:00
../../common
2020-08-30 04:54:55 +08:00
../../include
../src)
2020-04-16 16:57:53 +08:00
## x86 / SSE2
2020-05-06 20:45:02 +08:00
add_library(pm3rrg_rdv4_hardnested_sse2 OBJECT
2020-04-16 16:57:53 +08:00
hardnested/hardnested_bf_core.c
hardnested/hardnested_bitarray_core.c)
target_compile_options(pm3rrg_rdv4_hardnested_sse2 PRIVATE -Wall -Werror -O3)
2020-05-06 20:45:02 +08:00
target_compile_options(pm3rrg_rdv4_hardnested_sse2 BEFORE PRIVATE
2020-04-16 16:57:53 +08:00
-mmmx -msse2 -mno-avx -mno-avx2 -mno-avx512f)
2020-05-06 20:45:02 +08:00
set_property(TARGET pm3rrg_rdv4_hardnested_sse2 PROPERTY POSITION_INDEPENDENT_CODE ON)
2020-04-16 16:57:53 +08:00
2020-05-06 20:45:02 +08:00
target_include_directories(pm3rrg_rdv4_hardnested_sse2 PRIVATE
2020-04-16 16:57:53 +08:00
../../common
2020-08-30 04:54:55 +08:00
../../include
../src)
2020-04-16 16:57:53 +08:00
## x86 / AVX
2020-05-06 20:45:02 +08:00
add_library(pm3rrg_rdv4_hardnested_avx OBJECT
2020-04-16 16:57:53 +08:00
hardnested/hardnested_bf_core.c
hardnested/hardnested_bitarray_core.c)
target_compile_options(pm3rrg_rdv4_hardnested_avx PRIVATE -Wall -Werror -O3)
2020-05-06 20:45:02 +08:00
target_compile_options(pm3rrg_rdv4_hardnested_avx BEFORE PRIVATE
2020-04-16 16:57:53 +08:00
-mmmx -msse2 -mavx -mno-avx2 -mno-avx512f)
2020-05-06 20:45:02 +08:00
set_property(TARGET pm3rrg_rdv4_hardnested_avx PROPERTY POSITION_INDEPENDENT_CODE ON)
2020-04-16 16:57:53 +08:00
2020-05-06 20:45:02 +08:00
target_include_directories(pm3rrg_rdv4_hardnested_avx PRIVATE
2020-04-16 16:57:53 +08:00
../../common
2020-08-30 04:54:55 +08:00
../../include
../src)
2020-04-16 16:57:53 +08:00
## x86 / AVX2
2020-05-06 20:45:02 +08:00
add_library(pm3rrg_rdv4_hardnested_avx2 OBJECT
2020-04-16 16:57:53 +08:00
hardnested/hardnested_bf_core.c
hardnested/hardnested_bitarray_core.c)
target_compile_options(pm3rrg_rdv4_hardnested_avx2 PRIVATE -Wall -Werror -O3)
2020-05-06 20:45:02 +08:00
target_compile_options(pm3rrg_rdv4_hardnested_avx2 BEFORE PRIVATE
2020-04-16 16:57:53 +08:00
-mmmx -msse2 -mavx -mavx2 -mno-avx512f)
2020-05-06 20:45:02 +08:00
set_property(TARGET pm3rrg_rdv4_hardnested_avx2 PROPERTY POSITION_INDEPENDENT_CODE ON)
2020-04-16 16:57:53 +08:00
2020-05-06 20:45:02 +08:00
target_include_directories(pm3rrg_rdv4_hardnested_avx2 PRIVATE
2020-04-16 16:57:53 +08:00
../../common
2020-08-30 04:54:55 +08:00
../../include
../src)
2020-04-16 16:57:53 +08:00
## x86 / AVX512
2020-05-06 20:45:02 +08:00
add_library(pm3rrg_rdv4_hardnested_avx512 OBJECT
2020-04-16 16:57:53 +08:00
hardnested/hardnested_bf_core.c
hardnested/hardnested_bitarray_core.c)
target_compile_options(pm3rrg_rdv4_hardnested_avx512 PRIVATE -Wall -Werror -O3)
2020-05-06 20:45:02 +08:00
target_compile_options(pm3rrg_rdv4_hardnested_avx512 BEFORE PRIVATE
2020-04-16 16:57:53 +08:00
-mmmx -msse2 -mavx -mavx2 -mavx512f)
2020-05-06 20:45:02 +08:00
set_property(TARGET pm3rrg_rdv4_hardnested_avx512 PROPERTY POSITION_INDEPENDENT_CODE ON)
2020-04-16 16:57:53 +08:00
2020-05-06 20:45:02 +08:00
target_include_directories(pm3rrg_rdv4_hardnested_avx512 PRIVATE
2020-04-16 16:57:53 +08:00
../../common
2020-08-30 04:54:55 +08:00
../../include
../src)
2020-04-16 16:57:53 +08:00
set(SIMD_TARGETS
2020-05-06 20:45:02 +08:00
$<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_mmx>
$<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_sse2>
$<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_avx>
$<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_avx2>
$<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_avx512>)
elseif ("${CMAKE_SYSTEM_PROCESSOR}" IN_LIST ARM64_CPUS)
message(STATUS "Building optimised arm64 binaries")
## arm64 / NEON
add_library(pm3rrg_rdv4_hardnested_neon OBJECT
hardnested/hardnested_bf_core.c
hardnested/hardnested_bitarray_core.c)
target_compile_options(pm3rrg_rdv4_hardnested_neon PRIVATE -Wall -Werror -O3)
set_property(TARGET pm3rrg_rdv4_hardnested_neon PROPERTY POSITION_INDEPENDENT_CODE ON)
target_include_directories(pm3rrg_rdv4_hardnested_neon PRIVATE
../../common
../../include
../src)
set(SIMD_TARGETS
$<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_neon>)
elseif ("${CMAKE_SYSTEM_PROCESSOR}" IN_LIST ARM32_CPUS)
message(STATUS "Building optimised arm binaries")
## arm64 / NEON
add_library(pm3rrg_rdv4_hardnested_neon OBJECT
hardnested/hardnested_bf_core.c
hardnested/hardnested_bitarray_core.c)
target_compile_options(pm3rrg_rdv4_hardnested_neon PRIVATE -Wall -Werror -O3)
target_compile_options(pm3rrg_rdv4_hardnested_neon BEFORE PRIVATE
-mfpu=neon)
set_property(TARGET pm3rrg_rdv4_hardnested_neon PROPERTY POSITION_INDEPENDENT_CODE ON)
target_include_directories(pm3rrg_rdv4_hardnested_neon PRIVATE
../../common
../../include
../src)
set(SIMD_TARGETS
$<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_neon>)
2020-04-16 16:57:53 +08:00
else ()
message(STATUS "Not building optimised targets")
set(SIMD_TARGETS)
endif ()
2020-05-06 20:45:02 +08:00
add_library(pm3rrg_rdv4_hardnested STATIC
hardnested/hardnested_bruteforce.c
2020-05-06 20:45:02 +08:00
$<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_nosimd>
2020-04-16 16:57:53 +08:00
${SIMD_TARGETS})
target_compile_options(pm3rrg_rdv4_hardnested PRIVATE -Wall -Werror -O3)
2020-05-06 20:45:02 +08:00
set_property(TARGET pm3rrg_rdv4_hardnested PROPERTY POSITION_INDEPENDENT_CODE ON)
target_include_directories(pm3rrg_rdv4_hardnested PRIVATE
../../common
../../include
../include
../src
jansson)
2020-05-06 20:45:02 +08:00
target_include_directories(pm3rrg_rdv4_hardnested INTERFACE hardnested)