diff --git a/dll/ntdll/CMakeLists.txt b/dll/ntdll/CMakeLists.txt index 5daf7ae7e1e..065188705f6 100644 --- a/dll/ntdll/CMakeLists.txt +++ b/dll/ntdll/CMakeLists.txt @@ -73,3 +73,8 @@ endif() add_pch(ntdll include/ntdll.h "${PCH_SKIP_SOURCE}") add_dependencies(ntdll ntstatus asm) add_cd_file(TARGET ntdll DESTINATION reactos/system32 NO_CAB FOR all) + +# Newer VS versions link to _ftol2 / _ftoul2_legacy +if(MSVC AND ARCH STREQUAL "i386") + target_link_libraries(libntdll ftol2) +endif() diff --git a/sdk/lib/crt/CMakeLists.txt b/sdk/lib/crt/CMakeLists.txt index 3ade9c84877..6c38c518e56 100644 --- a/sdk/lib/crt/CMakeLists.txt +++ b/sdk/lib/crt/CMakeLists.txt @@ -45,3 +45,12 @@ add_library(user32_wsprintf add_dependencies(user32_wsprintf psdk) target_compile_definitions(user32_wsprintf PRIVATE _USER32_WSPRINTF) + +if(MSVC AND ARCH STREQUAL "i386") + add_asm_files(ftol2_asm + math/i386/ftol2_asm.s + ) + add_library(ftol2 ${ftol2_asm}) + set_target_properties(ftol2 PROPERTIES LINKER_LANGUAGE "C") + add_dependencies(ftol2 asm) +endif()