https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8043b76e85cc94aeff0a2…
commit 8043b76e85cc94aeff0a23f4fa3b009334304319
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Wed Jul 28 10:18:12 2021 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Wed Aug 4 02:03:07 2021 +0200
[CRT] Improve CMake files
---
sdk/lib/crt/math/math.cmake | 2 +-
sdk/lib/crt/msvcrtex.cmake | 42 +--------------------------------------
sdk/lib/crt/startup/startup.cmake | 14 +++++++++++++
3 files changed, 16 insertions(+), 42 deletions(-)
diff --git a/sdk/lib/crt/math/math.cmake b/sdk/lib/crt/math/math.cmake
index 9bb584d4bc7..7e04dcc503b 100644
--- a/sdk/lib/crt/math/math.cmake
+++ b/sdk/lib/crt/math/math.cmake
@@ -73,6 +73,7 @@ elseif(ARCH STREQUAL "amd64")
elseif(ARCH STREQUAL "arm")
list(APPEND LIBCNTPR_MATH_SOURCE
math/cos.c
+ math/floorf.c
math/sin.c
math/sqrt.c
math/arm/__rt_sdiv.c
@@ -128,7 +129,6 @@ if(NOT ARCH STREQUAL "i386")
math/cos.c
math/coshf.c
math/expf.c
- math/floorf.c
math/fmodf.c
math/log10f.c
math/modff.c
diff --git a/sdk/lib/crt/msvcrtex.cmake b/sdk/lib/crt/msvcrtex.cmake
index 5f9cad1b48f..0ba3ee2aa7e 100644
--- a/sdk/lib/crt/msvcrtex.cmake
+++ b/sdk/lib/crt/msvcrtex.cmake
@@ -2,32 +2,7 @@
include_directories(include/internal/mingw-w64)
list(APPEND MSVCRTEX_SOURCE
- startup/_matherr.c
- startup/crtexe.c
- startup/wcrtexe.c
- startup/crt_handler.c
- startup/crtdll.c
- startup/_newmode.c
- startup/wildcard.c
- startup/tlssup.c
- startup/mingw_helpers.c
- startup/natstart.c
- startup/charmax.c
- startup/atonexit.c
- startup/dllmain.c
- startup/pesect.c
- startup/tlsmcrt.c
- startup/tlsthrd.c
- startup/tlsmthread.c
- startup/cinitexe.c
- startup/gs_support.c
- startup/dll_argv.c
- startup/dllargv.c
- startup/wdllargv.c
- startup/crt0_c.c
- startup/crt0_w.c
- startup/dllentry.c
- startup/reactos.c
+ ${CRT_STARTUP_SOURCE}
misc/dbgrpt.cpp
misc/fltused.c
misc/isblank.c
@@ -35,15 +10,6 @@ list(APPEND MSVCRTEX_SOURCE
misc/ofmt_stub.c
stdio/acrt_iob_func.c)
-if(MSVC)
- list(APPEND MSVCRTEX_SOURCE
- startup/threadSafeInit.c)
-else()
- list(APPEND MSVCRTEX_SOURCE
- startup/pseudo-reloc.c
- startup/pseudo-reloc-list.c)
-endif()
-
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
# Clang performs some optimizations requiring those funtions
list(APPEND MSVCRTEX_SOURCE
@@ -95,12 +61,6 @@ elseif(ARCH STREQUAL "arm")
)
endif()
-if(MSVC)
- list(APPEND MSVCRTEX_SOURCE startup/mscmain.c)
-else()
- list(APPEND MSVCRTEX_SOURCE startup/gccmain.c)
-endif()
-
set_source_files_properties(${MSVCRTEX_ASM_SOURCE} PROPERTIES COMPILE_DEFINITIONS
"_DLL;_MSVCRTEX_")
add_asm_files(msvcrtex_asm ${MSVCRTEX_ASM_SOURCE})
diff --git a/sdk/lib/crt/startup/startup.cmake b/sdk/lib/crt/startup/startup.cmake
index 37577e0e70d..79b1f6f6e76 100644
--- a/sdk/lib/crt/startup/startup.cmake
+++ b/sdk/lib/crt/startup/startup.cmake
@@ -12,6 +12,7 @@ list(APPEND CRT_STARTUP_SOURCE
startup/natstart.c
startup/charmax.c
startup/atonexit.c
+ startup/dllmain.c
startup/pesect.c
startup/tlsmcrt.c
startup/tlsthrd.c
@@ -26,3 +27,16 @@ list(APPEND CRT_STARTUP_SOURCE
startup/dllentry.c
startup/reactos.c
)
+
+if(MSVC)
+ list(APPEND CRT_STARTUP_SOURCE
+ startup/mscmain.c
+ startup/threadSafeInit.c
+ )
+else()
+ list(APPEND CRT_STARTUP_SOURCE
+ startup/gccmain.c
+ startup/pseudo-reloc.c
+ startup/pseudo-reloc-list.c
+ )
+endif()