File: march-mtune.cmake

package info (click to toggle)
darktable 5.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 64,644 kB
  • sloc: ansic: 367,957; cpp: 102,838; xml: 20,091; lisp: 15,092; sh: 3,767; javascript: 3,264; perl: 1,925; python: 1,551; ruby: 975; makefile: 543; asm: 46; sql: 38; awk: 21
file content (32 lines) | stat: -rw-r--r-- 1,143 bytes parent folder | download | duplicates (3)
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
26
27
28
29
30
31
32
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
  set(MARCH "-msse4.2")
elseif(NOT BINARY_PACKAGE_BUILD AND (NOT APPLE OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang"))
  MESSAGE("-- Checking for -march=native support")
  CHECK_C_COMPILER_FLAG("-march=native" MARCHNATIVE)
  if(MARCHNATIVE)
    set(MARCH "-march=native")
    add_definitions("-DNATIVE_ARCH")
  else()
    MESSAGE("-- Checking for -mtune=native support")
    CHECK_C_COMPILER_FLAG("-mtune=native" MTUNENATIVE)
    if(MTUNENATIVE)
      set(MARCH "-mtune=native")
    else()
      MESSAGE("-- Checking for -mtune=generic support")
      CHECK_C_COMPILER_FLAG("-mtune=generic" MTUNEGENERIC)
      if(MTUNEGENERIC)
        set(MARCH "-mtune=generic")
      else()
        message(WARNING "Do not know which -march/-mtune to pass! Resulting binaries may be broken!")
      endif()
    endif()
  endif()
else()
  MESSAGE("-- Checking for -mtune=generic support")
  CHECK_C_COMPILER_FLAG("-mtune=generic" MTUNEGENERIC)
  if(MTUNEGENERIC)
    set(MARCH "-mtune=generic")
  else()
    message(WARNING "Do not know which -march/-mtune to pass! Resulting binaries may be broken!")
  endif()
endif()