@@ -115,14 +115,20 @@ endif()
115
115
# Auto-detect C system libraries
116
116
if ("${C_SYSTEM_LIBS} " STREQUAL "AUTO" )
117
117
if ("${TARGET_SYSTEM} " MATCHES "MSVC" )
118
- set (C_SYSTEM_LIBS libvcruntime libcmt)
119
- elseif ("${TARGET_SYSTEM} " MATCHES "Android" )
120
- set (C_SYSTEM_LIBS m c)
121
- elseif ("${TARGET_SYSTEM} " MATCHES "Linux" )
122
- set (C_SYSTEM_LIBS m pthread rt dl)
118
+ set (C_SYSTEM_LIBS libcmt libvcruntime)
119
+ set (C_SYSTEM_LIBS_SHARED msvcrt vcruntime oldnames legacy_stdio_definitions)
123
120
else ()
124
- set (C_SYSTEM_LIBS m pthread)
121
+ if ("${TARGET_SYSTEM} " MATCHES "Android" )
122
+ set (C_SYSTEM_LIBS m c)
123
+ elseif ("${TARGET_SYSTEM} " MATCHES "Linux" )
124
+ set (C_SYSTEM_LIBS m pthread rt dl)
125
+ else ()
126
+ set (C_SYSTEM_LIBS m pthread)
127
+ endif ()
128
+ set (C_SYSTEM_LIBS_SHARED ${C_SYSTEM_LIBS} )
125
129
endif ()
130
+ else ()
131
+ set (C_SYSTEM_LIBS_SHARED ${C_SYSTEM_LIBS} )
126
132
endif ()
127
133
128
134
message (STATUS "-- LDC runtime configuration:" )
@@ -590,7 +596,7 @@ macro(build_runtime_libs druntime_o druntime_bc phobos2_o phobos2_bc c_flags ld_
590
596
# libraries otherwise implicitly added by LDC to make it loadable from
591
597
# C executables.
592
598
if ("${is_shared} " STREQUAL "ON" )
593
- target_link_libraries (druntime-ldc${target_suffix} ${C_SYSTEM_LIBS } )
599
+ target_link_libraries (druntime-ldc${target_suffix} ${C_SYSTEM_LIBS_SHARED } )
594
600
endif ()
595
601
596
602
list (APPEND ${outlist_targets} druntime-ldc${target_suffix} )
@@ -608,7 +614,7 @@ macro(build_runtime_libs druntime_o druntime_bc phobos2_o phobos2_bc c_flags ld_
608
614
# in order to exclude the druntime tests for the Phobos test runner.
609
615
string (REPLACE "-unittest" "" target_suffix_without_unittest "${target_suffix} " )
610
616
target_link_libraries (phobos2-ldc${target_suffix}
611
- druntime-ldc${target_suffix_without_unittest} ${C_SYSTEM_LIBS } )
617
+ druntime-ldc${target_suffix_without_unittest} ${C_SYSTEM_LIBS_SHARED } )
612
618
endif ()
613
619
614
620
list (APPEND ${outlist_targets} phobos2-ldc${target_suffix} )
0 commit comments