[PATCH] Build llvm-config on Windows/MSVC if sed is present

The attached patch modifies the CMake/LLVMBuild scripts to build llvm-config on Windows if sed is found on the user's PATH. It also teaches LLVMBuild about MSVC library naming so llvm-config will produce the proper lists of library names.

Any comments? Okay to commit?

0001-Build-llvm-config-on-Windows-MSVC-if-sed-is-present.patch (7.9 KB)

Justin Holewinski <jholewinski@nvidia.com> writes:

The attached patch modifies the CMake/LLVMBuild scripts to build
llvm-config on Windows if sed is found on the user's PATH. It also
teaches LLVMBuild about MSVC library naming so llvm-config will
produce the proper lists of library names.

Any comments? Okay to commit?

The presence of sed does not mean that it is usable. Think on a
Cygwinized `sed' while building for MSVC. I'm not sure that on that case
it can handle the pathnames as issued by cmake.

IMO the right fix is to get rid of sed altogether. Cmake has
text-manipulation capabilities that should be enough for the job, IIRC.

[snip]

Justin Holewinski <jholewinski@nvidia.com> writes:

The attached patch modifies the CMake/LLVMBuild scripts to build
llvm-config on Windows if sed is found on the user’s PATH. It also
teaches LLVMBuild about MSVC library naming so llvm-config will
produce the proper lists of library names.

Any comments? Okay to commit?

The presence of sed does not mean that it is usable. Think on a
Cygwinized `sed’ while building for MSVC. I’m not sure that on that case
it can handle the pathnames as issued by cmake.

I’m not sure why it would matter if its cygwin-ized or not. All sed sees are strings, it’s still up to CMake to write out the proper paths to the sed script… am I missing something?

IMO the right fix is to get rid of sed altogether. Cmake has
text-manipulation capabilities that should be enough for the job, IIRC.

Fair enough. I’ll see if I can whip something up.