From eb5dc498da53b50633eb9b19ca43b8988c340f0d Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 8 Jun 2010 19:23:49 +0000 Subject: Teach the PrintFunctionNames example to be a proper module, so that Clang can load it as a plugin. Original fix by Troy D. Straszheim, which I extended with Darwin support. Fixes PR6801. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105630 91177308-0d34-0410-b5e6-96231b3b80d8 --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 1be646dfd2..e366275af9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,10 @@ if (CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings") endif () +if (APPLE) + set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-flat_namespace -Wl,-undefined -Wl,suppress") +endif () + macro(add_clang_library name) set(srcs ${ARGN}) if(MSVC_IDE OR XCODE) @@ -54,7 +58,9 @@ macro(add_clang_library name) ../../include/clang${dir}/*.def) set(srcs ${srcs} ${headers}) endif(MSVC_IDE OR XCODE) - if (SHARED_LIBRARY) + if (MODULE) + set(libkind MODULE) + elseif (SHARED_LIBRARY) set(libkind SHARED) else() set(libkind) -- cgit v1.2.3-18-g5258