Changeset 365 in flair-src for trunk/cmake-modules/GlobalCmakeFlair.cmake


Ignore:
Timestamp:
10/05/20 09:32:31 (4 years ago)
Author:
Sanahuja Guillaume
Message:

change simu apps compilation to avoid problem with mixing host and toolchain libs
(log2@glibc_2.29 error when compiling on ubuntu 20.05 or mint 20)
now compile with host g++ and libs (except filelib, irrlicht, quat, udt and vrpn) for simu apps using the macro: FLAIR_DEMO_HOST_CXX

File:
1 edited

Legend:

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

    r305 r365  
    151151        endforeach()
    152152    endif()
     153
     154endfunction()
     155
     156#create a demo using host cxx and libs
     157#usefull for simulator app when there are graphical lib incompatibilities (eg log2@glibc_2.29)
     158function(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             
     179        endforeach()
     180    endforeach()
     181
     182    FLAIR_DEMO(${ARGV})
    153183
    154184endfunction()
Note: See TracChangeset for help on using the changeset viewer.