[llvm-commits] [llvm] r58677 - in /llvm/trunk: CMakeLists.txt cmake/modules/AddPartiallyLinkedObject.cmake
Oscar Fuentes
ofv at wanadoo.es
Mon Nov 3 19:27:28 PST 2008
Author: ofv
Date: Mon Nov 3 21:27:24 2008
New Revision: 58677
URL: http://llvm.org/viewvc/llvm-project?rev=58677&view=rev
Log:
CMake: Support for building 32 bit mode libs and binaries on
Linux/x86-64.
Modified:
llvm/trunk/CMakeLists.txt
llvm/trunk/cmake/modules/AddPartiallyLinkedObject.cmake
Modified: llvm/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=58677&r1=58676&r2=58677&view=diff
==============================================================================
--- llvm/trunk/CMakeLists.txt (original)
+++ llvm/trunk/CMakeLists.txt Mon Nov 3 21:27:24 2008
@@ -73,6 +73,21 @@
add_definitions( -D__STDC_LIMIT_MACROS )
add_definitions( -D__STDC_CONSTANT_MACROS )
+set(LLVM_PLO_FLAGS "" CACHE
+ STRING "Flags for creating partially linked objects.")
+
+if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
+ # TODO: support other platforms and toolchains.
+ option(BUILD_32_BITS "Build 32 bits executables and libraries." OFF)
+ if( BUILD_32_BITS )
+ message(STATUS "Building 32 bits executables and libraries.")
+ add_definitions( -m32 )
+ set( CMAKE_EXE_LINKER_FLAGS "-m32 ${CMAKE_EXE_LINKER_FLAGS}" )
+ set( CMAKE_LINK_LIBRARY_FLAG "-m32 ${CMAKE_LINK_LIBRARY_FLAG}" )
+ set( LLVM_PLO_FLAGS -melf_i386 ${LLVM_PLO_FLAGS} )
+ endif( BUILD_32_BITS )
+endif( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
+
if( MSVC )
add_definitions( -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS )
add_definitions( -D_SCL_SECURE_NO_WARNINGS -DCRT_NONSTDC_NO_WARNINGS )
Modified: llvm/trunk/cmake/modules/AddPartiallyLinkedObject.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddPartiallyLinkedObject.cmake?rev=58677&r1=58676&r2=58677&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddPartiallyLinkedObject.cmake (original)
+++ llvm/trunk/cmake/modules/AddPartiallyLinkedObject.cmake Mon Nov 3 21:27:24 2008
@@ -24,7 +24,7 @@
DEPENDS ${lib}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/temp_lib
COMMAND ar x ${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}
- COMMAND ld -r *${CMAKE_CXX_OUTPUT_EXTENSION} -o ${pll}
+ COMMAND ld "${LLVM_PLO_FLAGS}" -r "*${CMAKE_CXX_OUTPUT_EXTENSION}" -o ${pll}
COMMAND rm -f *${CMAKE_CXX_OUTPUT_EXTENSION}
)
target_name_of_partially_linked_object(${lib} tnplo)
More information about the llvm-commits
mailing list