microsoft / DirectX-Headers

Official DirectX headers available under an open source license
https://devblogs.microsoft.com/directx/
MIT License
570 stars 153 forks source link

Fix rpc number bug and create a pkg-config file. #98

Closed JPeterMugaas closed 1 year ago

JPeterMugaas commented 1 year ago

This fixes the two issues that I mentioned in https://github.com/microsoft/DirectX-Headers/issues/97 .

JPeterMugaas commented 1 year ago

@microsoft-github-policy-service agree

walbourn commented 10 months ago

@jenatali This PR causes problems when trying to use this repo as a VCPKG port. This now generates warnings from VCPKG:

warning: There should be no absolute paths, such as the following, in an installed package:
  D:\vcpkg\packages\directx-headers_x64-windows
  D:\vcpkg\installed
  D:\vcpkg\buildtrees\directx-headers
  D:\vcpkg\downloads
Absolute paths were found in the following files:
  D:\vcpkg\packages\directx-headers_x64-windows\debug\lib\pkgconfig\DirectX-Headers.pc
  D:\vcpkg\packages\directx-headers_x64-windows\lib\pkgconfig\DirectX-Headers.pc
error: Found 1 post-build check problem(s). To submit these ports to curated catalogs, please first correct the portfile: D:\vcpkg\ports\directx-headers\portfile.cmake
eli-schwartz commented 10 months ago

@jenatali This PR causes problems when trying to use this repo as a VCPKG port. This now generates warnings from VCPKG:

Can you try building the port with the included meson.build instead?

https://mesonbuild.com/Builtin-options.html#pkgconfig-module

Since 0.63.0 The pkgconfig.relocatable option is used by the pkgconfig module–namely pkg.generate()–and affects how the prefix (not to be confused with the install prefix) in the generated pkgconfig file is set. When it is true, the prefix will be relative to the install_dir-this allows the pkgconfig file to be moved around and still work, as long as the relative path is not broken. In general, this allows for the whole installed package to be placed anywhere on the system and still work as a dependency. When it is set to false, the prefix will be the same as the install prefix.

This is, in general, a hard problem to solve. Outside of vcpkg, for example in Linux distros, it is a bug if the paths are missing the important requirement of being absolute. Meson's generator attempts to cover a wide variety of situations fairly flexibly.