r198176 - Use LLVM_EXPORTED_SYMBOL_FILE in libclang's cmake build.
Nico Weber
nicolasweber at gmx.de
Sun Dec 29 11:31:48 PST 2013
Author: nico
Date: Sun Dec 29 13:31:48 2013
New Revision: 198176
URL: http://llvm.org/viewvc/llvm-project?rev=198176&view=rev
Log:
Use LLVM_EXPORTED_SYMBOL_FILE in libclang's cmake build.
Now the exports file should have an effect on non-darwin too.
Modified:
cfe/trunk/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=198176&r1=198175&r2=198176&view=diff
==============================================================================
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Sun Dec 29 13:31:48 2013
@@ -273,41 +273,6 @@ function(clang_tablegen)
endif()
endfunction(clang_tablegen)
-# FIXME: Generalize and move to llvm.
-function(add_clang_symbol_exports target_name export_file)
- # Makefile.rules contains special cases for different platforms.
- # We restrict ourselves to Darwin for the time being.
- if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- add_custom_command(OUTPUT symbol.exports
- COMMAND sed -e "s/^/_/" < ${export_file} > symbol.exports
- DEPENDS ${export_file}
- VERBATIM
- COMMENT "Creating export file for ${target_name}")
- add_custom_target(${target_name}_exports DEPENDS symbol.exports)
- set_property(DIRECTORY APPEND
- PROPERTY ADDITIONAL_MAKE_CLEAN_FILES symbol.exports)
-
- get_property(srcs TARGET ${target_name} PROPERTY SOURCES)
- foreach(src ${srcs})
- get_filename_component(extension ${src} EXT)
- if(extension STREQUAL ".cpp")
- set(first_source_file ${src})
- break()
- endif()
- endforeach()
-
- # Force re-linking when the exports file changes. Actually, it
- # forces recompilation of the source file. The LINK_DEPENDS target
- # property only works for makefile-based generators.
- set_property(SOURCE ${first_source_file} APPEND PROPERTY
- OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/symbol.exports)
-
- set_property(TARGET ${target_name} APPEND_STRING PROPERTY
- LINK_FLAGS " -Wl,-exported_symbols_list,${CMAKE_CURRENT_BINARY_DIR}/symbol.exports")
- add_dependencies(${target_name} ${target_name}_exports)
- endif()
-endfunction(add_clang_symbol_exports)
-
macro(add_clang_library name)
llvm_process_sources(srcs ${ARGN})
if(MSVC_IDE OR XCODE)
@@ -348,8 +313,8 @@ macro(add_clang_library name)
target_link_libraries( ${name} ${LLVM_COMMON_LIBS} )
link_system_libs( ${name} )
- if (SHARED_LIBRARY AND EXPORTED_SYMBOL_FILE)
- add_clang_symbol_exports( ${name} ${EXPORTED_SYMBOL_FILE} )
+ if (SHARED_LIBRARY AND LLVM_EXPORTED_SYMBOL_FILE)
+ add_llvm_symbol_exports( ${name} ${LLVM_EXPORTED_SYMBOL_FILE} )
endif()
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libclang")
Modified: cfe/trunk/tools/libclang/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CMakeLists.txt?rev=198176&r1=198175&r2=198176&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CMakeLists.txt (original)
+++ cfe/trunk/tools/libclang/CMakeLists.txt Sun Dec 29 13:31:48 2013
@@ -61,7 +61,7 @@ set(GENERATED_HEADERS
ClangStmtNodes
)
-set(EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/libclang.exports)
+set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/libclang.exports)
if( LLVM_ENABLE_PIC )
set(SHARED_LIBRARY TRUE)
More information about the cfe-commits
mailing list