summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-06-08 19:23:49 +0000
committerDouglas Gregor <dgregor@apple.com>2010-06-08 19:23:49 +0000
commiteb5dc498da53b50633eb9b19ca43b8988c340f0d (patch)
tree33442f6de69450afdb6f9783df3c1b98aeb4fd75 /CMakeLists.txt
parent45f5b54d67215639ae6585d12df5133e99180c2b (diff)
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
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 7 insertions, 1 deletions
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)