[cmake] WTF target should not have wtf and subdirectries in public interface
authorannulen@yandex.ru <annulen@yandex.ru@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Apr 2017 17:26:07 +0000 (17:26 +0000)
committerannulen@yandex.ru <annulen@yandex.ru@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Apr 2017 17:26:07 +0000 (17:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=171115

Reviewed by Michael Catanzaro.

In r209665 WEBCORE_FRAMEWORK macro started to export INCLUDE_DIRECTORIES of
targets as their public interface, so that linked targets can use them
implicitly without copying directory lists around. This matches existing
practice for all targets except WTF, headers from which are always included
with full path starting from "<wtf/...".

Since r209665 it became possible to include headers from wtf or its
subdirectories in CMake builds without using "<wtf/..." path. It should
not be allowed.

.:

* Source/cmake/WebKitMacros.cmake: Support xxx_PRIVATE_HEADERS
CMake variables.

Source/WebCore:

* platform/graphics/texmap/coordinated/TiledBackingStore.cpp: Fix
incorrect include of WTF header.

Source/WTF:

* wtf/CMakeLists.txt: WTF/wtf and its sudirectories should not be in
public include paths of WTF target.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215614 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Source/WTF/ChangeLog
Source/WTF/wtf/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/texmap/coordinated/TiledBackingStore.cpp
Source/cmake/WebKitMacros.cmake

index 76293cc..f5bbb14 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>
+
+        [cmake] WTF target should not have wtf and subdirectries in public interface
+        https://bugs.webkit.org/show_bug.cgi?id=171115
+
+        Reviewed by Michael Catanzaro.
+
+        In r209665 WEBCORE_FRAMEWORK macro started to export INCLUDE_DIRECTORIES of
+        targets as their public interface, so that linked targets can use them
+        implicitly without copying directory lists around. This matches existing
+        practice for all targets except WTF, headers from which are always included
+        with full path starting from "<wtf/...".
+
+        Since r209665 it became possible to include headers from wtf or its
+        subdirectories in CMake builds without using "<wtf/..." path. It should
+        not be allowed.
+
+        * Source/cmake/WebKitMacros.cmake: Support xxx_PRIVATE_HEADERS
+        CMake variables.
+
 2017-04-20  Konstantin Tokarev  <annulen@yandex.ru>
 
         [cmake] Define FORWARDING_HEADERS_DIR in WebKitFS and use it everywhere
index cdd2781..4ab9ee9 100644 (file)
@@ -1,3 +1,23 @@
+2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>
+
+        [cmake] WTF target should not have wtf and subdirectries in public interface
+        https://bugs.webkit.org/show_bug.cgi?id=171115
+
+        Reviewed by Michael Catanzaro.
+
+        In r209665 WEBCORE_FRAMEWORK macro started to export INCLUDE_DIRECTORIES of
+        targets as their public interface, so that linked targets can use them
+        implicitly without copying directory lists around. This matches existing
+        practice for all targets except WTF, headers from which are always included
+        with full path starting from "<wtf/...".
+
+        Since r209665 it became possible to include headers from wtf or its
+        subdirectories in CMake builds without using "<wtf/..." path. It should
+        not be allowed.
+
+        * wtf/CMakeLists.txt: WTF/wtf and its sudirectories should not be in
+        public include paths of WTF target.
+
 2017-04-20  Sam Weinig  <sam@webkit.org>
 
         Move notFound into its own file
index 1bae3bb..f88a572 100644 (file)
@@ -286,6 +286,12 @@ set(WTF_SOURCES
 set(WTF_INCLUDE_DIRECTORIES
     "${BMALLOC_DIR}"
     "${WTF_DIR}"
+    "${CMAKE_BINARY_DIR}"
+    "${DERIVED_SOURCES_DIR}"
+    "${THIRDPARTY_DIR}"
+)
+
+set(WTF_PRIVATE_INCLUDE_DIRECTORIES
     "${WTF_DIR}/wtf"
     "${WTF_DIR}/wtf/dtoa"
     "${WTF_DIR}/wtf/persistence"
@@ -293,9 +299,6 @@ set(WTF_INCLUDE_DIRECTORIES
     "${WTF_DIR}/wtf/text/icu"
     "${WTF_DIR}/wtf/threads"
     "${WTF_DIR}/wtf/unicode"
-    "${THIRDPARTY_DIR}"
-    "${CMAKE_BINARY_DIR}"
-    "${DERIVED_SOURCES_DIR}"
 )
 
 set(WTF_LIBRARIES
index 59ef412..e1c222e 100644 (file)
@@ -1,3 +1,23 @@
+2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>
+
+        [cmake] WTF target should not have wtf and subdirectries in public interface
+        https://bugs.webkit.org/show_bug.cgi?id=171115
+
+        Reviewed by Michael Catanzaro.
+
+        In r209665 WEBCORE_FRAMEWORK macro started to export INCLUDE_DIRECTORIES of
+        targets as their public interface, so that linked targets can use them
+        implicitly without copying directory lists around. This matches existing
+        practice for all targets except WTF, headers from which are always included
+        with full path starting from "<wtf/...".
+
+        Since r209665 it became possible to include headers from wtf or its
+        subdirectories in CMake builds without using "<wtf/..." path. It should
+        not be allowed.
+
+        * platform/graphics/texmap/coordinated/TiledBackingStore.cpp: Fix
+        incorrect include of WTF header.
+
 2017-04-21  Gwang Yoon Hwang  <yoon@igalia.com>
 
         Do not paint the border of the box if the dirty region does not intersect with border area
index b638916..ecb31b4 100644 (file)
@@ -22,9 +22,9 @@
 
 #if USE(COORDINATED_GRAPHICS)
 #include "GraphicsContext.h"
-#include "MemoryPressureHandler.h"
 #include "TiledBackingStoreClient.h"
 #include <wtf/CheckedArithmetic.h>
+#include <wtf/MemoryPressureHandler.h>
 
 namespace WebCore {
 
index da816b2..a0e81ee 100644 (file)
@@ -283,6 +283,7 @@ macro(WEBKIT_FRAMEWORK _target)
         ${${_target}_SOURCES}
     )
     target_include_directories(${_target} PUBLIC "$<BUILD_INTERFACE:${${_target}_INCLUDE_DIRECTORIES}>")
+    target_include_directories(${_target} PRIVATE "$<BUILD_INTERFACE:${${_target}_PRIVATE_INCLUDE_DIRECTORIES}>")
     target_link_libraries(${_target} ${${_target}_LIBRARIES})
     set_target_properties(${_target} PROPERTIES COMPILE_DEFINITIONS "BUILDING_${_target}")