Replies: 4 comments 2 replies
-
I would just add simple scenarios that I would expect
I'm really frustrated about this, because I don't want to write scripts that generate vcpkg triplets to just add a "chained" toolchain file into these triplets... and even if I manage to actually generate these files, the chained toolchain files are missing stuff, because the only thing I want to just override the compiler and let cmake handle the rest. So to be honest, I don't want to generate triplets and toolchains, why should that be necessary if the only thing I want to do is to change a compiler? I consider this broken, because this is totally non-transparent to users that expect |
Beta Was this translation helpful? Give feedback.
-
BTW one additional thing is that:
doesn't work either. Even if I tell |
Beta Was this translation helpful? Give feedback.
-
Other than presented,
fails quickly, logging
However, I wouldn't expect this to work well e.g. for cross builds. Nobody tells cmake when to prefer |
Beta Was this translation helpful? Give feedback.
-
This doesn't work for me on macos - it always uses Apple Clang and not Homebrew clang as I have specified in |
Beta Was this translation helpful? Give feedback.
-
Using vcpkg is pretty simple unless you need to do something like using a non-default compiler. For example if I have a cmake project, I can just set
CC
andCXX
environment variables and when running CMake it will use the compiler as specified by the env vars. This is a common practice in Linux world and most tools would respect these variables.Now... If you have a project with a dependency, and you want to test multiple compilers on your machine, it becomes a nightmare of scripting and trials / errors. The biggest problem is that vcpkg requires you to write custom triplets and cmake toolchains, which requires a lot of scripting and it's frustrating when you hit
vcpkg install
and you get dependencies built with a different C++ compiler, often manifesting at link time.So, I have decided to report this as an issue.
I think that vcpkg should AT LEAST respect the environment variables set. Because I really think that this is a problem. I setup
CC
andCXX
(possibly other env vars as well), runvcpkg install
, and it installs dependencies compiled with a different compiler than cmake would pick when actually configuring the main project.For example on macos the default "Apple Clang" compiler doesn't come with openmp, so packaes that actually use openmp are all broken by design, which means that I cannot install "faiss", for example, because the default compiler cannot compile it.
Is there going to be a "simple" solution to this problem or are we really required to write tons of scripts and toolchains just to get what two environment variables can do? Is there any recommendation of how to do this in a simple and straightforward way? I have two environment variables
CC
andCXX
, and I want vcpkg to use them.Beta Was this translation helpful? Give feedback.
All reactions