Skip to content

Commit c589c3b

Browse files
committed
Revert to dynamic CRT linking (use DLLs)
Reverted changes: - Removed /MT (static CRT) configuration - Back to default /MD (dynamic CRT) behavior - Uses MSVC runtime DLLs as intended DLL Dependencies (as designed): - KERNEL32.dll - Windows API - MSVCP140.dll - C++ Standard Library - VCRUNTIME140.dll - C++ Runtime - api-ms-win-crt-*.dll - Universal CRT (modern replacement for msvcrt.dll) Note: Modern MSVC (2015+) uses UCRT instead of legacy msvcrt.dll. This is normal and requires VC++ Redistributable installation.
1 parent b421edb commit c589c3b

1 file changed

Lines changed: 1 addition & 23 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,10 @@
1-
cmake_minimum_required(VERSION 3.15)
1+
cmake_minimum_required(VERSION 3.10)
22
project(GhostInjector VERSION 1.0.2 LANGUAGES C CXX)
33

4-
# Enable new policy for MSVC runtime library selection
5-
cmake_policy(SET CMP0091 NEW)
6-
74
set(CMAKE_CXX_STANDARD 11)
85
set(CMAKE_CXX_STANDARD_REQUIRED ON)
96
set(CMAKE_CXX_EXTENSIONS OFF)
107

11-
# Use static C/C++ runtime (/MT) instead of dynamic (/MD)
12-
# This embeds the runtime into the executable (no VCRUNTIME/MSVCP DLLs needed)
13-
if(MSVC)
14-
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
15-
16-
# Alternative: Set compiler flags directly for older CMake versions
17-
set(CompilerFlags
18-
CMAKE_CXX_FLAGS
19-
CMAKE_CXX_FLAGS_DEBUG
20-
CMAKE_CXX_FLAGS_RELEASE
21-
CMAKE_C_FLAGS
22-
CMAKE_C_FLAGS_DEBUG
23-
CMAKE_C_FLAGS_RELEASE
24-
)
25-
foreach(CompilerFlag ${CompilerFlags})
26-
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
27-
endforeach()
28-
endif()
29-
308
add_subdirectory(Neptune)
319
add_subdirectory(NThread)
3210
add_subdirectory(NThreadOSUtils)

0 commit comments

Comments
 (0)