Title: [219556] trunk/Source/WebCore
Revision
219556
Author
zandober...@gmail.com
Date
2017-07-17 01:45:54 -0700 (Mon, 17 Jul 2017)

Log Message

[CMake] Clean up Web Crypto build targets
https://bugs.webkit.org/show_bug.cgi?id=174253

Reviewed by Michael Catanzaro.

Gather the common WebCrypto source files in CMakeLists.txt, including them
in the build unconditionally and instead relying on ENABLE_SUBTLE_CRYPTO
build guards to exclude the code from compilation if the feature is disabled.

PlatformGTK.cmake, PlatformMac.cmake and PlatformWPE.cmake can then remove
duplicated build targets. PlatformMac.cmake still lists all the Mac-specific
Web Crypto build targets.

PlatformGTK.cmake and PlatformWPE.cmake now include GCrypt.cmake if the build
was configured to enable the use of libgcrypt. The new CMake file adds the
libgcrypt-specific Web Crypto build targets to the build if the feature was
enabled, and also sets up libgcrypt include directiories and libraries.

No new tests -- no change in behavior.

* CMakeLists.txt:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWPE.cmake:
* platform/GCrypt.cmake: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (219555 => 219556)


--- trunk/Source/WebCore/CMakeLists.txt	2017-07-17 07:03:03 UTC (rev 219555)
+++ trunk/Source/WebCore/CMakeLists.txt	2017-07-17 08:45:54 UTC (rev 219556)
@@ -1296,6 +1296,41 @@
     contentextensions/NFAToDFA.cpp
     contentextensions/URLFilterParser.cpp
 
+    crypto/CryptoAlgorithm.cpp
+    crypto/CryptoAlgorithmRegistry.cpp
+    crypto/CryptoKey.cpp
+    crypto/SubtleCrypto.cpp
+    crypto/WebKitSubtleCrypto.cpp
+
+    crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
+    crypto/algorithms/CryptoAlgorithmAES_CFB.cpp
+    crypto/algorithms/CryptoAlgorithmAES_CTR.cpp
+    crypto/algorithms/CryptoAlgorithmAES_GCM.cpp
+    crypto/algorithms/CryptoAlgorithmAES_KW.cpp
+    crypto/algorithms/CryptoAlgorithmECDH.cpp
+    crypto/algorithms/CryptoAlgorithmECDSA.cpp
+    crypto/algorithms/CryptoAlgorithmHKDF.cpp
+    crypto/algorithms/CryptoAlgorithmHMAC.cpp
+    crypto/algorithms/CryptoAlgorithmPBKDF2.cpp
+    crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
+    crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp
+    crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp
+    crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp
+    crypto/algorithms/CryptoAlgorithmSHA1.cpp
+    crypto/algorithms/CryptoAlgorithmSHA224.cpp
+    crypto/algorithms/CryptoAlgorithmSHA256.cpp
+    crypto/algorithms/CryptoAlgorithmSHA384.cpp
+    crypto/algorithms/CryptoAlgorithmSHA512.cpp
+
+    crypto/keys/CryptoKeyAES.cpp
+    crypto/keys/CryptoKeyDataOctetSequence.cpp
+    crypto/keys/CryptoKeyDataRSAComponents.cpp
+    crypto/keys/CryptoKeyEC.cpp
+    crypto/keys/CryptoKeyHMAC.cpp
+    crypto/keys/CryptoKeyRSA.cpp
+    crypto/keys/CryptoKeyRaw.cpp
+    crypto/keys/CryptoKeySerializationRaw.cpp
+
     css/BasicShapeFunctions.cpp
     css/CSSAspectRatioValue.cpp
     css/CSSBasicShapes.cpp

Modified: trunk/Source/WebCore/ChangeLog (219555 => 219556)


