File: c%2B%2Bstd.pri

package info (click to toggle)
openscad 2021.01-8
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 36,012 kB
  • sloc: cpp: 53,199; sh: 4,384; ansic: 4,382; python: 1,813; yacc: 853; javascript: 762; lex: 417; lisp: 163; xml: 127; makefile: 118
file content (43 lines) | stat: -rw-r--r-- 1,219 bytes parent folder | download | duplicates (4)
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
33
34
35
36
37
38
39
40
41
42
43
macx {
  # Mac needs special care to link against the correct C++ library
  # We attempt to auto-detect it by inspecting Boost
  dirs = $${BOOSTDIR} $${QMAKE_LIBDIR}
  for(dir, dirs) {
    system(otool -L $${dir}/libboost_thread*  | grep libc++ >& /dev/null ) {
      message("Using libc++")
      CONFIG += libc++
    }
    else {
      message("Using libstdc++")
      CONFIG += libstdc++
      c++std {
        # libc++ is a requirement for using C++14 
        warning("Disabling C++14 since libstdc++ dependencies were found")
        CONFIG -= c++std
      }
    }
  }

  libc++ {
    QMAKE_CXXFLAGS += -stdlib=libc++
    QMAKE_LFLAGS += -stdlib=libc++
    QMAKE_OBJECTIVE_CFLAGS += -stdlib=libc++
  }
}

c++std {
  CONFIG += c++14 strict_c++
  message("Using C++14")

  *clang*: {
      # 3rd party libraries will probably violate this for a long time
    CXX11_SUPPRESS_WARNINGS += -Wno-inconsistent-missing-override
    # boost/algorithm/string.hpp does this
    CXX11_SUPPRESS_WARNINGS += -Wno-unused-local-typedef
    # CGAL
    CXX11_SUPPRESS_WARNINGS += -Wno-deprecated-register

    QMAKE_CXXFLAGS_WARN_ON += $$CXX11_SUPPRESS_WARNINGS
    QMAKE_OBJECTIVE_CFLAGS_WARN_ON += $$CXX11_SUPPRESS_WARNINGS
  }
}