From decab5a8c672776a91e85164b973c2f2998181a2 Mon Sep 17 00:00:00 2001 From: David Faure Date: Sat, 30 Nov 2019 13:20:54 +0100 Subject: [PATCH] Ensure that the local headers have priority over installed headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes the build error I saw today: phonenumbermatcher.cc:715:7: error: ‘GetNationalNumberGroupsForPattern’ was not declared in this scope due to the compiler picking an older installed phonenumbers/phonenumbermatcher.h header than the one under src. This problem doesn't usually happen with cmake because normally this would all be done from src/CMakeLists.txt with set(CMAKE_INCLUDE_CURRENT_DIR ON), but that would require more refactoring. --- cpp/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 3bcb458c7..4b32b73a0 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -347,7 +347,7 @@ if (NOT WIN32) add_definitions ("-Wall -Werror") endif () -include_directories ("src") +include_directories (BEFORE "src") if (${BUILD_STATIC_LIB} STREQUAL "ON") # Build a static library (without -fPIC).