summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliot Saba <staticfloat@gmail.com>2016-12-30 17:59:47 -0800
committerElliot Saba <staticfloat@gmail.com>2016-12-30 17:59:47 -0800
commite56e4c76b930e600419af24a3433f1517e1a6e0f (patch)
treede65068232300429f522a1d2d87ee4ccbc14afd7
parent236a690ce4cbcbaf243dda8853832de8485bac3f (diff)
downloadlibgit2-e56e4c76b930e600419af24a3433f1517e1a6e0f.tar.gz
CMakeLists: Move `http-parser` block down by `zlib`, update error message
-rw-r--r--CMakeLists.txt25
1 files changed, 12 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8cc43c6ea..4bfd1b499 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -235,19 +235,6 @@ IF (WIN32 AND EMBED_SSH_PATH)
ADD_DEFINITIONS(-DGIT_SSH)
ENDIF()
-
-FIND_PACKAGE(HTTP_Parser)
-IF (HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2)
- INCLUDE_DIRECTORIES(${HTTP_PARSER_INCLUDE_DIRS})
- LINK_LIBRARIES(${HTTP_PARSER_LIBRARIES})
- LIST(APPEND LIBGIT2_PC_LIBS "-lhttp_parser")
-ELSE()
- MESSAGE(STATUS "http-parser was not found or is too old; using bundled 3rd-party sources.")
- INCLUDE_DIRECTORIES(deps/http-parser)
- FILE(GLOB SRC_HTTP deps/http-parser/*.c deps/http-parser/*.h)
-ENDIF()
-
-
IF (WIN32 AND WINHTTP)
ADD_DEFINITIONS(-DGIT_WINHTTP)
@@ -332,6 +319,18 @@ IF(WIN32 OR AMIGA OR CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
SET(SRC_REGEX deps/regex/regex.c)
ENDIF()
+# Optional external dependency: http-parser
+FIND_PACKAGE(HTTP_Parser)
+IF (HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2)
+ INCLUDE_DIRECTORIES(${HTTP_PARSER_INCLUDE_DIRS})
+ LINK_LIBRARIES(${HTTP_PARSER_LIBRARIES})
+ LIST(APPEND LIBGIT2_PC_LIBS "-lhttp_parser")
+ELSE()
+ MESSAGE(STATUS "http-parser version 2 was not found; using bundled 3rd-party sources.")
+ INCLUDE_DIRECTORIES(deps/http-parser)
+ FILE(GLOB SRC_HTTP deps/http-parser/*.c deps/http-parser/*.h)
+ENDIF()
+
# Optional external dependency: zlib
FIND_PACKAGE(ZLIB)
IF (ZLIB_FOUND)