[LLVMdev] Linking to the LLVM shared library

nobled nobled at dreamwidth.org
Sun Aug 22 03:53:17 PDT 2010


Óscar Fuentes <ofv at wanadoo.es> wrote:
> The following message is a courtesy copy of an article
> that has been posted to gmane.comp.compilers.llvm.devel as well.
>
> nobled <nobled at dreamwidth.org> writes:
>
>> The LLVM 2.7 release notes say you can use ./configure --enable-shared
>> to build LLVM as a shared library (libLLVM2.7.so), and the LLVM tools
>> will link against that instead of including the static libraries, so I
>> was wondering:
>>
>> Is there a way to configure LLVM the same way using CMake (so it can
>> work on Windows)?
>
> There is no way right now. It could be easily implemented for MinGW, but
> not for MSVC. The binutils included with MinGW do not require
> __declspec(dllexport/dllimport) for exporting/importing symbols on dlls.
>
> [snip]
Okay, but in the *general* case, how do I configure LLVM that way with
CMake (not necessarily on Windows)? running `cmake -i` never gives any
option that looks like "compile a shared library". Do the ./configure
and cmake ways of compiling not have parity, options-wise?




More information about the llvm-dev mailing list