Release v4.9237 - Ice Coffee :coffee:
[RRG-proxmark3.git] / client / deps / hardnested.cmake
blob612265de05525ef947638a287f790cff0c803aba
1 add_library(pm3rrg_rdv4_hardnested_nosimd OBJECT
2         hardnested/hardnested_bf_core.c
3         hardnested/hardnested_bitarray_core.c)
5 target_compile_options(pm3rrg_rdv4_hardnested_nosimd PRIVATE -Wall -O3)
6 set_property(TARGET pm3rrg_rdv4_hardnested_nosimd PROPERTY POSITION_INDEPENDENT_CODE ON)
8 target_include_directories(pm3rrg_rdv4_hardnested_nosimd PRIVATE
9         ../../common
10         ../../include)
12 ## CPU-specific code
13 ## These are mostly for x86-based architectures, which is not useful for many Android devices.
14 ## Mingw platforms: AMD64
15 set(X86_CPUS x86 x86_64 i686 AMD64)
17 message(STATUS "CMAKE_SYSTEM_PROCESSOR := ${CMAKE_SYSTEM_PROCESSOR}")
19 if ("${CMAKE_SYSTEM_PROCESSOR}" IN_LIST X86_CPUS)
20     message(STATUS "Building optimised x86/x86_64 binaries")
22     target_compile_options(pm3rrg_rdv4_hardnested_nosimd BEFORE PRIVATE
23             -mno-mmx -mno-sse2 -mno-avx -mno-avx2 -mno-avx512f)
25     ## x86 / MMX
26     add_library(pm3rrg_rdv4_hardnested_mmx OBJECT
27             hardnested/hardnested_bf_core.c
28             hardnested/hardnested_bitarray_core.c)
30     target_compile_options(pm3rrg_rdv4_hardnested_mmx PRIVATE -Wall -O3)
31     target_compile_options(pm3rrg_rdv4_hardnested_mmx BEFORE PRIVATE
32             -mmmx -mno-sse2 -mno-avx -mno-avx2 -mno-avx512f)
33     set_property(TARGET pm3rrg_rdv4_hardnested_mmx PROPERTY POSITION_INDEPENDENT_CODE ON)
35     target_include_directories(pm3rrg_rdv4_hardnested_mmx PRIVATE
36             ../../common
37             ../../include)
39     ## x86 / SSE2
40     add_library(pm3rrg_rdv4_hardnested_sse2 OBJECT
41             hardnested/hardnested_bf_core.c
42             hardnested/hardnested_bitarray_core.c)
44     target_compile_options(pm3rrg_rdv4_hardnested_sse2 PRIVATE -Wall -O3)
45     target_compile_options(pm3rrg_rdv4_hardnested_sse2 BEFORE PRIVATE
46             -mmmx -msse2 -mno-avx -mno-avx2 -mno-avx512f)
47     set_property(TARGET pm3rrg_rdv4_hardnested_sse2 PROPERTY POSITION_INDEPENDENT_CODE ON)
49     target_include_directories(pm3rrg_rdv4_hardnested_sse2 PRIVATE
50             ../../common
51             ../../include)
53     ## x86 / AVX
54     add_library(pm3rrg_rdv4_hardnested_avx OBJECT
55             hardnested/hardnested_bf_core.c
56             hardnested/hardnested_bitarray_core.c)
58     target_compile_options(pm3rrg_rdv4_hardnested_avx PRIVATE -Wall -O3)
59     target_compile_options(pm3rrg_rdv4_hardnested_avx BEFORE PRIVATE
60             -mmmx -msse2 -mavx -mno-avx2 -mno-avx512f)
61     set_property(TARGET pm3rrg_rdv4_hardnested_avx PROPERTY POSITION_INDEPENDENT_CODE ON)
63     target_include_directories(pm3rrg_rdv4_hardnested_avx PRIVATE
64             ../../common
65             ../../include)
67     ## x86 / AVX2
68     add_library(pm3rrg_rdv4_hardnested_avx2 OBJECT
69             hardnested/hardnested_bf_core.c
70             hardnested/hardnested_bitarray_core.c)
72     target_compile_options(pm3rrg_rdv4_hardnested_avx2 PRIVATE -Wall -O3)
73     target_compile_options(pm3rrg_rdv4_hardnested_avx2 BEFORE PRIVATE
74             -mmmx -msse2 -mavx -mavx2 -mno-avx512f)
75     set_property(TARGET pm3rrg_rdv4_hardnested_avx2 PROPERTY POSITION_INDEPENDENT_CODE ON)
77     target_include_directories(pm3rrg_rdv4_hardnested_avx2 PRIVATE
78             ../../common
79             ../../include)
81     ## x86 / AVX512
82     add_library(pm3rrg_rdv4_hardnested_avx512 OBJECT
83             hardnested/hardnested_bf_core.c
84             hardnested/hardnested_bitarray_core.c)
86     target_compile_options(pm3rrg_rdv4_hardnested_avx512 PRIVATE -Wall -O3)
87     target_compile_options(pm3rrg_rdv4_hardnested_avx512 BEFORE PRIVATE
88             -mmmx -msse2 -mavx -mavx2 -mavx512f)
89     set_property(TARGET pm3rrg_rdv4_hardnested_avx512 PROPERTY POSITION_INDEPENDENT_CODE ON)
91     target_include_directories(pm3rrg_rdv4_hardnested_avx512 PRIVATE
92             ../../common
93             ../../include)
95     set(SIMD_TARGETS
96             $<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_mmx>
97             $<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_sse2>
98             $<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_avx>
99             $<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_avx2>
100             $<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_avx512>)
101 else ()
102     message(STATUS "Not building optimised targets")
103     set(SIMD_TARGETS)
104 endif ()
106 add_library(pm3rrg_rdv4_hardnested STATIC
107         hardnested/hardnested_bruteforce.c
108         $<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_nosimd>
109         ${SIMD_TARGETS})
110 set_property(TARGET pm3rrg_rdv4_hardnested PROPERTY POSITION_INDEPENDENT_CODE ON)
111 target_include_directories(pm3rrg_rdv4_hardnested PRIVATE
112         ../../common
113         ../../include
114         ../src
115         jansson)
116 target_include_directories(pm3rrg_rdv4_hardnested INTERFACE hardnested)