Skip to content

Commit 35bc1e1

Browse files
committed
[CRT] Add crtmath library
1 parent 4866a25 commit 35bc1e1

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

dll/win32/ucrtbase/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ set_entrypoint(ucrtbase __acrt_DllMain 12)
3636
target_link_libraries(ucrtbase
3737
ucrt
3838
ucrtsupport
39+
crtmath
3940
vcruntime
4041
wine
4142
)

sdk/lib/crt/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ include(wine/wine.cmake)
2525
include(wstring/wstring.cmake)
2626

2727
include(crt.cmake)
28+
include(crtmath.cmake)
2829
include(libcntpr.cmake)
2930
include(msvcrtex.cmake)
3031
include(oldnames.cmake)

sdk/lib/crt/crt.cmake

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ list(APPEND CRT_SOURCE
33
${CRT_CONIO_SOURCE}
44
${CRT_DIRECT_SOURCE}
55
${CRT_EXCEPT_SOURCE}
6-
${CRT_FLOAT_SOURCE}
76
locale/locale.c
8-
${CRT_MATH_SOURCE}
97
${CRT_MBSTRING_SOURCE}
108
${CRT_MEM_SOURCE}
119
${CRT_MISC_SOURCE}
@@ -25,8 +23,6 @@ list(APPEND CRT_SOURCE
2523

2624
list(APPEND CRT_ASM_SOURCE
2725
${CRT_EXCEPT_ASM_SOURCE}
28-
${CRT_FLOAT_ASM_SOURCE}
29-
${CRT_MATH_ASM_SOURCE}
3026
${CRT_SETJMP_ASM_SOURCE}
3127
${CRT_STDLIB_ASM_SOURCE}
3228
${CRT_STRING_ASM_SOURCE}
@@ -38,6 +34,7 @@ add_asm_files(crt_asm ${CRT_ASM_SOURCE})
3834

3935
add_library(crt ${CRT_SOURCE} ${crt_asm})
4036
target_link_libraries(crt chkstk ${PSEH_LIB})
37+
target_sources(crt PRIVATE $<TARGET_OBJECTS:crtmath>)
4138
target_compile_definitions(crt
4239
PRIVATE __MINGW_IMPORT=extern
4340
USE_MSVCRT_PREFIX

sdk/lib/crt/crtmath.cmake

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
list(APPEND CRTMATH_SOURCE
3+
${CRT_FLOAT_SOURCE}
4+
${CRT_MATH_SOURCE}
5+
)
6+
7+
list(APPEND CRTMATH_ASM_SOURCE
8+
${CRT_FLOAT_ASM_SOURCE}
9+
${CRT_MATH_ASM_SOURCE}
10+
)
11+
12+
add_asm_files(crtmath_asm ${CRTMATH_ASM_SOURCE})
13+
14+
add_library(crtmath ${CRTMATH_SOURCE} ${crtmath_asm})
15+
target_compile_definitions(crtmath PRIVATE
16+
USE_MSVCRT_PREFIX
17+
__fma3_lib_init=__acrt_initialize_fma3
18+
)
19+
add_dependencies(crtmath psdk asm)

sdk/lib/crt/ucrtsupport.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11

22
list(APPEND UCRTSUPP_SOURCE
3-
${CRT_FLOAT_SOURCE}
4-
${CRT_MATH_SOURCE}
53
misc/amsg.c
64
misc/purecall.c
75
misc/tls.c
@@ -11,8 +9,6 @@ list(APPEND UCRTSUPP_SOURCE
119
)
1210

1311
list(APPEND UCRTSUPP_ASM_SOURCE
14-
${CRT_FLOAT_ASM_SOURCE}
15-
${CRT_MATH_ASM_SOURCE}
1612
${CRT_SETJMP_ASM_SOURCE}
1713
${CRT_WINE_ASM_SOURCE}
1814
)

0 commit comments

Comments
 (0)