--- trunk/Source/WebCore/ChangeLog	2017-07-17 07:03:03 UTC (rev 219555)
+++ trunk/Source/WebCore/ChangeLog	2017-07-17 08:45:54 UTC (rev 219556)
@@ -1,3 +1,31 @@
+2017-07-17  Zan Dobersek  <zdober...@igalia.com>
+
+        [CMake] Clean up Web Crypto build targets
+        https://bugs.webkit.org/show_bug.cgi?id=174253
+
+        Reviewed by Michael Catanzaro.
+
+        Gather the common WebCrypto source files in CMakeLists.txt, including them
+        in the build unconditionally and instead relying on ENABLE_SUBTLE_CRYPTO
+        build guards to exclude the code from compilation if the feature is disabled.
+
+        PlatformGTK.cmake, PlatformMac.cmake and PlatformWPE.cmake can then remove
+        duplicated build targets. PlatformMac.cmake still lists all the Mac-specific
+        Web Crypto build targets.
+
+        PlatformGTK.cmake and PlatformWPE.cmake now include GCrypt.cmake if the build
+        was configured to enable the use of libgcrypt. The new CMake file adds the
+        libgcrypt-specific Web Crypto build targets to the build if the feature was
+        enabled, and also sets up libgcrypt include directiories and libraries.
+
+        No new tests -- no change in behavior.
+
+        * CMakeLists.txt:
+        * PlatformGTK.cmake:
+        * PlatformMac.cmake:
+        * PlatformWPE.cmake:
+        * platform/GCrypt.cmake: Added.
+
 2017-07-16  Michael Catanzaro  <mcatanz...@igalia.com>
 
         -Wreorder warning caused by GraphicsContext3D cleanup

Modified: trunk/Source/WebCore/PlatformGTK.cmake (219555 => 219556)


--- trunk/Source/WebCore/PlatformGTK.cmake	2017-07-17 07:03:03 UTC (rev 219555)
+++ trunk/Source/WebCore/PlatformGTK.cmake	2017-07-17 08:45:54 UTC (rev 219556)
@@ -8,6 +8,10 @@
     include(platform/TextureMapper.cmake)
 endif ()
 
+if (USE_GCRYPT)
+    include(platform/GCrypt.cmake)
+endif ()
+
 set(WebCore_OUTPUT_NAME WebCoreGTK)
 
 list(APPEND WebCore_INCLUDE_DIRECTORIES
@@ -214,7 +218,6 @@
     ${GLIB_GOBJECT_LIBRARIES}
     ${GLIB_LIBRARIES}
     ${GUDEV_LIBRARIES}
-    ${LIBGCRYPT_LIBRARIES}
     ${LIBSECRET_LIBRARIES}
     ${LIBSOUP_LIBRARIES}
     ${LIBTASN1_LIBRARIES}
@@ -241,7 +244,6 @@
     ${GIO_UNIX_INCLUDE_DIRS}
     ${GLIB_INCLUDE_DIRS}
     ${GUDEV_INCLUDE_DIRS}
-    ${LIBGCRYPT_INCLUDE_DIRS}
     ${LIBSECRET_INCLUDE_DIRS}
     ${LIBSOUP_INCLUDE_DIRS}
     ${LIBTASN1_INCLUDE_DIRS}
@@ -335,61 +337,3 @@
         platform/ScrollAnimationSmooth.cpp
     )
 endif ()
-
-if (ENABLE_SUBTLE_CRYPTO)
-    list(APPEND WebCore_SOURCES
-        crypto/CryptoAlgorithm.cpp
-        crypto/CryptoAlgorithmRegistry.cpp
-        crypto/CryptoKey.cpp
-        crypto/SubtleCrypto.cpp
-        crypto/WebKitSubtleCrypto.cpp
-
-        crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
-        crypto/algorithms/CryptoAlgorithmAES_CFB.cpp
-        crypto/algorithms/CryptoAlgorithmAES_CTR.cpp
-        crypto/algorithms/CryptoAlgorithmAES_GCM.cpp
-        crypto/algorithms/CryptoAlgorithmAES_KW.cpp
-        crypto/algorithms/CryptoAlgorithmECDH.cpp
-        crypto/algorithms/CryptoAlgorithmECDSA.cpp
-        crypto/algorithms/CryptoAlgorithmHKDF.cpp
-        crypto/algorithms/CryptoAlgorithmHMAC.cpp
-        crypto/algorithms/CryptoAlgorithmPBKDF2.cpp
-        crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
-        crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp
-        crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp
-        crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp
-        crypto/algorithms/CryptoAlgorithmSHA1.cpp
-        crypto/algorithms/CryptoAlgorithmSHA224.cpp
-        crypto/algorithms/CryptoAlgorithmSHA256.cpp
-        crypto/algorithms/CryptoAlgorithmSHA384.cpp
-        crypto/algorithms/CryptoAlgorithmSHA512.cpp
-
-        crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp
-        crypto/gcrypt/CryptoKeyECGCrypt.cpp
-        crypto/gcrypt/CryptoKeyRSAGCrypt.cpp
-        crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp
-
-        crypto/keys/CryptoKeyAES.cpp
-        crypto/keys/CryptoKeyDataOctetSequence.cpp
-        crypto/keys/CryptoKeyDataRSAComponents.cpp
-        crypto/keys/CryptoKeyEC.cpp
-        crypto/keys/CryptoKeyHMAC.cpp
-        crypto/keys/CryptoKeyRSA.cpp
-        crypto/keys/CryptoKeyRaw.cpp
-        crypto/keys/CryptoKeySerializationRaw.cpp
-    )
-endif ()

