|
| 1 | + |
| 2 | +# Hack until we support globally defining _DEBUG |
| 3 | +if(DBG) |
| 4 | + #add_compile_definitions(_DEBUG) |
| 5 | +endif() |
| 6 | + |
| 7 | +# Generate threaddll.dll |
| 8 | +spec2def(threaddll.dll threaddll.spec) |
| 9 | +add_library(threaddll SHARED |
| 10 | + threaddll.c |
| 11 | + threaddll.def |
| 12 | +) |
| 13 | +set_entrypoint(threaddll DllMain 12) |
| 14 | +if(MSVC) |
| 15 | + target_link_libraries(threaddll runtmchk) |
| 16 | +endif() |
| 17 | +add_importlibs(threaddll ucrtbase kernel32) |
| 18 | + |
| 19 | +# Hacks to make it work with MSVC IDE / MSBUILD |
| 20 | +if(MSVC_IDE) |
| 21 | + if(DBG) |
| 22 | + set(THREADDLL_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/Debug) |
| 23 | + else() |
| 24 | + set(THREADDLL_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/Release) |
| 25 | + endif() |
| 26 | + message(STATUS "threaddll.dll output directory: ${THREADDLL_OUTPUT_DIR}") |
| 27 | + |
| 28 | + set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} /I${THREADDLL_OUTPUT_DIR}") |
| 29 | +endif() |
| 30 | + |
| 31 | +# Hack to replace the old CRT include directory with the UCRT include directory |
| 32 | +get_property(INCLUDE_DIRS DIRECTORY . PROPERTY INCLUDE_DIRECTORIES) |
| 33 | +list(REMOVE_ITEM INCLUDE_DIRS "${REACTOS_SOURCE_DIR}/sdk/include/crt") |
| 34 | +set_property(DIRECTORY . PROPERTY INCLUDE_DIRECTORIES ${INCLUDE_DIRS}) |
| 35 | +include_directories(${REACTOS_SOURCE_DIR}/sdk/include/ucrt) |
| 36 | + |
| 37 | +add_definitions( |
| 38 | + -DUSE_WINE_TODOS |
| 39 | + -D_USE_MATH_DEFINES |
| 40 | + -DWINETEST_USE_DBGSTR_LONGLONG |
| 41 | + -D_finddata64_t=__finddata64_t |
| 42 | +) |
| 43 | + |
| 44 | +list(APPEND SOURCE |
| 45 | + cpp.c |
| 46 | + environ.c |
| 47 | + file.c |
| 48 | + misc.c |
| 49 | + printf.c |
| 50 | + scanf.c |
| 51 | + string.c |
| 52 | + thread.c |
| 53 | + testlist.c |
| 54 | + ucrtbase_winetest.rc |
| 55 | +) |
| 56 | + |
| 57 | +set_source_files_properties(ucrtbase_winetest.rc OBJECT_DEPENDS threaddll) |
| 58 | + |
| 59 | +add_executable(ucrtbase_winetest ${SOURCE}) |
| 60 | +if(NOT MSVC) |
| 61 | + #set_target_properties(ucrtbase_winetest PROPERTIES LINK_FLAGS "-Wl,--major-os-version,6") |
| 62 | + target_compile_options(ucrtbase_winetest PRIVATE -Wno-format) |
| 63 | +endif() |
| 64 | +set_module_type(ucrtbase_winetest win32cui) |
| 65 | + |
| 66 | +target_link_libraries(ucrtbase_winetest wine oldnames ${PSEH_LIB} chkstk) |
| 67 | +if(NOT MSVC) |
| 68 | + # Add this manually here, so it can link to ucrtbase.dll and vcstartup |
| 69 | + target_link_libraries(ucrtbase_winetest -lgcc) |
| 70 | +endif() |
| 71 | + |
| 72 | +add_importlibs(ucrtbase_winetest ucrtbase kernel32 ntdll) |
| 73 | +add_dependencies(ucrtbase_winetest threaddll) |
| 74 | +add_rostests_file(TARGET ucrtbase_winetest) |
0 commit comments