File: pbbam-compilerflags.cmake

package info (click to toggle)
pbbam 0.7.4%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 10,384 kB
  • ctags: 5,236
  • sloc: cpp: 48,068; python: 1,444; xml: 852; ansic: 820; makefile: 175; sh: 52; cs: 12
file content (44 lines) | stat: -rw-r--r-- 1,348 bytes parent folder | download | duplicates (2)
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
44

include(CheckCXXCompilerFlag)

# C++11 check & enabling
if (CMAKE_VERSION VERSION_LESS "3.1")
    if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")    # clang
    else()
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")        # gcc
    endif()
else() # 3.1+
    set(CMAKE_CXX_STANDARD          11)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()

# shared CXX flags for src & tests
if (MSVC)
    set(PacBioBAM_CXX_FLAGS "/Wall")
else()
    set(PacBioBAM_CXX_FLAGS "-Wall")
endif()

# NOTE: -Wno-unused-local-typedefs used to quash clang warnings w/ Boost
check_cxx_compiler_flag("-Wno-unused-local-typedefs" HAS_NO_UNUSED_LOCAL_TYPEDEFS)
if(HAS_NO_UNUSED_LOCAL_TYPEDEFS)
    set(PacBioBAM_CXX_FLAGS "${PacBioBAM_CXX_FLAGS} -Wno-unused-local-typedefs")
endif()

check_cxx_compiler_flag("-Wno-sign-compare" HAS_NO_SIGN_COMPARE)
if(HAS_NO_SIGN_COMPARE)
    set(PacBioBAM_CXX_FLAGS "${PacBioBAM_CXX_FLAGS} -Wno-sign-compare")
endif()

# Turn on windows-style filepath resolution.
# We need to add this #define early (not just in the C# SWIG wrapper)
if(WIN32 AND PacBioBAM_wrap_csharp)
    add_definitions(-DPBBAM_WIN_FILEPATHS)
endif()

# For now, keep @rpath out of install names on OS X, as it causes SWIG
# tests to fail.
if(APPLE)
    set(CMAKE_MACOSX_RPATH OFF)
endif()