Changeset 367 in flair-src


Ignore:
Timestamp:
Nov 9, 2020, 12:38:02 PM (4 years ago)
Author:
Sanahuja Guillaume
Message:

use host cxx only for x86 targets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cmake-modules/GlobalCmakeFlair.cmake

    r366 r367  
    5959    if (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
    6060            if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
    61                     ADD_DEFINITIONS("-std=c++11 -fPIE")
     61                    ADD_DEFINITIONS("-std=c++11")
    6262            else()
    63                     ADD_DEFINITIONS("-std=c++0x -fPIE")
     63                    ADD_DEFINITIONS("-std=c++0x")
    6464            endif()
    6565    else()
    6666            message(STATUS "GCC version < 4.3, c+11 is not supported!")
     67    endif()
     68
     69    if("${CMAKE_SYSTEM_PROCESSOR_DEFAULTTUNE}" MATCHES "core2-64")     
     70        ADD_DEFINITIONS("-fPIE")
    6771    endif()
    6872
     
    157161#usefull for simulator app when there are graphical lib incompatibilities (eg log2@glibc_2.29)
    158162function(FLAIR_DEMO_HOST_CXX PROJECT_NAME SRC_FILES)
    159    
    160     set(CMAKE_CXX_FLAGS "" PARENT_SCOPE)
    161     set(CMAKE_CXX_COMPILER "g++" PARENT_SCOPE)
    162     set(CMAKE_CXX_LINK_FLAGS "-Wl,-unresolved-symbols=ignore-in-shared-libs -Wl,-rpath=/home/gsanahuj/flair/flair-install/lib/${ARCH_DIR}/ -Wl,--disable-new-dtags" PARENT_SCOPE)
    163     ADD_DEFINITIONS("-D_GLIBCXX_USE_CXX11_ABI=0")
    164 
    165     set(LIB_LIST libudt libvrpn libFileLib libIrrlicht libquat)
    166 
    167     foreach(LIB_NAME IN LISTS LIB_LIST) #all libs
    168         FILE(GLOB LIB_FILES "${CMAKE_SYSROOT}/usr/lib/${LIB_NAME}*")
    169         foreach(item IN LISTS LIB_FILES) #all files and symlinks of a lib
    170             get_filename_component(filename ${item} NAME)             
    171             INSTALL(CODE "
    172                     if (NOT EXISTS \"$ENV{FLAIR_ROOT}/flair-install/lib/${ARCH_DIR}/${filename}\")
    173                         file(INSTALL \"${item}\" DESTINATION \"$ENV{FLAIR_ROOT}/flair-install/lib/${ARCH_DIR}\" USE_SOURCE_PERMISSIONS)
    174                     else()
    175                         message(\"-- Not installing \" $ENV{FLAIR_ROOT} \"/flair-install/lib/\" ${ARCH_DIR} \"/\" ${filename} \" (file already exists)\")
    176                     endif()
    177                 ")
    178              
     163    if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i686" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i586" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64")
     164
     165        set(CMAKE_CXX_FLAGS "" PARENT_SCOPE)
     166        set(CMAKE_CXX_COMPILER "g++" PARENT_SCOPE)
     167        set(CMAKE_CXX_LINK_FLAGS "-Wl,-unresolved-symbols=ignore-in-shared-libs -Wl,-rpath=/home/gsanahuj/flair/flair-install/lib/${ARCH_DIR}/ -Wl,--disable-new-dtags" PARENT_SCOPE)
     168        ADD_DEFINITIONS("-D_GLIBCXX_USE_CXX11_ABI=0")
     169
     170        set(LIB_LIST libudt libvrpn libFileLib libIrrlicht libquat)
     171
     172        foreach(LIB_NAME IN LISTS LIB_LIST) #all libs
     173            FILE(GLOB LIB_FILES "${CMAKE_SYSROOT}/usr/lib/${LIB_NAME}*")
     174            foreach(item IN LISTS LIB_FILES) #all files and symlinks of a lib
     175                get_filename_component(filename ${item} NAME)             
     176                INSTALL(CODE "
     177                        if (NOT EXISTS \"$ENV{FLAIR_ROOT}/flair-install/lib/${ARCH_DIR}/${filename}\")
     178                            file(INSTALL \"${item}\" DESTINATION \"$ENV{FLAIR_ROOT}/flair-install/lib/${ARCH_DIR}\" USE_SOURCE_PERMISSIONS)
     179                        else()
     180                            message(\"-- Not installing \" $ENV{FLAIR_ROOT} \"/flair-install/lib/\" ${ARCH_DIR} \"/\" ${filename} \" (file already exists)\")
     181                        endif()
     182                    ")
     183                 
     184            endforeach()
    179185        endforeach()
    180     endforeach()
    181 
    182     FLAIR_DEMO(${ARGV})
     186
     187        FLAIR_DEMO(${ARGV})
     188    else()
     189        warn("${PROJECT_NAME} will not be built for ${CMAKE_SYSTEM_PROCESSOR} architecture")
     190    endif()
    183191
    184192endfunction()
Note: See TracChangeset for help on using the changeset viewer.