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
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)
../../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)
-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 "")
jit
interpreter
nativecodegen
+ asmparser
bitreader
bitwriter
+ codegen
ipo
selectiondag
)
set(LLVM_NO_RTTI 1)
set(LLVM_USED_LIBS
- clangFrontend
+ clangFrontend
clangDriver
+ clangCodeGen
clangSema
clangAnalysis
clangAST