Release v4.13441 - midsummer
[RRG-proxmark3.git] / client / deps / hardnested.cmake
blob67be099fa77b22b25d8f412a5062a3d24e3c7d6a
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
11         ../src)
13 ## CPU-specific code
14 ## These are mostly for x86-based architectures, which is not useful for many Android devices.
15 ## Mingw platforms: AMD64
16 set(X86_CPUS x86 x86_64 i686 AMD64)
18 message(STATUS "CMAKE_SYSTEM_PROCESSOR := ${CMAKE_SYSTEM_PROCESSOR}")
20 if ("${CMAKE_SYSTEM_PROCESSOR}" IN_LIST X86_CPUS)
21     message(STATUS "Building optimised x86/x86_64 binaries")
23     target_compile_options(pm3rrg_rdv4_hardnested_nosimd BEFORE PRIVATE
24             -mno-mmx -mno-sse2 -mno-avx -mno-avx2 -mno-avx512f)
26     ## x86 / MMX
27     add_library(pm3rrg_rdv4_hardnested_mmx OBJECT
28             hardnested/hardnested_bf_core.c
29             hardnested/hardnested_bitarray_core.c)
31     target_compile_options(pm3rrg_rdv4_hardnested_mmx PRIVATE -Wall -O3)
32     target_compile_options(pm3rrg_rdv4_hardnested_mmx BEFORE PRIVATE
33             -mmmx -mno-sse2 -mno-avx -mno-avx2 -mno-avx512f)
34     set_property(TARGET pm3rrg_rdv4_hardnested_mmx PROPERTY POSITION_INDEPENDENT_CODE ON)
36     target_include_directories(pm3rrg_rdv4_hardnested_mmx PRIVATE
37             ../../common
38             ../../include
39             ../src)
41     ## x86 / SSE2
42     add_library(pm3rrg_rdv4_hardnested_sse2 OBJECT
43             hardnested/hardnested_bf_core.c
44             hardnested/hardnested_bitarray_core.c)
46     target_compile_options(pm3rrg_rdv4_hardnested_sse2 PRIVATE -Wall -O3)
47     target_compile_options(pm3rrg_rdv4_hardnested_sse2 BEFORE PRIVATE
48             -mmmx -msse2 -mno-avx -mno-avx2 -mno-avx512f)
49     set_property(TARGET pm3rrg_rdv4_hardnested_sse2 PROPERTY POSITION_INDEPENDENT_CODE ON)
51     target_include_directories(pm3rrg_rdv4_hardnested_sse2 PRIVATE
52             ../../common
53             ../../include
54             ../src)
56     ## x86 / AVX
57     add_library(pm3rrg_rdv4_hardnested_avx OBJECT
58             hardnested/hardnested_bf_core.c
59             hardnested/hardnested_bitarray_core.c)
61     target_compile_options(pm3rrg_rdv4_hardnested_avx PRIVATE -Wall -O3)
62     target_compile_options(pm3rrg_rdv4_hardnested_avx BEFORE PRIVATE
63             -mmmx -msse2 -mavx -mno-avx2 -mno-avx512f)
64     set_property(TARGET pm3rrg_rdv4_hardnested_avx PROPERTY POSITION_INDEPENDENT_CODE ON)
66     target_include_directories(pm3rrg_rdv4_hardnested_avx PRIVATE
67             ../../common
68             ../../include
69             ../src)
71     ## x86 / AVX2
72     add_library(pm3rrg_rdv4_hardnested_avx2 OBJECT
73             hardnested/hardnested_bf_core.c
74             hardnested/hardnested_bitarray_core.c)
76     target_compile_options(pm3rrg_rdv4_hardnested_avx2 PRIVATE -Wall -O3)
77     target_compile_options(pm3rrg_rdv4_hardnested_avx2 BEFORE PRIVATE
78             -mmmx -msse2 -mavx -mavx2 -mno-avx512f)
79     set_property(TARGET pm3rrg_rdv4_hardnested_avx2 PROPERTY POSITION_INDEPENDENT_CODE ON)
81     target_include_directories(pm3rrg_rdv4_hardnested_avx2 PRIVATE
82             ../../common
83             ../../include
84             ../src)
86     ## x86 / AVX512
87     add_library(pm3rrg_rdv4_hardnested_avx512 OBJECT
88             hardnested/hardnested_bf_core.c
89             hardnested/hardnested_bitarray_core.c)
91     target_compile_options(pm3rrg_rdv4_hardnested_avx512 PRIVATE -Wall -O3)
92     target_compile_options(pm3rrg_rdv4_hardnested_avx512 BEFORE PRIVATE
93             -mmmx -msse2 -mavx -mavx2 -mavx512f)
94     set_property(TARGET pm3rrg_rdv4_hardnested_avx512 PROPERTY POSITION_INDEPENDENT_CODE ON)
96     target_include_directories(pm3rrg_rdv4_hardnested_avx512 PRIVATE
97             ../../common
98             ../../include
99             ../src)
101     set(SIMD_TARGETS
102             $<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_mmx>
103             $<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_sse2>
104             $<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_avx>
105             $<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_avx2>
106             $<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_avx512>)
107 else ()
108     message(STATUS "Not building optimised targets")
109     set(SIMD_TARGETS)
110 endif ()
112 add_library(pm3rrg_rdv4_hardnested STATIC
113         hardnested/hardnested_bruteforce.c
114         $<TARGET_OBJECTS:pm3rrg_rdv4_hardnested_nosimd>
115         ${SIMD_TARGETS})
116 target_compile_options(pm3rrg_rdv4_hardnested PRIVATE -Wall -O3)
117 set_property(TARGET pm3rrg_rdv4_hardnested PROPERTY POSITION_INDEPENDENT_CODE ON)
118 target_include_directories(pm3rrg_rdv4_hardnested PRIVATE
119         ../../common
120         ../../include
121         ../include
122         ../src
123         jansson)
124 target_include_directories(pm3rrg_rdv4_hardnested INTERFACE hardnested)