Skip to content
Snippets Groups Projects

Solve linking problem due to ABI change

Merged Antoine Regimbeau requested to merge abi_backward_compatibility into release-6.6
All threads resolved!

Merge request reports

Merged by Antoine RegimbeauAntoine Regimbeau 6 years ago (May 3, 2018 12:23pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Antoine Regimbeau resolved all discussions

    resolved all discussions

  • added 1 commit

    • 754d4be3 - PKG: add the abi compatibility only to UseOTB.cmake's package

    Compare with previous version

  • Rashad Kanavath
  • cat /tmp/bug/CMakeLists.txt
    cmake_minimum_required(VERSION 3.1.0)
    
    foreach(p
        CMP0025 # CMake 3.0
        CMP0042 # CMake 3.0
        CMP0058
        )
      if(POLICY ${p})
        cmake_policy(SET ${p} NEW)
      endif()
    endforeach()
    
    # CMP0046 : from CMake 3.0, old behaviour is more convenient
    if(POLICY CMP0046)
      cmake_policy(SET CMP0046 OLD)
    endif()
    
    # TODO Check if OTB cmake is compatible with CMP0054 NEW policy
    # CMP0054 : New policy introduce in CMake 3.1, keep old behaviour for now
    if(POLICY CMP0054)
      cmake_policy(SET CMP0054 OLD)
    endif()
    
    project(OTB)
    file(APPEND "/tmp/UseOTB.cmake"
      "\n# ABI compatibility
          if ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
            if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.0 )
              add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
            endif()
          endif()" )

    and here we go..

    [/tmp/bug]
    $ ls
    CMakeLists.txt
    [/tmp/bug]
    $ cmake .
    CMake Warning (dev) at CMakeLists.txt:27:
      Syntax Warning in cmake code at column 44
    
      Argument not separated from preceding token by whitespace.
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at CMakeLists.txt:27:
      Syntax Warning in cmake code at column 47
    
      Argument not separated from preceding token by whitespace.
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    -- The C compiler identification is Clang 5.0.1
    -- The CXX compiler identification is Clang 5.0.1
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    ^C
    [/tmp/bug]

    are you getting this error?

    Edited by Rashad Kanavath
  • Yes! But I took it as a gentle warning!!
    I'll change that!

  • Antoine Regimbeau resolved all discussions

    resolved all discussions

  • added 1 commit

    • b27b576a - WRG: syntax correction to avoid warning

    Compare with previous version

  • Do we want to support CMake 2.8? The Software Guide doesn't seem to mention a minimum version.

  • added bug label

  • Please register or sign in to reply
    Loading