belangeo / pyo

Python DSP module
GNU Lesser General Public License v3.0
1.28k stars 130 forks source link

Fix vcpkg paths on win32 #258

Closed ultrasound1372 closed 1 year ago

ultrasound1372 commented 1 year ago

This PR allows to build with recent versions of vcpkg, which have changed the location of installed packages. While some packages may still be found in vcpkg\packages\package_triplet\{bin|include|lib}, most are now found in a shared directory vcpkg\installed\triplet\{bin|include|lib}. To accomplish this I define a new possible variable vcpkg_root (default ../vcpkg), which allows me to reach this directory without using extra parent refs. It takes from an environment variable as the other vcpkg variables for easy modification to handle alternate paths. I modified vcpkg_packages_root accordingly.
I also moved the libraries list to be defined in a higher scope, used a python ternary expression to handle liblo, and replaced many instances of libraries += [lib] with libraries.append(lib) for consistency. With these changes, I am now able to build pyo by installing the necessary mingw and vcpkg dependencies, modifying the path variable in the calling terminal, and simply running python setup.py bdist_wheel --use-double with no errors.

belangeo commented 1 year ago

Thank you!