Title: [276925] trunk/Source/WTF
Revision
276925
Author
[email protected]
Date
2021-05-03 14:24:44 -0700 (Mon, 03 May 2021)

Log Message

Unreviewed attempt to fix JSCOnly build with recent clang after r276879
https://bugs.webkit.org/show_bug.cgi?id=225327

* wtf/PlatformJSCOnly.cmake:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (276924 => 276925)


--- trunk/Source/WTF/ChangeLog	2021-05-03 21:21:59 UTC (rev 276924)
+++ trunk/Source/WTF/ChangeLog	2021-05-03 21:24:44 UTC (rev 276925)
@@ -1,3 +1,10 @@
+2021-05-03  Chris Dumez  <[email protected]>
+
+        Unreviewed attempt to fix JSCOnly build with recent clang after r276879
+        https://bugs.webkit.org/show_bug.cgi?id=225327
+
+        * wtf/PlatformJSCOnly.cmake:
+
 2021-05-03  Diego Pino Garcia  <[email protected]>
 
         [GLIB] REGRESSION(r276879): Several tests are crashing or failing

Modified: trunk/Source/WTF/wtf/PlatformJSCOnly.cmake (276924 => 276925)


--- trunk/Source/WTF/wtf/PlatformJSCOnly.cmake	2021-05-03 21:21:59 UTC (rev 276924)
+++ trunk/Source/WTF/wtf/PlatformJSCOnly.cmake	2021-05-03 21:24:44 UTC (rev 276925)
@@ -161,13 +161,29 @@
 )
 
 if (COMPILER_IS_GCC_OR_CLANG)
-    if (COMPILER_IS_CLANG)
-        list(APPEND WTF_LIBRARIES
-            c++fs
-        )
-    else ()
-        list(APPEND WTF_LIBRARIES
-            stdc++fs
-        )
+    # <filesystem> vs <experimental/filesystem>
+    set(FILESYSTEM_TEST_SOURCE "
+        #include <filesystem>
+        int main() { std::filesystem::path p1(\"\"); std::filesystem::status(p1); }
+    ")
+    set(CMAKE_REQUIRED_FLAGS "--std=c++17")
+    check_cxx_source_compiles("${FILESYSTEM_TEST_SOURCE}" STD_FILESYSTEM_IS_AVAILABLE)
+    if (NOT STD_FILESYSTEM_IS_AVAILABLE)
+        set(EXPERIMENTAL_FILESYSTEM_TEST_SOURCE "
+            #include <experimental/filesystem>
+            int main() {
+                std::experimental::filesystem::path p1(\"//home\");
+                std::experimental::filesystem::status(p1);
+            }
+        ")
+        set(CMAKE_REQUIRED_LIBRARIES stdc++fs)
+        check_cxx_source_compiles("${EXPERIMENTAL_FILESYSTEM_TEST_SOURCE}" STD_EXPERIMENTAL_FILESYSTEM_IS_AVAILABLE)
+        unset(CMAKE_REQUIRED_LIBRARIES)
+        if (STD_EXPERIMENTAL_FILESYSTEM_IS_AVAILABLE)
+            list(APPEND WTF_LIBRARIES
+                stdc++fs
+            )
+        endif ()
     endif ()
+    unset(CMAKE_REQUIRED_FLAGS)
 endif ()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to