Modified: trunk/Source/WebCore/PlatformMac.cmake (219555 => 219556)


--- trunk/Source/WebCore/PlatformMac.cmake	2017-07-17 07:03:03 UTC (rev 219555)
+++ trunk/Source/WebCore/PlatformMac.cmake	2017-07-17 08:45:54 UTC (rev 219556)
@@ -176,41 +176,7 @@
     bridge/objc/objc_utility.mm
 
     crypto/CommonCryptoUtilities.cpp
-    crypto/CryptoAlgorithm.cpp
-    crypto/CryptoAlgorithmRegistry.cpp
-    crypto/CryptoKey.cpp
-    crypto/SubtleCrypto.cpp
-    crypto/WebKitSubtleCrypto.cpp
 
-    crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
-    crypto/algorithms/CryptoAlgorithmAES_CFB.cpp
-    crypto/algorithms/CryptoAlgorithmAES_CTR.cpp
-    crypto/algorithms/CryptoAlgorithmAES_GCM.cpp
-    crypto/algorithms/CryptoAlgorithmAES_KW.cpp
-    crypto/algorithms/CryptoAlgorithmECDH.cpp
-    crypto/algorithms/CryptoAlgorithmECDSA.cpp
-    crypto/algorithms/CryptoAlgorithmHKDF.cpp
-    crypto/algorithms/CryptoAlgorithmHMAC.cpp
-    crypto/algorithms/CryptoAlgorithmPBKDF2.cpp
-    crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
-    crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp
-    crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp
-    crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp
-    crypto/algorithms/CryptoAlgorithmSHA1.cpp
-    crypto/algorithms/CryptoAlgorithmSHA224.cpp
-    crypto/algorithms/CryptoAlgorithmSHA256.cpp
-    crypto/algorithms/CryptoAlgorithmSHA384.cpp
-    crypto/algorithms/CryptoAlgorithmSHA512.cpp
-
-    crypto/keys/CryptoKeyAES.cpp
-    crypto/keys/CryptoKeyDataOctetSequence.cpp
-    crypto/keys/CryptoKeyDataRSAComponents.cpp
-    crypto/keys/CryptoKeyEC.cpp
-    crypto/keys/CryptoKeyHMAC.cpp
-    crypto/keys/CryptoKeyRSA.cpp
-    crypto/keys/CryptoKeyRaw.cpp
-    crypto/keys/CryptoKeySerializationRaw.cpp
-
     crypto/mac/CommonCryptoDERUtilities.cpp
     crypto/mac/CryptoAlgorithmAES_CBCMac.cpp
     crypto/mac/CryptoAlgorithmAES_CFBMac.cpp

Modified: trunk/Source/WebCore/PlatformWPE.cmake (219555 => 219556)


--- trunk/Source/WebCore/PlatformWPE.cmake	2017-07-17 07:03:03 UTC (rev 219555)
+++ trunk/Source/WebCore/PlatformWPE.cmake	2017-07-17 08:45:54 UTC (rev 219556)
@@ -5,6 +5,10 @@
 include(platform/Linux.cmake)
 include(platform/TextureMapper.cmake)
 
+if (USE_GCRYPT)
+    include(platform/GCrypt.cmake)
+endif ()
+
 # Allow building ANGLE on platforms that don't provide X11 headers.
 list(APPEND ANGLE_PLATFORM_DEFINITIONS "USE_WPE")
 
@@ -167,7 +171,6 @@
     ${GLIB_LIBRARIES}
     ${GNUTLS_LIBRARIES}
     ${ICU_LIBRARIES}
