xref: /reactos/sdk/lib/crt/math/math.cmake (revision 9393fc32)
1
2list(APPEND LIBCNTPR_MATH_SOURCE
3    math/abs.c
4    math/div.c
5    math/labs.c
6    math/usermatherr.c
7)
8
9if(ARCH STREQUAL "i386")
10    list(APPEND LIBCNTPR_MATH_SOURCE
11        math/i386/ci.c
12        math/i386/cicos.c
13        math/i386/cilog.c
14        math/i386/cipow.c
15        math/i386/cisin.c
16        math/i386/cisqrt.c
17        math/i386/ldexp.c
18    )
19    list(APPEND LIBCNTPR_MATH_ASM_SOURCE
20        math/i386/alldiv_asm.s
21        math/i386/alldvrm_asm.s
22        math/i386/allmul_asm.s
23        math/i386/allrem_asm.s
24        math/i386/allshl_asm.s
25        math/i386/allshr_asm.s
26        math/i386/atan_asm.s
27        math/i386/atan2_asm.s
28        math/i386/aulldiv_asm.s
29        math/i386/aulldvrm_asm.s
30        math/i386/aullrem_asm.s
31        math/i386/aullshr_asm.s
32        math/i386/ceil_asm.s
33        math/i386/cos_asm.s
34        math/i386/fabs_asm.s
35        math/i386/floor_asm.s
36        math/i386/ftol_asm.s
37        math/i386/ftol2_asm.s
38        math/i386/log_asm.s
39        math/i386/log10_asm.s
40        math/i386/pow_asm.s
41        math/i386/sin_asm.s
42        math/i386/sqrt_asm.s
43        math/i386/tan_asm.s
44    )
45    list(APPEND CRT_MATH_ASM_SOURCE
46        math/i386/ceilf.S
47        math/i386/floorf.S
48        math/i386/exp_asm.s
49        math/i386/fmod_asm.s
50        math/i386/fmodf_asm.s
51    )
52elseif(ARCH STREQUAL "amd64")
53    list(APPEND LIBCNTPR_MATH_SOURCE
54        math/cos.c
55        math/sin.c
56    )
57    list(APPEND LIBCNTPR_MATH_ASM_SOURCE
58        math/amd64/atan.S
59        math/amd64/atan2.S
60        math/amd64/ceil.S
61        math/amd64/exp.S
62        math/amd64/fabs.S
63        math/amd64/floor.S
64        math/amd64/floorf.S
65        math/amd64/fmod.S
66        math/amd64/ldexp.S
67        math/amd64/log.S
68        math/amd64/log10.S
69        math/amd64/pow.S
70        math/amd64/sqrt.S
71        math/amd64/tan.S
72    )
73elseif(ARCH STREQUAL "arm")
74    list(APPEND LIBCNTPR_MATH_SOURCE
75        math/cos.c
76        math/floorf.c
77        math/sin.c
78        math/sqrt.c
79        math/arm/__rt_sdiv.c
80        math/arm/__rt_sdiv64_worker.c
81        math/arm/__rt_udiv.c
82        math/arm/__rt_udiv64_worker.c
83        math/arm/__rt_div_worker.h
84        math/arm/__dtoi64.c
85        math/arm/__dtou64.c
86        math/arm/__stoi64.c
87        math/arm/__stou64.c
88        math/arm/__fto64.h
89        math/arm/__i64tod.c
90        math/arm/__u64tod.c
91        math/arm/__i64tos.c
92        math/arm/__u64tos.c
93        math/arm/__64tof.h
94    )
95    list(APPEND CRT_MATH_SOURCE
96        math/fabsf.c
97    )
98    list(APPEND LIBCNTPR_MATH_ASM_SOURCE
99        math/arm/atan.s
100        math/arm/atan2.s
101        math/arm/ceil.s
102        math/arm/exp.s
103        math/arm/fabs.s
104        math/arm/fmod.s
105        math/arm/floor.s
106        math/arm/ldexp.s
107        math/arm/log.s
108        math/arm/log10.s
109        math/arm/pow.s
110        math/arm/tan.s
111        math/arm/__rt_sdiv64.s
112        math/arm/__rt_srsh.s
113        math/arm/__rt_udiv64.s
114    )
115    list(APPEND CRT_MATH_ASM_SOURCE
116        math/arm/_logb.s
117    )
118endif()
119
120if(NOT ARCH STREQUAL "i386")
121    list(APPEND CRT_MATH_SOURCE
122        math/_chgsignf.c
123        math/_copysignf.c
124        math/_hypotf.c
125        math/acosf.c
126        math/asinf.c
127        math/atan2f.c
128        math/atanf.c
129        math/ceilf.c
130        math/cos.c
131        math/coshf.c
132        math/expf.c
133        math/fmodf.c
134        math/log10f.c
135        math/modff.c
136        math/sin.c
137        math/sinhf.c
138        math/sqrtf.c
139        math/tanf.c
140        math/tanhf.c
141        math/stubs.c
142    )
143endif()
144
145list(APPEND CRT_MATH_SOURCE
146    ${LIBCNTPR_MATH_SOURCE}
147    math/acos.c
148    math/adjust.c
149    math/asin.c
150    math/cabs.c
151    math/cosf.c
152    math/cosh.c
153    math/fdivbug.c
154    math/frexp.c
155    math/huge_val.c
156    math/hypot.c
157    math/ieee754/j0_y0.c
158    math/ieee754/j1_y1.c
159    math/ieee754/jn_yn.c
160    math/j0_y0.c
161    math/j1_y1.c
162    math/jn_yn.c
163    math/ldiv.c
164    math/logf.c
165    math/modf.c
166    math/powf.c
167    math/rand.c
168    math/s_modf.c
169    math/sinf.c
170    math/sinh.c
171    math/tanh.c
172)
173
174list(APPEND CRT_MATH_ASM_SOURCE
175    ${LIBCNTPR_MATH_ASM_SOURCE}
176)
177
178list(APPEND LIBCNTPR_MATH_SOURCE
179    math/rand_nt.c
180)
181
182if(ARCH STREQUAL "i386")
183    list(APPEND ATAN2_ASM_SOURCE math/i386/atan2_asm.s)
184elseif(ARCH STREQUAL "amd64")
185    list(APPEND ATAN2_ASM_SOURCE math/amd64/atan2.S)
186elseif(ARCH STREQUAL "arm")
187    list(APPEND ATAN2_ASM_SOURCE math/arm/atan2.s)
188endif()
189
190add_asm_files(atan2_asm ${ATAN2_ASM_SOURCE})
191add_library(atan2 ${atan2_asm})
192set_target_properties(atan2 PROPERTIES LINKER_LANGUAGE "C")
193add_dependencies(atan2 asm)
194