kou commented on code in PR #37821:
URL: https://github.com/apache/arrow/pull/37821#discussion_r1542213516


##########
cpp/src/arrow/util/cancel_test.cc:
##########


Review Comment:
   Could you add `#include "arrow/util/future.h"` for `ARROW_ENABLE_THREADING`?



##########
cpp/cmake_modules/SetupCxxFlags.cmake:
##########
@@ -692,18 +699,39 @@ if(NOT MSVC)
   set(C_DEBUG_FLAGS "")
   set(CXX_DEBUG_FLAGS "")
   if(NOT MSVC)
-    if(NOT CMAKE_C_FLAGS_DEBUG MATCHES "-O")
-      string(APPEND C_DEBUG_FLAGS " -O0")
-    endif()
-    if(NOT CMAKE_CXX_FLAGS_DEBUG MATCHES "-O")
-      string(APPEND CXX_DEBUG_FLAGS " -O0")
-    endif()
-    if(ARROW_GGDB_DEBUG)
-      string(APPEND C_DEBUG_FLAGS " -ggdb")
-      string(APPEND CXX_DEBUG_FLAGS " -ggdb")
-      string(APPEND C_RELWITHDEBINFO_FLAGS " -ggdb")
-      string(APPEND CXX_RELWITHDEBINFO_FLAGS " -ggdb")
+    if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
+      # with -g it uses DWARF debug info, which is really slow to build
+      # on emscripten (and uses tons of memory)
+      string(REPLACE "-g" " " CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
+      string(REPLACE "-g" " " CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
+      string(APPEND C_DEBUG_FLAGS " -g2")
+      string(APPEND CXX_DEBUG_FLAGS " -g2")
+      string(APPEND C_RELWITHDEBINFO_FLAGS " -g2")
+      string(APPEND CXX_RELWITHDEBINFO_FLAGS " -g2")
+      # without -O1, emscripten executables are *MASSIVE*. Don't use -O0
+      if(NOT CMAKE_C_FLAGS_DEBUG MATCHES "-O")
+        string(APPEND C_DEBUG_FLAGS " -O1")
+      endif()
+      if(NOT CMAKE_CXX_FLAGS_DEBUG MATCHES "-O")
+        string(APPEND CXX_DEBUG_FLAGS " -O1")
+      endif()
+    else()
+      if(NOT CMAKE_C_FLAGS_DEBUG MATCHES "-O")
+        string(APPEND C_DEBUG_FLAGS " -O0")
+      endif()
+      if(NOT CMAKE_CXX_FLAGS_DEBUG MATCHES "-O")
+        string(APPEND CXX_DEBUG_FLAGS " -O0")
+      endif()
+
+      if(ARROW_GGDB_DEBUG)
+        string(APPEND C_DEBUG_FLAGS " -ggdb")
+        string(APPEND CXX_DEBUG_FLAGS " -ggdb")
+        string(APPEND C_RELWITHDEBINFO_FLAGS " -ggdb")
+        string(APPEND CXX_RELWITHDEBINFO_FLAGS " -ggdb")
+      endif()
+

Review Comment:
   ```suggestion
   ```



##########
cpp/src/arrow/util/cache_test.cc:
##########


Review Comment:
   Could you add `#include "arrow/util/future.h"` for `ARROW_ENABLE_THREADING`?



##########
cpp/src/arrow/util/atfork_test.cc:
##########


Review Comment:
   Could you add `#include "arrow/util/future.h"` for `ARROW_ENABLE_THREADING`?



##########
cpp/src/arrow/compute/kernels/scalar_string_test.cc:
##########
@@ -21,6 +21,7 @@
 #include <vector>
 
 #include <gmock/gmock.h>
+#include <gtest/gtest-spi.h>

Review Comment:
   ```suggestion
   ```



##########
cpp/cmake_modules/SetupCxxFlags.cmake:
##########
@@ -692,18 +699,39 @@ if(NOT MSVC)
   set(C_DEBUG_FLAGS "")
   set(CXX_DEBUG_FLAGS "")
   if(NOT MSVC)
-    if(NOT CMAKE_C_FLAGS_DEBUG MATCHES "-O")
-      string(APPEND C_DEBUG_FLAGS " -O0")
-    endif()
-    if(NOT CMAKE_CXX_FLAGS_DEBUG MATCHES "-O")
-      string(APPEND CXX_DEBUG_FLAGS " -O0")
-    endif()
-    if(ARROW_GGDB_DEBUG)
-      string(APPEND C_DEBUG_FLAGS " -ggdb")
-      string(APPEND CXX_DEBUG_FLAGS " -ggdb")
-      string(APPEND C_RELWITHDEBINFO_FLAGS " -ggdb")
-      string(APPEND CXX_RELWITHDEBINFO_FLAGS " -ggdb")
+    if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
+      # with -g it uses DWARF debug info, which is really slow to build
+      # on emscripten (and uses tons of memory)
+      string(REPLACE "-g" " " CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
+      string(REPLACE "-g" " " CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
+      string(APPEND C_DEBUG_FLAGS " -g2")
+      string(APPEND CXX_DEBUG_FLAGS " -g2")
+      string(APPEND C_RELWITHDEBINFO_FLAGS " -g2")
+      string(APPEND CXX_RELWITHDEBINFO_FLAGS " -g2")
+      # without -O1, emscripten executables are *MASSIVE*. Don't use -O0
+      if(NOT CMAKE_C_FLAGS_DEBUG MATCHES "-O")
+        string(APPEND C_DEBUG_FLAGS " -O1")
+      endif()
+      if(NOT CMAKE_CXX_FLAGS_DEBUG MATCHES "-O")
+        string(APPEND CXX_DEBUG_FLAGS " -O1")
+      endif()
+    else()
+      if(NOT CMAKE_C_FLAGS_DEBUG MATCHES "-O")
+        string(APPEND C_DEBUG_FLAGS " -O0")
+      endif()
+      if(NOT CMAKE_CXX_FLAGS_DEBUG MATCHES "-O")
+        string(APPEND CXX_DEBUG_FLAGS " -O0")
+      endif()
+
+      if(ARROW_GGDB_DEBUG)
+        string(APPEND C_DEBUG_FLAGS " -ggdb")
+        string(APPEND CXX_DEBUG_FLAGS " -ggdb")
+        string(APPEND C_RELWITHDEBINFO_FLAGS " -ggdb")
+        string(APPEND CXX_RELWITHDEBINFO_FLAGS " -ggdb")
+      endif()
+
     endif()
+

Review Comment:
   ```suggestion
   ```



##########
cpp/src/arrow/io/file_test.cc:
##########


Review Comment:
   Could you add `#include "arrow/util/future.h"` for `ARROW_ENABLE_THREADING`?



##########
cpp/src/arrow/util/counting_semaphore_test.cc:
##########


Review Comment:
   Could you add `#include "arrow/util/future.h"` for `ARROW_ENABLE_THREADING`?



##########
cpp/src/arrow/util/future_test.cc:
##########


Review Comment:
   Could you add `#include "arrow/util/future.h"` for `ARROW_ENABLE_THREADING`?



##########
cpp/src/arrow/util/io_util_test.cc:
##########


Review Comment:
   Could you add `#include "arrow/util/future.h"` for `ARROW_ENABLE_THREADING`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to