-    ${LIBGCRYPT_LIBRARIES}
     ${LIBSOUP_LIBRARIES}
     ${LIBTASN1_LIBRARIES}
     ${LIBXML2_LIBRARIES}
@@ -182,7 +185,6 @@
     ${GLIB_INCLUDE_DIRS}
     ${GNUTLS_INCLUDE_DIRS}
     ${ICU_INCLUDE_DIRS}
-    ${LIBGCRYPT_INCLUDE_DIRS}
     ${LIBSOUP_INCLUDE_DIRS}
     ${LIBTASN1_INCLUDE_DIRS}
     ${LIBXML2_INCLUDE_DIR}
@@ -203,62 +205,3 @@
 target_link_libraries(WebCorePlatformWPE
     ${WebCore_LIBRARIES}
 )
-
-if (ENABLE_SUBTLE_CRYPTO)
-    list(APPEND WebCore_SOURCES
-        crypto/CryptoAlgorithm.cpp
-        crypto/CryptoAlgorithmRegistry.cpp
-        crypto/CryptoKey.cpp
-        crypto/SubtleCrypto.cpp
-        crypto/WebKitSubtleCrypto.cpp
-
-        crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
-        crypto/algorithms/CryptoAlgorithmAES_CFB.cpp
-        crypto/algorithms/CryptoAlgorithmAES_CTR.cpp
-        crypto/algorithms/CryptoAlgorithmAES_GCM.cpp
-        crypto/algorithms/CryptoAlgorithmAES_KW.cpp
-        crypto/algorithms/CryptoAlgorithmECDH.cpp
-        crypto/algorithms/CryptoAlgorithmECDSA.cpp
-        crypto/algorithms/CryptoAlgorithmHKDF.cpp
-        crypto/algorithms/CryptoAlgorithmHMAC.cpp
-        crypto/algorithms/CryptoAlgorithmPBKDF2.cpp
-        crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
-        crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp
-        crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp
-        crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp
-        crypto/algorithms/CryptoAlgorithmSHA1.cpp
-        crypto/algorithms/CryptoAlgorithmSHA224.cpp
-        crypto/algorithms/CryptoAlgorithmSHA256.cpp
-        crypto/algorithms/CryptoAlgorithmSHA384.cpp
-        crypto/algorithms/CryptoAlgorithmSHA512.cpp
-
-        crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp
-        crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp
-        crypto/gcrypt/CryptoKeyECGCrypt.cpp
-        crypto/gcrypt/CryptoKeyRSAGCrypt.cpp
-        crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp
-
-        crypto/keys/CryptoKeyAES.cpp
-        crypto/keys/CryptoKeyDataOctetSequence.cpp
-        crypto/keys/CryptoKeyDataRSAComponents.cpp
-        crypto/keys/CryptoKeyEC.cpp
-        crypto/keys/CryptoKeyHMAC.cpp
-        crypto/keys/CryptoKeyRSA.cpp
-        crypto/keys/CryptoKeyRaw.cpp
-        crypto/keys/CryptoKeySerializationRaw.cpp
-    )
-endif ()
-

Added: trunk/Source/WebCore/platform/GCrypt.cmake (0 => 219556)


--- trunk/Source/WebCore/platform/GCrypt.cmake	                        (rev 0)
+++ trunk/Source/WebCore/platform/GCrypt.cmake	2017-07-17 08:45:54 UTC (rev 219556)
@@ -0,0 +1,29 @@
+if (ENABLE_SUBTLE_CRYPTO)
+    list(APPEND WebCore_SOURCES
+        crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp
+        crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp
+        crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp
+        crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp
+        crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp
+        crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp
+        crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp
+        crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp
+        crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp
+        crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp
+        crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp
+        crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp
+        crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp
+        crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp
+        crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp
+        crypto/gcrypt/CryptoKeyECGCrypt.cpp
+        crypto/gcrypt/CryptoKeyRSAGCrypt.cpp
+        crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp
+    )
+endif ()
+
+list(APPEND WebCore_LIBRARIES
+    ${LIBGCRYPT_LIBRARIES}
+)
+list(APPEND WebCore_INCLUDE_DIRECTORIES
+    ${LIBGCRYPT_INCLUDE_DIRS}
+)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to