diff tools/llvm-shlib/CMakeLists.txt @ 120:1172e4bd9c6f

update 4.0.0
author mir3636
date Fri, 25 Nov 2016 19:14:25 +0900
parents 7d135dc70f03
children 803732b1fca8
line wrap: on
line diff
--- a/tools/llvm-shlib/CMakeLists.txt	Tue Jan 26 22:56:36 2016 +0900
+++ b/tools/llvm-shlib/CMakeLists.txt	Fri Nov 25 19:14:25 2016 +0900
@@ -2,36 +2,32 @@
 # library is enabled by setting LLVM_BUILD_LLVM_DYLIB=yes on the CMake
 # commandline. By default the shared library only exports the LLVM C API.
 
-add_definitions( -DLLVM_VERSION_INFO=\"${PACKAGE_VERSION}\" )
-
 set(SOURCES
   libllvm.cpp
   )
 
 llvm_map_components_to_libnames(LIB_NAMES ${LLVM_DYLIB_COMPONENTS})
 
-if(LLVM_LINK_LLVM_DYLIB)
-  if(LLVM_DYLIB_EXPORTED_SYMBOL_FILE)
-    message(WARNING "Using LLVM_LINK_LLVM_DYLIB with LLVM_DYLIB_EXPORTED_SYMBOL_FILE may not work. Use at your own risk.")
-  endif()
+if(LLVM_LINK_LLVM_DYLIB AND LLVM_DYLIB_EXPORTED_SYMBOL_FILE)
+  message(WARNING "Using LLVM_LINK_LLVM_DYLIB with LLVM_DYLIB_EXPORTED_SYMBOL_FILE may not work. Use at your own risk.")
+endif()
 
-  # libLLVM.so should not have any dependencies on any other LLVM
-  # shared libraries. When using the "all" pseudo-component,
-  # LLVM_AVAILABLE_LIBS is added to the dependencies, which may
-  # contain shared libraries (e.g. libLTO).
-  #
-  # Also exclude libLLVMTableGen for the following reasons:
-  #  - it is only used by internal *-tblgen utilities;
-  #  - it pollutes the global options space.
-  foreach(lib ${LIB_NAMES})
-    get_target_property(t ${lib} TYPE)
-    if("${lib}" STREQUAL "LLVMTableGen")
-    elseif("x${t}" STREQUAL "xSTATIC_LIBRARY")
-      list(APPEND FILTERED_LIB_NAMES ${lib})
-    endif()
-  endforeach()
-  set(LIB_NAMES ${FILTERED_LIB_NAMES})
-endif()
+# libLLVM.so should not have any dependencies on any other LLVM
+# shared libraries. When using the "all" pseudo-component,
+# LLVM_AVAILABLE_LIBS is added to the dependencies, which may
+# contain shared libraries (e.g. libLTO).
+#
+# Also exclude libLLVMTableGen for the following reasons:
+#  - it is only used by internal *-tblgen utilities;
+#  - it pollutes the global options space.
+foreach(lib ${LIB_NAMES})
+  get_target_property(t ${lib} TYPE)
+  if("${lib}" STREQUAL "LLVMTableGen")
+  elseif("x${t}" STREQUAL "xSTATIC_LIBRARY")
+    list(APPEND FILTERED_LIB_NAMES ${lib})
+  endif()
+endforeach()
+set(LIB_NAMES ${FILTERED_LIB_NAMES})
 
 if(LLVM_DYLIB_EXPORTED_SYMBOL_FILE)
   set(LLVM_EXPORTED_SYMBOL_FILE ${LLVM_DYLIB_EXPORTED_SYMBOL_FILE})
@@ -41,7 +37,7 @@
 add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${SOURCES})
 
 list(REMOVE_DUPLICATES LIB_NAMES)
-if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") # FIXME: It should be "GNU ld for elf"
+if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR MINGW) # FIXME: It should be "GNU ld for elf"
   # GNU ld doesn't resolve symbols in the version script.
   set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive)
 elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")