File: multilib.cmake

package info (click to toggle)
tarantool 1.7.2.385.g952d79e-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 21,556 kB
  • ctags: 28,405
  • sloc: ansic: 180,313; cpp: 26,044; sh: 15,513; python: 4,893; makefile: 1,412
file content (25 lines) | stat: -rw-r--r-- 943 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
if(DEFINED MULTILIB)
    return()
endif()

set(_MULTILIB lib)
# Comment from GNUInstallDirs.cmake:
# Override this default 'lib' with 'lib64' iff:
#  - we are on Linux system but NOT cross-compiling
#  - we are NOT on debian
#  - we are on a 64 bits system
# reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
# For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if
# CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu"
if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$" AND
   NOT CMAKE_CROSSCOMPILING)
    if (EXISTS "/etc/debian_version" AND CMAKE_LIBRARY_ARCHITECTURE)
        # Debian
        set(_MULTILIB "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
    elseif(DEFINED CMAKE_SIZEOF_VOID_P AND "${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
        # Not debian, rely on CMAKE_SIZEOF_VOID_P:
        set(_MULTILIB "lib64")
    endif()
endif()

set(MULTILIB "${_MULTILIB}" CACHE PATH "multilib suffix")