I have a small C++ program that I need to use exceptions in. When I try to compile it I get the error:

```
error: exception handling disabled, use '-fexceptions' to enable

```

In my CMakeLists.txt I set the C++ version to 11 and enable `-fexceptions`

```
set(CMAKE_CXX_STANDARD 11)
...
target_compile_options (test PUBLIC -fexceptions)

```

Edit: for future readers this is for a Raspberry Pi Pico, and I found the answer.