зеркало из https://github.com/microsoft/clang.git
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
This commit is contained in:
Родитель
45f5b54d67
Коммит
eb5dc498da
|
@ -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)
|
||||
|
|
|
@ -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 "")
|
||||
|
|
|
@ -18,8 +18,10 @@ set(LLVM_LINK_COMPONENTS
|
|||
jit
|
||||
interpreter
|
||||
nativecodegen
|
||||
asmparser
|
||||
bitreader
|
||||
bitwriter
|
||||
codegen
|
||||
ipo
|
||||
selectiondag
|
||||
)
|
||||
|
|
|
@ -3,8 +3,9 @@ set(SHARED_LIBRARY TRUE)
|
|||
set(LLVM_NO_RTTI 1)
|
||||
|
||||
set(LLVM_USED_LIBS
|
||||
clangFrontend
|
||||
clangFrontend
|
||||
clangDriver
|
||||
clangCodeGen
|
||||
clangSema
|
||||
clangAnalysis
|
||||
clangAST
|
||||
|
|
Загрузка…
Ссылка в новой задаче