Commit 8a43161b by Patrick Steinhardt

cmake: always include our own headers first

With c26ce784 (Merge branch 'AndreyG/cmake/modernization', 2017-06-28),
we have recently introduced a regression in the way we are searching for
headers. We have made sure to always include our own headers first, but
due to the changes in c26ce784  this is no longer guaranteed. In fact,
this already leads the compiler into picking "config.h" from the
"deps/regex" dependency, if it is used.

Fix the issue by declaring our internal include directories up front,
before any of the other search directories is added.
parent e5c9723d
......@@ -11,7 +11,10 @@ SET(LIBGIT2_PC_REQUIRES "")
# pc file.
SET(LIBGIT2_PC_LIBS "")
SET(LIBGIT2_INCLUDES "")
SET(LIBGIT2_INCLUDES
"${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_SOURCE_DIR}/src"
"${CMAKE_SOURCE_DIR}/include")
SET(LIBGIT2_LIBS "")
SET(LIBGIT2_LIBDIRS "")
......@@ -329,8 +332,6 @@ CONFIGURE_FILE(features.h.in git2/sys/features.h)
SET(GIT2INTERNAL_OBJECTS ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_SSH} ${SRC_SHA1})
LIST(APPEND LIBGIT2_INCLUDES ${CMAKE_CURRENT_BINARY_DIR} "${CMAKE_SOURCE_DIR}/src" "${CMAKE_SOURCE_DIR}/include")
IF (CMAKE_VERSION VERSION_GREATER 2.8.7)
ADD_LIBRARY(git2internal OBJECT ${GIT2INTERNAL_OBJECTS})
IDE_SPLIT_SOURCES(git2internal)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment