diff --git a/docs/building-win-x64.md b/docs/building-win-x64.md index aaa500ade5..570e43bc81 100644 --- a/docs/building-win-x64.md +++ b/docs/building-win-x64.md @@ -36,3 +36,48 @@ Go to ***BuildPath*\\tdesktop\\Telegram** and run * Open ***BuildPath*\\tdesktop\\out\\Telegram.sln** in Visual Studio 2022 * Select Telegram project and press Build > Build Telegram (Debug and Release configurations) * The result AyuGram.exe will be located in **D:\TBuild\tdesktop\out\Debug** (and **Release**) + +If you encounter issue like `error C1090: PDB API call failed, error code '12'` on Release build, apply the following patch in `tdesktop/cmake` folder (via pwsh or manually): + +```diff +@' +diff --git a/options_win.cmake b/options_win.cmake +index c2d66cf..ccceb53 100644 +--- a/options_win.cmake ++++ b/options_win.cmake +@@ -32,6 +32,7 @@ if (MSVC) + /utf-8 + /W4 + /MP # Enable multi process build. ++ /FS + /EHsc # Catch C++ exceptions only, extern C functions never throw a C++ exception. + /w15038 # wrong initialization order + /w14265 # class has virtual functions, but destructor is not virtual +@@ -64,7 +65,7 @@ if (MSVC) + INTERFACE + $<$:/NODEFAULTLIB:LIBCMT> + $<$,$>:/DEBUG:FASTLINK> +- $<$,$>>:$>,ProgramDatabase>,/DEBUG,/DEBUG:NONE>> ++ $<$,$>>:$>>,/DEBUG,/DEBUG:NONE>> + $<$>:/OPT:REF> + /INCREMENTAL:NO + /DEPENDENTLOADFLAG:0x800 +diff --git a/variables.cmake b/variables.cmake +index d6ac6c5..b2f492a 100644 +--- a/variables.cmake ++++ b/variables.cmake +@@ -21,7 +21,9 @@ if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "" +endif() + +set(CMAKE_CXX_SCAN_FOR_MODULES OFF CACHE BOOL "") +-set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase" CACHE STRING "") ++set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT ++ "$<$:ProgramDatabase>$<$:Embedded>" ++ CACHE STRING "" FORCE) +set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>" CACHE STRING "") +option(DESKTOP_APP_TEST_APPS "Build test apps, development only." OFF) +option(DESKTOP_APP_LOTTIE_DISABLE_RECOLORING "Disable recoloring of lottie animations." OFF) +'@ | git -C cmake apply - +```