summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2014-01-23 15:33:44 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2014-01-23 15:33:44 +0000
commitac3ff26885b33af7b010f86c6fb80b7122c0351c (patch)
treea906373c8f78f1e5cb7998c456d2cbb7244c73c7
parent53831132963a8817aac43f321196f75037ffb779 (diff)
downloadbcm5719-llvm-ac3ff26885b33af7b010f86c6fb80b7122c0351c.tar.gz
bcm5719-llvm-ac3ff26885b33af7b010f86c6fb80b7122c0351c.zip
[CMake] Parameterize MODULE and SHARED in add_clang_library().
llvm-svn: 199902
-rw-r--r--clang/CMakeLists.txt9
-rw-r--r--clang/examples/PrintFunctionNames/CMakeLists.txt4
-rw-r--r--clang/examples/analyzer-plugin/CMakeLists.txt4
-rw-r--r--clang/tools/libclang/CMakeLists.txt3
4 files changed, 8 insertions, 12 deletions
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index efeda29500f..dcd65fd9e01 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -275,7 +275,8 @@ function(clang_tablegen)
endfunction(clang_tablegen)
macro(add_clang_library name)
- llvm_process_sources(srcs ${ARGN})
+ cmake_parse_arguments(ARG "MODULE;SHARED;STATIC" "" "" ${ARGN})
+ llvm_process_sources(srcs ${ARG_UNPARSED_ARGUMENTS})
if(MSVC_IDE OR XCODE)
# Add public headers
file(RELATIVE_PATH lib_path
@@ -298,9 +299,9 @@ macro(add_clang_library name)
set(srcs ${srcs} ${headers} ${tds})
endif()
endif(MSVC_IDE OR XCODE)
- if (MODULE)
+ if (ARG_MODULE)
set(libkind MODULE)
- elseif (SHARED_LIBRARY)
+ elseif (ARG_SHARED)
set(libkind SHARED)
else()
set(libkind)
@@ -316,7 +317,7 @@ macro(add_clang_library name)
target_link_libraries( ${name} ${LLVM_COMMON_LIBS} )
link_system_libs( ${name} )
- if ((SHARED_LIBRARY OR MODULE) AND LLVM_EXPORTED_SYMBOL_FILE)
+ if ((ARG_SHARED OR ARG_MODULE) AND LLVM_EXPORTED_SYMBOL_FILE)
add_llvm_symbol_exports( ${name} ${LLVM_EXPORTED_SYMBOL_FILE} )
endif()
diff --git a/clang/examples/PrintFunctionNames/CMakeLists.txt b/clang/examples/PrintFunctionNames/CMakeLists.txt
index 4954d146e27..cd88f973f5e 100644
--- a/clang/examples/PrintFunctionNames/CMakeLists.txt
+++ b/clang/examples/PrintFunctionNames/CMakeLists.txt
@@ -1,5 +1,3 @@
-set(MODULE TRUE)
-
set( LLVM_LINK_COMPONENTS
Support
)
@@ -15,7 +13,7 @@ if( NOT WIN32 ) # Win32 mangles symbols differently, and
endif()
endif()
-add_clang_library(PrintFunctionNames PrintFunctionNames.cpp)
+add_clang_library(PrintFunctionNames MODULE PrintFunctionNames.cpp)
add_dependencies(PrintFunctionNames
ClangAttrClasses
diff --git a/clang/examples/analyzer-plugin/CMakeLists.txt b/clang/examples/analyzer-plugin/CMakeLists.txt
index fa8c4fcb320..9984880b2eb 100644
--- a/clang/examples/analyzer-plugin/CMakeLists.txt
+++ b/clang/examples/analyzer-plugin/CMakeLists.txt
@@ -1,10 +1,8 @@
-set(MODULE TRUE)
-
set(LLVM_LINK_COMPONENTS
Support
)
-add_clang_library(SampleAnalyzerPlugin MainCallChecker.cpp)
+add_clang_library(SampleAnalyzerPlugin MODULE MainCallChecker.cpp)
add_dependencies(SampleAnalyzerPlugin
ClangAttrClasses
diff --git a/clang/tools/libclang/CMakeLists.txt b/clang/tools/libclang/CMakeLists.txt
index d5b1314a281..edf5ad04bac 100644
--- a/clang/tools/libclang/CMakeLists.txt
+++ b/clang/tools/libclang/CMakeLists.txt
@@ -73,8 +73,7 @@ if(MSVC)
endif()
if( LLVM_ENABLE_PIC )
- set(SHARED_LIBRARY TRUE)
- add_clang_library(libclang ${SOURCES})
+ add_clang_library(libclang SHARED ${SOURCES})
target_link_libraries(libclang ${LIBRARIES})
add_dependencies(libclang ${GENERATED_HEADERS} clang-headers)
OpenPOWER on IntegriCloud