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


Ignore:
Timestamp:
Oct 5, 2020, 9:32:31 AM (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

Location:
trunk/cmake-modules
Files:
2 edited

Legend:

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

    r342 r365  
    102102        IF (FLAIR_USE_SIMULATOR_GL)
    103103                ADD_DEFINITIONS("-DGL")
    104                 SET(FLAIR_LIBRARIES ${FLAIR_LIBRARY_DIR}/libFlairSimulator_gl.a GL ${FLAIR_LIBRARIES} Irrlicht Xxf86vm)
     104                SET(FLAIR_LIBRARIES ${FLAIR_LIBRARY_DIR}/libFlairSimulator_gl.a GL ${FLAIR_LIBRARIES} Irrlicht)
    105105        else()
    106106                SET(FLAIR_LIBRARIES ${FLAIR_LIBRARY_DIR}/libFlairSimulator_nogl.a ${FLAIR_LIBRARIES})
  • 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.