[cfe-dev] Clang plugin help
John Brawn via cfe-dev
cfe-dev at lists.llvm.org
Wed Jul 17 04:28:46 PDT 2019
If you're using cmake and Visual Studios on Windows, then you need to:
* Add -DLLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON to the cmake command. Due to
the way dynamic linking works on Windows the symbols that the plugin needs have to
be explicitly exported from clang, and this isn't done by default. (Using
-DBUILD_SHARED_LIBS=ON would be a better solution, but last I checked it didn't
work with Visual Studio.)
* For the example plugins to build you need to make sure you run cmake with
-DCLANG_BUILD_EXAMPLES=ON, as it's off by default.
With that the example plugins should build as part of the default target when running
make. If you see in the cmake output the message "Loadable modules not supported on
this platform" then that means that something has caused plugins to be disabled.
John
From: cfe-dev [mailto:cfe-dev-bounces at lists.llvm.org] On Behalf Of Callum Laird via cfe-dev
Sent: 16 July 2019 09:26
To: cfe-dev at lists.llvm.org
Subject: [cfe-dev] Clang plugin help
Hi all,
I've been trying to get a Clang plugin working for a couple of weeks now on Windows/Visual Studio 2019, and I'm struggling quite a lot. So far, I've followed the instructions on the clang/llvm getting started page, and I've got the Clang complier working for C code in visual studio. I then tried to build one of the example plugins provided (such as PrintFunctionNames) using cmake and later make, but I'm having trouble knowing which file I'm supposed to use and I can't find much in the way of resources/documentation online for windows stuff. Any and all help would be appreciated.
Thanks!
Callum
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190717/15ce7498/attachment.html>
More information about the cfe-dev
mailing list