Skip to content

Commit 5b633d6

Browse files
committed
[UCRTBASE] Build without debug exports
Windows ships ucrtbase without debug exports and ucrtbased with debug exports. The wine test tests ucrtbase and loads it dynamically in some cases. Compiling it with _DEBUG requires it to be linked to ucrtbased, which causes problems, because it also dynamically loads ucrtbase, which will cause it to crash.
1 parent 6a4dbed commit 5b633d6

File tree

5 files changed

+15
-21
lines changed

5 files changed

+15
-21
lines changed

dll/win32/ucrtbase/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
spec2def(ucrtbase.dll ucrtbase.spec ADD_IMPORTLIB)
2+
spec2def(ucrtbase.dll ucrtbase.spec NO_DBG ADD_IMPORTLIB)
33

44
# Hack to replace the old CRT include directory with the UCRT include directory
55
get_property(INCLUDE_DIRS DIRECTORY . PROPERTY INCLUDE_DIRECTORIES)

sdk/lib/ucrt/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
7777
)
7878
endif()
7979

80-
# Hack until we support globally defining _DEBUG
81-
if(DBG)
82-
add_compile_definitions(_DEBUG)
83-
endif()
84-
8580
include(conio/conio.cmake)
8681
include(convert/convert.cmake)
8782
include(dll/dll.cmake)
@@ -103,6 +98,7 @@ include(stdlib/stdlib.cmake)
10398
include(string/string.cmake)
10499
include(time/time.cmake)
105100

101+
# TODO: build a _DEBUG version
106102
add_library(ucrt OBJECT
107103
${UCRT_CONIO_SOURCES}
108104
${UCRT_CONVERT_SOURCES}

sdk/lib/ucrt/heap/heap.cmake

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ list(APPEND UCRT_HEAP_SOURCES
2020
heap/recalloc.cpp
2121
)
2222

23-
if(DBG)
24-
list(APPEND UCRT_HEAP_SOURCES
25-
heap/debug_heap.cpp
26-
heap/debug_heap_hook.cpp
27-
)
28-
endif()
23+
# Debug sources
24+
list(APPEND UCRTD_HEAP_SOURCES
25+
heap/debug_heap.cpp
26+
heap/debug_heap_hook.cpp
27+
)

sdk/lib/ucrt/misc/misc.cmake

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ list(APPEND UCRT_MISC_SOURCES
2525
misc/_strerr.cpp
2626
)
2727

28-
if(DBG)
29-
list(APPEND UCRT_MISC_SOURCES
30-
misc/dbgrpt.cpp
31-
misc/dbgrptt.cpp
32-
misc/debug_fill_threshold.cpp
33-
)
34-
endif()
28+
# Debug sources
29+
list(APPEND UCRTD_MISC_SOURCES
30+
misc/dbgrpt.cpp
31+
misc/dbgrptt.cpp
32+
misc/debug_fill_threshold.cpp
33+
)

sdk/lib/ucrt/stdlib/stdlib.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ list(APPEND UCRT_STDLIB_SOURCES
2424
)
2525

2626
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
27-
add_asm_files(UCRT_STRING_ASM stdlib/clang-hacks.s)
27+
add_asm_files(UCRT_STDLIB_ASM stdlib/clang-hacks.s)
2828
list(APPEND UCRT_STDLIB_SOURCES
29-
${UCRT_STRING_ASM}
29+
${UCRT_STDLIB_ASM}
3030
)
3131
endif()

0 commit comments

Comments
 (0)