Skip to content

Commit

Permalink
[uwp] Reference desktop VCLibs
Browse files Browse the repository at this point in the history
Fixes #2.
  • Loading branch information
jjonescz committed Jul 29, 2019
1 parent e4e1c08 commit 07da5fb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"LLDB",
"LLVM",
"LLVM's",
"Redistributable",
"TAPI",
"dylib",
"ipasim",
Expand Down
17 changes: 17 additions & 0 deletions deps/crt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,27 @@ symchk .\ucrtbased.dll /s SRV*%CD%\syms*https://msdl.microsoft.com/download/symb

And copied from folder `./syms/` to `./`.

**TODO: Maybe the DLLs should be extracted from the Docker machine instead.**

## Getting LIBs

`ucrtd.lib` is located in
`C:/Program Files (x86)/Windows Kits/10/Lib/10.0.17134.0/ucrt/x86/`. But it
doesn't contain all symbols (e.g., `strrchr`). So, instead, we crafted our own
import library. Inspiration was
[an answer on StackOverflow](https://stackoverflow.com/a/9946390).

## Desktop VCLibs

We are currently using Visual C++ libraries intended for desktop applications.
That is achieved by referencing SDK `Microsoft.VCLibs.Desktop` in
[IpaSimApp](../../src/IpaSimulator/IpaSimApp/IpaSimApp.vcxproj).

We need to do that because only `*_app.dll` versions are available for UWP apps
by default (unless Visual C++ Redistributable is installed). See [issue
#2](https://github.com/ipasimulator/ipasim/issues/2).

Better solution would be to link against the `*_app.dll`s by passing
`-app_platform=uwp` to `VsDevCmd.bat` in [`Dockerfile`](../../Dockerfile).
However, that needs some preparations first, because not all functions we
currently use are available in those `*_app.dll`s.
3 changes: 3 additions & 0 deletions src/IpaSimulator/IpaSimApp/IpaSimApp.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@
<DeploymentContent>false</DeploymentContent>
</Text>
</ItemGroup>
<ItemGroup>
<SDKReference Include="Microsoft.VCLibs.Desktop, Version=14.0" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\Microsoft.Windows.CppWinRT.1.0.190205.2\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.1.0.190205.2\build\native\Microsoft.Windows.CppWinRT.targets')" />
Expand Down

0 comments on commit 07da5fb

Please sign in to comment.