From 997643ff7457af3cbea790401a7f4084bafffbed Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@uliege.be>
Date: Tue, 27 Jun 2023 15:24:25 +0200
Subject: [PATCH] revert no_compact_unwind: it breaks exception handling

---
 CMakeLists.txt           | 5 +++--
 examples/example.cmake   | 5 +++--
 tutorials/tutorial.cmake | 5 +++--
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3dc507c1..88afebdf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -128,9 +128,10 @@ if(HAVE_DEPRECATED)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
 endif()
 
-# remove "could not create compact unwind" linker warnings on macOS
+# remove "could not create compact unwind" linker warnings on macOS; but breaks
+# exception handling
 if(APPLE)
-  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-no_compact_unwind")
+  #  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-no_compact_unwind")
 endif()
 
 opt(MPI "Enable MPI" OFF)
diff --git a/examples/example.cmake b/examples/example.cmake
index 3cfc4f57..41b59be4 100644
--- a/examples/example.cmake
+++ b/examples/example.cmake
@@ -40,9 +40,10 @@ if(HAVE_DEPRECATED)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
 endif()
 
-# remove "could not create compact unwind" linker warnings on macOS
+# remove "could not create compact unwind" linker warnings on macOS; but breaks
+# exception handling
 if(APPLE)
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-no_compact_unwind")
+  # set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-no_compact_unwind")
 endif()
 
 # Find Gmsh
diff --git a/tutorials/tutorial.cmake b/tutorials/tutorial.cmake
index 4ccd602a..789553d6 100644
--- a/tutorials/tutorial.cmake
+++ b/tutorials/tutorial.cmake
@@ -40,9 +40,10 @@ if(HAVE_DEPRECATED)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
 endif()
 
-# remove "could not create compact unwind" linker warnings on macOS
+# remove "could not create compact unwind" linker warnings on macOS; but breaks
+# exception handling
 if(APPLE)
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-no_compact_unwind")
+  # set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-no_compact_unwind")
 endif()
 
 # Find Gmsh
-- 
GitLab