Changeset 14d3171 in tol


Ignore:
Timestamp:
Oct 2, 2015, 7:12:19 AM (11 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
0064724
Parents:
00fb955
Message:

refs #1866, -fPIC solo se usa en Linux 64 bit

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@6901 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/CMakeLists.txt

    r00fb955 r14d3171  
    11cmake_minimum_required( VERSION 2.8 )
    22project( TOL )
     3
     4#-----------------------------------------------------------------------------
     5#
     6# To fix compilation problem: relocation R_X86_64_32 against `a local symbol' can not be
     7# used when making a shared object; recompile with -fPIC
     8# See http://www.cmake.org/pipermail/cmake/2007-May/014350.html
     9#
     10if( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND NOT WIN32 )
     11  set( NEED_FPIC "-fPIC" )
     12else( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND NOT WIN32 )
     13  unset( NEED_FPIC )
     14endif( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND NOT WIN32 )
    315
    416if( TOL_EXTERNAL_DEVEL_DIR )
    … …  
    7385  #message( STATUS "add_library( ${name} OBJECT ${ARGN} )" )
    7486  if( CMAKE_BUILD_TYPE MATCHES Debug )
    75     # -fstack-protector-all -Wstack-protector -fno-omit-frame-pointer
    76     # versiones recientes de gcc tienen estas opciones que pueden ser utiles: -fsanitize=address -fsanitize=alignment
    77     set_property(TARGET ${name} PROPERTY COMPILE_FLAGS "-fPIC -mno-align-double -Wall")
    78   else( )
    79     set_property(TARGET ${name} PROPERTY COMPILE_FLAGS "-O2 -fPIC -mno-align-double")
    80   endif( )
     87    #set_property(TARGET ${name} PROPERTY COMPILE_FLAGS "-fPIC -Wall")
     88    target_compile_options( ${name} PRIVATE "-Wall" )
     89  endif( CMAKE_BUILD_TYPE MATCHES Debug )
     90  if( NEED_FPIC )
     91    target_compile_options( ${name} PRIVATE "-fPIC" )
     92  endif( NEED_FPIC )
    8193  if( TOL_SUBLIBRARIES STREQUAL "" )
    8294    set( TOL_SUBLIBRARIES $<TARGET_OBJECTS:${name}> CACHE INTERNAL "" )
Note: See TracChangeset for help on using the changeset viewer.