[llvm-dev] cmake: program name prefix?

Neil Henning via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 26 09:04:37 PST 2016


At a guess if you really wanna do this, you could have a parent 
CMakeLists.txt which would include the LLVM CMakeLists.txt, and in the 
parent one you'd want to override add_executable (like in this example 
https://cmake.org/pipermail/cmake/2011-March/043320.html) to change the 
name of the executable target. Your best to do set_target_properties 
with OUTPUT_NAME to do that.

No idea if this works, but I've done similar horrific things in CMake 
before and they tend to work.

Best of luck,

-Neil.

On 26/01/16 16:41, Johnson, Nicholas Paul via llvm-dev wrote:
> Thanks, Chris, for your reply.
>
>> I'm a little curious why you want it.
> We want to use the clang+llvm toolchain for two different targets: x86-64 and our in-house architectures.  We find it useful to compile these targets into separate binaries for a few reasons:
>
> (1) Our targets use different libc implementations (glibc vs newlib) and must be configured with different sysroots.  AFAICT, DEFAULT_SYSROOT is not a target-specific configuration variable.
>
> (2) Whereas our x86 target is vanilla clang/llvm, our in-house target is more experimental.  It's handy to segregate the experimental features, especially for some of our users who just want to use a stable compiler.
>
> and,	
>
> (3) Inertia: this is how we have done it in the past with previous, gcc-based iterations of the toolchain.
>
> Thanks,
> Nick
>
>
>> -----Original Message-----
>> From: cbieneman at apple.com [mailto:cbieneman at apple.com]
>> Sent: Monday, January 25, 2016 12:26 PM
>> To: Johnson, Nicholas Paul
>> Subject: Re: [llvm-dev] cmake: program name prefix?
>>
>> Our current CMake doesn't support that. It could probably be added, but I'm a
>> little curious why you want it. I don't think opt and llc are setup to read their
>> targets from their names, and in general those tools aren't really designed to
>> be shipped as part of a toolchain.
>>
>> _Chris
>>
>> Sent from my iPad
>>
>>> On Jan 19, 2016, at 8:48 AM, Johnson, Nicholas Paul via llvm-dev <llvm-
>> dev at lists.llvm.org> wrote:
>>> Using cmake, is it possible to specify a prefix string to prepended to all
>> installed executable files? For example, the executable file prefix "x86-
>> linux-elf-" would result in executables named "x86-linux-elf-opt", "x86-
>> linux-elf-llc", etc.
>>> Thanks,
>>> Nick Johnson
>>> D. E. Shaw Research
>>>
>>> _______________________________________________
>>> LLVM Developers mailing list
>>> llvm-dev at lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160126/7c507ec4/attachment.html>


More information about the llvm-dev mailing list