[cfe-commits] r105630 - in /cfe/trunk: CMakeLists.txt examples/PrintFunctionNames/CMakeLists.txt examples/clang-interpreter/CMakeLists.txt tools/libclang/CMakeLists.txt
Douglas Gregor
dgregor at apple.com
Tue Jun 8 12:23:49 PDT 2010
Author: dgregor
Date: Tue Jun 8 14:23:49 2010
New Revision: 105630
URL: http://llvm.org/viewvc/llvm-project?rev=105630&view=rev
Log:
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.
Modified:
cfe/trunk/CMakeLists.txt
cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt
cfe/trunk/examples/clang-interpreter/CMakeLists.txt
cfe/trunk/tools/libclang/CMakeLists.txt
Modified: cfe/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=105630&r1=105629&r2=105630&view=diff
==============================================================================
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Tue Jun 8 14:23:49 2010
@@ -41,6 +41,10 @@
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 @@
../../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)
Modified: cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt?rev=105630&r1=105629&r2=105630&view=diff
==============================================================================
--- cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt (original)
+++ cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt Tue Jun 8 14:23:49 2010
@@ -1,26 +1,10 @@
-set(SHARED_LIBRARY TRUE)
+set(MODULE TRUE)
set(LLVM_NO_RTTI 1)
-set(LLVM_USED_LIBS
- clangIndex
- clangFrontend
- clangDriver
- clangSema
- clangAnalysis
- clangAST
- clangParse
- clangLex
- clangBasic)
-
-set( LLVM_LINK_COMPONENTS
- bitreader
- mc
- core
- )
-
add_clang_library(PrintFunctionNames PrintFunctionNames.cpp)
set_target_properties(PrintFunctionNames
PROPERTIES
- LINKER_LANGUAGE CXX)
+ LINKER_LANGUAGE CXX
+ PREFIX "")
Modified: cfe/trunk/examples/clang-interpreter/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/clang-interpreter/CMakeLists.txt?rev=105630&r1=105629&r2=105630&view=diff
==============================================================================
--- cfe/trunk/examples/clang-interpreter/CMakeLists.txt (original)
+++ cfe/trunk/examples/clang-interpreter/CMakeLists.txt Tue Jun 8 14:23:49 2010
@@ -18,8 +18,10 @@
jit
interpreter
nativecodegen
+ asmparser
bitreader
bitwriter
+ codegen
ipo
selectiondag
)
Modified: cfe/trunk/tools/libclang/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CMakeLists.txt?rev=105630&r1=105629&r2=105630&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CMakeLists.txt (original)
+++ cfe/trunk/tools/libclang/CMakeLists.txt Tue Jun 8 14:23:49 2010
@@ -3,8 +3,9 @@
set(LLVM_NO_RTTI 1)
set(LLVM_USED_LIBS
- clangFrontend
+ clangFrontend
clangDriver
+ clangCodeGen
clangSema
clangAnalysis
clangAST
More information about the cfe-commits
mailing list