summaryrefslogtreecommitdiffstats
path: root/examples/PrintFunctionNames
diff options
context:
space:
mode:
Diffstat (limited to 'examples/PrintFunctionNames')
-rw-r--r--examples/PrintFunctionNames/CMakeLists.txt7
-rw-r--r--examples/PrintFunctionNames/Makefile6
-rw-r--r--examples/PrintFunctionNames/README.txt10
3 files changed, 17 insertions, 6 deletions
diff --git a/examples/PrintFunctionNames/CMakeLists.txt b/examples/PrintFunctionNames/CMakeLists.txt
index 5ea75db..86793ce 100644
--- a/examples/PrintFunctionNames/CMakeLists.txt
+++ b/examples/PrintFunctionNames/CMakeLists.txt
@@ -1,6 +1,11 @@
set(MODULE TRUE)
-set(LLVM_NO_RTTI 1)
+set( LLVM_USED_LIBS
+ clangFrontend
+ clangAST
+ )
+
+set( LLVM_LINK_COMPONENTS support mc)
add_clang_library(PrintFunctionNames PrintFunctionNames.cpp)
diff --git a/examples/PrintFunctionNames/Makefile b/examples/PrintFunctionNames/Makefile
index 125ac48..23a5305 100644
--- a/examples/PrintFunctionNames/Makefile
+++ b/examples/PrintFunctionNames/Makefile
@@ -18,7 +18,11 @@ EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/PrintFunctionNames.exports
endif
endif
-LINK_LIBS_IN_SHARED = 1
+LINK_LIBS_IN_SHARED = 0
SHARED_LIBRARY = 1
include $(CLANG_LEVEL)/Makefile
+
+ifeq ($(OS),Darwin)
+ LDFLAGS=-Wl,-undefined,dynamic_lookup
+endif
diff --git a/examples/PrintFunctionNames/README.txt b/examples/PrintFunctionNames/README.txt
index 267865c..4c284cd 100644
--- a/examples/PrintFunctionNames/README.txt
+++ b/examples/PrintFunctionNames/README.txt
@@ -1,10 +1,12 @@
This is a simple example demonstrating how to use clang's facility for
providing AST consumers using a plugin.
-You will probably need to build clang so that it exports all symbols (disable
-TOOL_NO_EXPORT in the tools/clang Makefile).
+Build the plugin by running `make` in this directory.
Once the plugin is built, you can run it using:
--
-$ clang -cc1 -load path/to/PrintFunctionNames.so -plugin print-fns some-input-file.c
---
+Linux:
+$ clang -cc1 -load ../../Debug+Asserts/lib/libPrintFunctionNames.so -plugin print-fns some-input-file.c
+
+Mac:
+$ clang -cc1 -load ../../Debug+Asserts/lib/libPrintFunctionNames.dylib -plugin print-fns some-input-file.c
OpenPOWER on IntegriCloud