Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 1 | From bc577820ad25795543b31f123e309cdaebc7d6c6 Mon Sep 17 00:00:00 2001 |
| 2 | From: Cody P Schafer <dev@codyps.com> |
| 3 | Date: Mon, 16 May 2016 15:21:10 -0400 |
| 4 | Subject: [PATCH 1/2] THRIFT-3828 In cmake avoid use of both quoted paths and |
| 5 | SYSTEM with include_directories() |
| 6 | |
| 7 | This allows us to avoid issues where there are no paths to be added to |
| 8 | the include path (include_directories() errors when given an empty |
| 9 | string). |
| 10 | |
| 11 | Specifically, gcc-6 requires that libraries stop passing paths like |
| 12 | '/usr/include' (or they will get libstdc++ build errors), so these paths |
| 13 | will be empty more often in the future. |
| 14 | --- |
| 15 | lib/cpp/CMakeLists.txt | 8 ++++---- |
| 16 | lib/cpp/test/CMakeLists.txt | 2 +- |
| 17 | test/cpp/CMakeLists.txt | 6 +++--- |
| 18 | tutorial/cpp/CMakeLists.txt | 2 +- |
| 19 | 4 files changed, 9 insertions(+), 9 deletions(-) |
| 20 | |
| 21 | diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt |
| 22 | index 4c7caeb..a716ac3 100755 |
| 23 | --- a/lib/cpp/CMakeLists.txt |
| 24 | +++ b/lib/cpp/CMakeLists.txt |
| 25 | @@ -24,7 +24,7 @@ else() |
| 26 | find_package(Boost 1.53.0 REQUIRED) |
| 27 | endif() |
| 28 | |
| 29 | -include_directories(SYSTEM "${Boost_INCLUDE_DIRS}") |
| 30 | +include_directories(${Boost_INCLUDE_DIRS}) |
| 31 | include_directories(src) |
| 32 | |
| 33 | # SYSLIBS contains libraries that need to be linked to all lib targets |
| 34 | @@ -104,7 +104,7 @@ if(OPENSSL_FOUND AND WITH_OPENSSL) |
| 35 | src/thrift/transport/TSSLSocket.cpp |
| 36 | src/thrift/transport/TSSLServerSocket.cpp |
| 37 | ) |
| 38 | - include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") |
| 39 | + include_directories(${OPENSSL_INCLUDE_DIR}) |
| 40 | list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}") |
| 41 | endif() |
| 42 | |
| 43 | @@ -162,7 +162,7 @@ TARGET_LINK_LIBRARIES_THRIFT(thrift ${SYSLIBS}) |
| 44 | |
| 45 | if(WITH_LIBEVENT) |
| 46 | find_package(Libevent REQUIRED) # Libevent comes with CMake support form upstream |
| 47 | - include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS}) |
| 48 | + include_directories(${LIBEVENT_INCLUDE_DIRS}) |
| 49 | |
| 50 | ADD_LIBRARY_THRIFT(thriftnb ${thriftcppnb_SOURCES}) |
| 51 | TARGET_LINK_LIBRARIES_THRIFT(thriftnb ${SYSLIBS} ${LIBEVENT_LIBRARIES}) |
| 52 | @@ -171,7 +171,7 @@ endif() |
| 53 | |
| 54 | if(WITH_ZLIB) |
| 55 | find_package(ZLIB REQUIRED) |
| 56 | - include_directories(SYSTEM ${ZLIB_INCLUDE_DIRS}) |
| 57 | + include_directories(${ZLIB_INCLUDE_DIRS}) |
| 58 | |
| 59 | ADD_LIBRARY_THRIFT(thriftz ${thriftcppz_SOURCES}) |
| 60 | TARGET_LINK_LIBRARIES_THRIFT(thriftz ${SYSLIBS} ${ZLIB_LIBRARIES}) |
| 61 | diff --git a/lib/cpp/test/CMakeLists.txt b/lib/cpp/test/CMakeLists.txt |
| 62 | index 5de9fc4..c956c38 100644 |
| 63 | --- a/lib/cpp/test/CMakeLists.txt |
| 64 | +++ b/lib/cpp/test/CMakeLists.txt |
| 65 | @@ -20,7 +20,7 @@ |
| 66 | # Find required packages |
| 67 | set(Boost_USE_STATIC_LIBS ON) # Force the use of static boost test framework |
| 68 | find_package(Boost 1.53.0 REQUIRED COMPONENTS chrono filesystem system thread unit_test_framework) |
| 69 | -include_directories(SYSTEM "${Boost_INCLUDE_DIRS}") |
| 70 | +include_directories(${Boost_INCLUDE_DIRS}) |
| 71 | |
| 72 | #Make sure gen-cpp files can be included |
| 73 | include_directories("${CMAKE_CURRENT_BINARY_DIR}") |
| 74 | diff --git a/test/cpp/CMakeLists.txt b/test/cpp/CMakeLists.txt |
| 75 | index 2d75f2e..b1409de 100755 |
| 76 | --- a/test/cpp/CMakeLists.txt |
| 77 | +++ b/test/cpp/CMakeLists.txt |
| 78 | @@ -22,13 +22,13 @@ include(ThriftMacros) |
| 79 | |
| 80 | set(Boost_USE_STATIC_LIBS ON) |
| 81 | find_package(Boost 1.53.0 REQUIRED COMPONENTS program_options system filesystem) |
| 82 | -include_directories(SYSTEM "${Boost_INCLUDE_DIRS}") |
| 83 | +include_directories(${Boost_INCLUDE_DIRS}) |
| 84 | |
| 85 | find_package(OpenSSL REQUIRED) |
| 86 | -include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") |
| 87 | +include_directories(${OPENSSL_INCLUDE_DIR}) |
| 88 | |
| 89 | find_package(Libevent REQUIRED) # Libevent comes with CMake support from upstream |
| 90 | -include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS}) |
| 91 | +include_directories(${LIBEVENT_INCLUDE_DIRS}) |
| 92 | |
| 93 | #Make sure gen-cpp files can be included |
| 94 | include_directories("${CMAKE_CURRENT_BINARY_DIR}") |
| 95 | diff --git a/tutorial/cpp/CMakeLists.txt b/tutorial/cpp/CMakeLists.txt |
| 96 | index 2b0c143..5ecae17 100644 |
| 97 | --- a/tutorial/cpp/CMakeLists.txt |
| 98 | +++ b/tutorial/cpp/CMakeLists.txt |
| 99 | @@ -18,7 +18,7 @@ |
| 100 | # |
| 101 | |
| 102 | find_package(Boost 1.53.0 REQUIRED) |
| 103 | -include_directories(SYSTEM "${Boost_INCLUDE_DIRS}") |
| 104 | +include_directories(${Boost_INCLUDE_DIRS}) |
| 105 | |
| 106 | #Make sure gen-cpp files can be included |
| 107 | include_directories("${CMAKE_CURRENT_BINARY_DIR}") |
| 108 | -- |
| 109 | 2.9.3 |
| 110 | |