Skip to content

Commit 8c4aff3

Browse files
committed
[CRT] Refactor CMake files
1 parent 3e1454c commit 8c4aff3

File tree

22 files changed

+937
-887
lines changed

22 files changed

+937
-887
lines changed

sdk/lib/crt/CMakeLists.txt

Lines changed: 20 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11

22
include_directories(include)
3+
#include_directories(.)
34

45
add_definitions(-D_CRTBLD)
56

6-
if(ARCH STREQUAL "i386")
7-
list(APPEND CHKSTK_ASM_SOURCE except/i386/chkstk_asm.s)
8-
if(NOT MSVC)
9-
list(APPEND CHKSTK_SOURCE except/i386/chkstk_ms.s)
10-
endif()
11-
elseif(ARCH STREQUAL "amd64")
12-
list(APPEND CHKSTK_ASM_SOURCE except/amd64/chkstk_ms.s)
13-
elseif(ARCH STREQUAL "arm")
14-
list(APPEND CHKSTK_ASM_SOURCE except/arm/chkstk_asm.s)
15-
if(NOT MSVC)
16-
list(APPEND CHKSTK_SOURCE except/arm/chkstk_ms.s)
17-
endif()
18-
elseif(ARCH STREQUAL "powerpc")
19-
list(APPEND CHKSTK_ASM_SOURCE except/powerpc/chkstk_asm.s)
20-
endif()
21-
22-
add_asm_files(chkstk_lib_asm ${CHKSTK_ASM_SOURCE})
23-
add_library(chkstk ${CHKSTK_SOURCE} ${chkstk_lib_asm})
24-
set_target_properties(chkstk PROPERTIES LINKER_LANGUAGE "C")
25-
add_dependencies(chkstk asm)
7+
include(conio/conio.cmake)
8+
include(direct/direct.cmake)
9+
include(except/except.cmake)
10+
include(float/float.cmake)
11+
include(math/math.cmake)
12+
include(mbstring/mbstring.cmake)
13+
include(mem/mem.cmake)
14+
include(misc/misc.cmake)
15+
include(printf/printf.cmake)
16+
include(process/process.cmake)
17+
include(search/search.cmake)
18+
include(setjmp/setjmp.cmake)
19+
include(startup/startup.cmake)
20+
include(stdio/stdio.cmake)
21+
include(stdlib/stdlib.cmake)
22+
include(string/string.cmake)
23+
include(time/time.cmake)
24+
include(wine/wine.cmake)
25+
include(wstring/wstring.cmake)
2626

2727
include(crt.cmake)
2828
include(libcntpr.cmake)
@@ -45,37 +45,3 @@ add_library(user32_wsprintf
4545

4646
add_dependencies(user32_wsprintf psdk)
4747
target_compile_definitions(user32_wsprintf PRIVATE _USER32_WSPRINTF)
48-
49-
add_library(memcmp mem/memcmp.c)
50-
add_dependencies(memcmp psdk)
51-
52-
add_library(getopt misc/getopt.c)
53-
target_compile_definitions(getopt PRIVATE _DLL __USE_CRTIMP)
54-
add_dependencies(getopt psdk)
55-
56-
add_library(strtol
57-
string/ctype.c
58-
string/iswctype.c
59-
string/strtoi64.c
60-
string/strtol.c
61-
string/strtoul.c
62-
string/strtoull.c
63-
string/wctype.c)
64-
target_compile_definitions(strtol PRIVATE _LIBCNT_)
65-
add_dependencies(strtol psdk)
66-
67-
68-
if(ARCH STREQUAL "i386")
69-
list(APPEND ATAN2_ASM_SOURCE math/i386/atan2_asm.s)
70-
elseif(ARCH STREQUAL "amd64")
71-
list(APPEND ATAN2_ASM_SOURCE math/amd64/atan2.S)
72-
elseif(ARCH STREQUAL "arm")
73-
list(APPEND ATAN2_ASM_SOURCE math/arm/atan2.s)
74-
endif()
75-
76-
add_asm_files(atan2_asm ${ATAN2_ASM_SOURCE})
77-
add_library(atan2 ${atan2_asm})
78-
set_target_properties(atan2 PROPERTIES LINKER_LANGUAGE "C")
79-
add_dependencies(atan2 asm)
80-
81-

sdk/lib/crt/conio/conio.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
list(APPEND CRT_CONIO_SOURCE
3+
conio/cgets.c
4+
conio/cputs.c
5+
conio/getch.c
6+
conio/getche.c
7+
conio/kbhit.c
8+
conio/putch.c
9+
conio/ungetch.c
10+
)

0 commit comments

Comments
 (0)