Reactos
1
2list(APPEND UCRT_STRING_SOURCES
3 string/memcpy_s.cpp
4 string/memicmp.cpp
5 string/strcat_s.cpp
6 string/strcoll.cpp
7 string/strcpy_s.cpp
8 string/strdup.cpp
9 string/stricmp.cpp
10 string/stricoll.cpp
11 string/strlwr.cpp
12 string/strncat_s.cpp
13 string/strncnt.cpp
14 string/strncoll.cpp
15 string/strncpy_s.cpp
16 string/strnicmp.cpp
17 string/strnicol.cpp
18 string/strnlen.cpp
19 string/strnset_s.cpp
20 string/strset_s.cpp
21 string/strtok.cpp
22 string/strtok_s.cpp
23 string/strupr.cpp
24 string/strxfrm.cpp
25 string/wcscat.cpp
26 string/wcscat_s.cpp
27 string/wcscmp.cpp
28 string/wcscoll.cpp
29 string/wcscpy.cpp
30 string/wcscpy_s.cpp
31 string/wcscspn.cpp
32 string/wcsdup.cpp
33 string/wcsicmp.cpp
34 string/wcsicoll.cpp
35 string/wcslwr.cpp
36 string/wcsncat.cpp
37 string/wcsncat_s.cpp
38 string/wcsncmp.cpp
39 string/wcsncnt.cpp
40 string/wcsncoll.cpp
41 string/wcsncpy.cpp
42 string/wcsncpy_s.cpp
43 string/wcsnicmp.cpp
44 string/wcsnicol.cpp
45 string/wcsnset.cpp
46 string/wcsnset_s.cpp
47 string/wcspbrk.cpp
48 string/wcsrev.cpp
49 string/wcsset.cpp
50 string/wcsset_s.cpp
51 string/wcsspn.cpp
52 string/wcstok.cpp
53 string/wcstok_s.cpp
54 string/wcsupr.cpp
55 string/wcsxfrm.cpp
56 string/wmemcpy_s.cpp
57 string/wmemmove_s.cpp
58)
59
60# Special handling for GCC and Clang
61if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
62 list(APPEND UCRT_STRING_SOURCES
63 string/strnlen-avx2.cpp
64 string/strnlen-sse2.cpp
65 )
66
67 set_source_files_properties(string/strnlen-sse2.cpp PROPERTIES COMPILE_OPTIONS "-msse2")
68 set_source_files_properties(string/strnlen-avx2.cpp PROPERTIES COMPILE_OPTIONS "-mavx2")
69endif()
70
71if(${ARCH} STREQUAL "i386")
72 list(APPEND UCRT_STRING_ASM_SOURCES
73 string/i386/_memicmp.s
74 string/i386/_strnicm.s
75 string/i386/memccpy.s
76 string/i386/strcat.s
77 string/i386/strcmp.s
78 string/i386/strcspn.s
79 string/i386/strlen.s
80 string/i386/strncat.s
81 string/i386/strncmp.s
82 string/i386/strncpy.s
83 string/i386/strnset.s
84 string/i386/strpbrk.s
85 string/i386/strrev.s
86 string/i386/strset.s
87 string/i386/strspn.s
88 )
89elseif(${ARCH} STREQUAL "amd64")
90 list(APPEND UCRT_STRING_ASM_SOURCES
91 string/amd64/strcat.s
92 string/amd64/strcmp.s
93 string/amd64/strlen.s
94 string/amd64/strncat.s
95 string/amd64/strncmp.s
96 string/amd64/strncpy.s
97 )
98 list(APPEND UCRT_STRING_SOURCES
99 string/amd64/strcspn.c
100 string/amd64/strpbrk.c
101 string/amd64/strspn.c
102 string/memccpy.c
103 string/strnset.c
104 string/strrev.c
105 string/strset.c
106 )
107else()
108 if(${ARCH} STREQUAL "arm64")
109 list(APPEND UCRT_STRING_ASM_SOURCES
110 string/arm64/strlen.s
111 string/arm64/wcslen.s
112 )
113 else()
114 list(APPEND UCRT_STRING_SOURCES
115 string/arm/strlen.c
116 )
117 endif()
118 list(APPEND UCRT_STRING_SOURCES
119 string/memccpy.c
120 string/strcat.c
121 string/strcmp.c
122 string/strcspn.c
123 string/strncat.c
124 string/strncmp.c
125 string/strncpy.c
126 string/strnset.c
127 string/strpbrk.c
128 string/strrev.c
129 string/strset.c
130 string/strspn.c
131 )
132endif()
133
134add_asm_files(UCRT_STRING_ASM ${UCRT_STRING_ASM_SOURCES})
135list(APPEND UCRT_STRING_SOURCES ${UCRT_STRING_ASM})