|
24 | 24 |
|
25 | 25 | cmake_minimum_required(VERSION 3.0)
|
26 | 26 | # XXX using 1.8.90 instead of 1.9.0-DEV
|
27 |
| -project(nghttp2 VERSION 1.58.90) |
| 27 | +project(nghttp2 VERSION 1.58.90 LANGUAGES C) |
28 | 28 |
|
29 | 29 | # See versioning rule:
|
30 | 30 | # https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
@@ -122,29 +122,31 @@ else()
|
122 | 122 | set(HINT_NORETURN)
|
123 | 123 | endif()
|
124 | 124 |
|
125 |
| -include(ExtractValidFlags) |
126 |
| -foreach(_cxx1x_flag -std=c++14) |
127 |
| - extract_valid_cxx_flags(_cxx1x_flag_supported ${_cxx1x_flag}) |
128 |
| - if(_cxx1x_flag_supported) |
129 |
| - set(CXX1XCXXFLAGS ${_cxx1x_flag}) |
130 |
| - break() |
131 |
| - endif() |
132 |
| -endforeach() |
| 125 | +if(NOT ENABLE_LIB_ONLY) |
| 126 | + include(ExtractValidFlags) |
| 127 | + foreach(_cxx1x_flag -std=c++14) |
| 128 | + extract_valid_cxx_flags(_cxx1x_flag_supported ${_cxx1x_flag}) |
| 129 | + if(_cxx1x_flag_supported) |
| 130 | + set(CXX1XCXXFLAGS ${_cxx1x_flag}) |
| 131 | + break() |
| 132 | + endif() |
| 133 | + endforeach() |
133 | 134 |
|
134 |
| -include(CMakePushCheckState) |
135 |
| -include(CheckCXXSourceCompiles) |
136 |
| -cmake_push_check_state() |
137 |
| -set(CMAKE_REQUIRED_DEFINITIONS "${CXX1XCXXFLAGS}") |
138 |
| -# Check that std::future is available. |
139 |
| -check_cxx_source_compiles(" |
140 |
| -#include <vector> |
141 |
| -#include <future> |
142 |
| -int main() { std::vector<std::future<int>> v; }" HAVE_STD_FUTURE) |
143 |
| -# Check that std::map::emplace is available for g++-4.7. |
144 |
| -check_cxx_source_compiles(" |
145 |
| -#include <map> |
146 |
| -int main() { std::map<int, int>().emplace(1, 2); }" HAVE_STD_MAP_EMPLACE) |
147 |
| -cmake_pop_check_state() |
| 135 | + include(CMakePushCheckState) |
| 136 | + include(CheckCXXSourceCompiles) |
| 137 | + cmake_push_check_state() |
| 138 | + set(CMAKE_REQUIRED_DEFINITIONS "${CXX1XCXXFLAGS}") |
| 139 | + # Check that std::future is available. |
| 140 | + check_cxx_source_compiles(" |
| 141 | + #include <vector> |
| 142 | + #include <future> |
| 143 | + int main() { std::vector<std::future<int>> v; }" HAVE_STD_FUTURE) |
| 144 | + # Check that std::map::emplace is available for g++-4.7. |
| 145 | + check_cxx_source_compiles(" |
| 146 | + #include <map> |
| 147 | + int main() { std::map<int, int>().emplace(1, 2); }" HAVE_STD_MAP_EMPLACE) |
| 148 | + cmake_pop_check_state() |
| 149 | +endif() |
148 | 150 |
|
149 | 151 |
|
150 | 152 | # Checks for libraries.
|
@@ -177,7 +179,7 @@ endif()
|
177 | 179 | # openssl (for src)
|
178 | 180 | include(CheckSymbolExists)
|
179 | 181 | set(HAVE_OPENSSL ${OPENSSL_FOUND})
|
180 |
| -if(OPENSSL_FOUND) |
| 182 | +if(NOT ENABLE_LIB_ONLY AND OPENSSL_FOUND) |
181 | 183 | set(OPENSSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
|
182 | 184 | cmake_push_check_state()
|
183 | 185 | set(CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}")
|
|
0 commit comments