Repository: conan-io/conan-center-index

Issue:
[package] backward-cpp/1.5: can't build with mingw
<!-- 
  Please don't forget to update the issue title.
  Include all applicable information to help us reproduce your problem.
-->

### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **backward-cpp/1.5**
  * Operating System+version: **Windows 10**
  * Conan version: **conan 1.38.0**

### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
```
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.threads=posix
compiler.version=8.1
os=Windows
os_build=Windows
[options]
[build_requires]
*: mingw-w64/8.1, msys2/cci.latest
[env]
```


### Steps to reproduce (Include if Applicable)
 conan install backward-cpp/1.5@ -pr mingw --build outdated -u


### Logs (Include/Attach if Applicable)
<details><summary>Click to expand log</summary>

```
conan install backward-cpp/1.5@ -pr mingw --build missing
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.threads=posix
compiler.version=8.1
os=Windows
os_build=Windows
[options]
[build_requires]
*: mingw-w64/8.1, msys2/cci.latest
[env]

You pressed Ctrl+C!
ERROR: Exiting with code: 3
PS C:\Users\AndreiMalashkin\sources\pictofitstudio> conan install backward-cpp/1.5@ -pr mingw --build outdated -u
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.threads=posix
compiler.version=8.1
os=Windows
os_build=Windows
[options]
[build_requires]
*: mingw-w64/8.1, msys2/cci.latest
[env]

mingw-w64/8.1: Package is up to date
msys2/cci.latest: WARN: Current package is newer than remote upstream one
msys2/cci.latest: Package is up to date
Installing package: backward-cpp/1.5
Requirements
    backward-cpp/1.5 from 'artifactory' - Cache
Packages
    backward-cpp/1.5:4b8d03cfef6f209236f18445b773d36681be0d57 - Build
Build requirements
    mingw-w64/8.1 from 'conancenter' - Cache
    msys2/cci.latest from 'conancenter' - Cache
Build requirements packages
    mingw-w64/8.1:6903a9d1b48b06f7fbe0929db654512c77e6cc32 - Cache
    msys2/cci.latest:eee3fba89db6d777329de604625af8c30d46f080 - Cache

Installing (downloading, building) binaries...
mingw-w64/8.1: Already installed!
mingw-w64/8.1: Appending PATH env var with : C:\Users\AndreiMalashkin\.conan\data\mingw-w64\8.1\_\_\package\6903a9d1b48b06f7fbe0929db654512c77e6cc32\bin
msys2/cci.latest: Already installed!
msys2/cci.latest: Creating MSYS_ROOT env var : C:\.conan\ce84ae\1\bin\msys64
msys2/cci.latest: Creating MSYS_BIN env var : C:\.conan\ce84ae\1\bin\msys64\usr\bin
msys2/cci.latest: Appending PATH env var with : C:\.conan\ce84ae\1\bin\msys64\usr\bin
backward-cpp/1.5: Applying build-requirement: mingw-w64/8.1
backward-cpp/1.5: Applying build-requirement: msys2/cci.latest
backward-cpp/1.5: WARN: Build folder is dirty, removing it: C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57
backward-cpp/1.5: Copying sources to build folder
backward-cpp/1.5: Building your package in C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57
backward-cpp/1.5: Generator cmake created conanbuildinfo.cmake
backward-cpp/1.5: Aggregating env generators
backward-cpp/1.5: Calling build()
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/bin/g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: called by CMake conan helper
-- Conan: called inside local cache
-- Conan: Adjusting output directories
-- Conan: Using cmake global configuration
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Conan: Compiler GCC>=5, checking major version 8.1
-- Conan: Checking correct version: 8.1
-- Conan: C++ stdlib: libstdc++11
-- Found Backward: C:/Users/AndreiMalashkin/.conan/data/backward-cpp/1.5/_/_/build/4b8d03cfef6f209236f18445b773d36681be0d57/source_subfolder
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_EXPORT_NO_PACKAGE_REGISTRY


-- Build files have been written to: C:/Users/AndreiMalashkin/.conan/data/backward-cpp/1.5/_/_/build/4b8d03cfef6f209236f18445b773d36681be0d57/build_subfolder
[ 66%] [ 66%] Building CXX object source_subfolder/CMakeFiles/backward.dir/backward.cpp.obj
Building CXX object source_subfolder/CMakeFiles/backward_object.dir/backward.cpp.obj
In file included from C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.cpp:26:
C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:317: warning: "NOMINMAX" redefined
 #define NOMINMAX

In file included from C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/x86_64-w64-mingw32/bits/c++config.h:508,
                 from C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/utility:68,
                 from C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/algorithm:60,
                 from C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:73,
                 from C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.cpp:26:
C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/x86_64-w64-mingw32/bits/os_defines.h:45: note: this is the location of the previous definition
 #define NOMINMAX 1

In file included from C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.cpp:26:
C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:317: warning: "NOMINMAX" redefined
 #define NOMINMAX

In file included from C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/x86_64-w64-mingw32/bits/c++config.h:508,
                 from C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/utility:68,
                 from C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/algorithm:60,
                 from C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:73,
                 from C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.cpp:26:
C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/x86_64-w64-mingw32/bits/os_defines.h:45: note: this is the location of the previous definition
 #define NOMINMAX 1

In file included from C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.cpp:26:
C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:329: warning: ignoring #pragma comment  [-Wunknown-pragmas]
 #pragma comment(lib, "psapi.lib")

C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:330: warning: ignoring #pragma comment  [-Wunknown-pragmas]
 #pragma comment(lib, "dbghelp.lib")

In file included from C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.cpp:26:
C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:329: warning: ignoring #pragma comment  [-Wunknown-pragmas]
 #pragma comment(lib, "psapi.lib")

C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:330: warning: ignoring #pragma comment  [-Wunknown-pragmas]
 #pragma comment(lib, "dbghelp.lib")

In file included from C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.cpp:26:
C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp: In member function 'backward::ResolvedTrace backward::TraceResolverImpl<backward::system_tag::windows_tag>::resolve(backward::ResolvedTrace)':
C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:3356:32: warning: 'memset' used with constant zero length parameter; this could be due to transposed parameters [-Wmemset-transposed-args]
     memset(&sym, sizeof(sym), 0);
                                ^
In file included from C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.cpp:26:
C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp: In member function 'backward::ResolvedTrace backward::TraceResolverImpl<backward::system_tag::windows_tag>::resolve(backward::ResolvedTrace)':
C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:3356:32: warning: 'memset' used with constant zero length parameter; this could be due to transposed parameters [-Wmemset-transposed-args]
     memset(&sym, sizeof(sym), 0);
                                ^
C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp: In constructor 'backward::SignalHandling::SignalHandling(const std::vector<int>&)':
C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:4018:5: error: 'set_terminate' was not declared in this scope
     set_terminate(&terminator);
     ^~~~~~~~~~~~~
C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:4018:5: note: suggested alternative:
In file included from C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/new:40,
                 from
rd-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:
                 from  In constructor 'C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_tempbuf.h:60backward::SignalHandling::SignalHandling(const std::vector<int>&),
                 from ':
C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_algo.h:62C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:4018:5:,
                 from  C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/algorithm:62error: ,
                 from 'C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:73set_terminate,
                 from ' was not declared in this scope
     C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.cpp:26set_terminate:
(&terminator);
     C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/exception:67:21:^~~~~~~~~~~~~
note:   'std::set_terminate'
   terminate_handler set_terminate(terminate_handler) _GLIBCXX_USE_NOEXCEPT;
                     C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:4018:5:^~~~~~~~~~~~~
In file included from note: C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.cpp:26suggested alternative:
:
In file included from C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:4019:5:C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/new:40 ,
                 from error: C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_construct.h:59',
                 from set_unexpectedC:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_tempbuf.h:60' was not declared in this scope
     ,
                 from set_unexpectedC:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_algo.h:62(&terminator);
     ,
                 from ^~~~~~~~~~~~~~C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/algorithm:62
,
                 from C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:73,
                 from C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:4019:5:C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.cpp:26
note: C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/exception:67:21:suggested alternative:
In file included from  C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/new:40note: ,
                 from   'C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_construct.h:59std::set_terminate,
                 from '
   terminate_handler C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_tempbuf.h:60set_terminate,
                 from (terminate_handler) _GLIBCXX_USE_NOEXCEPT;
                     C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_algo.h:62^~~~~~~~~~~~~,
                 from
In file included from C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/algorithm:62C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.cpp:26,
                 from
C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:73C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:4019:5:,
                 from  C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.cpp:26error: :
 C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/exception:79:22:set_unexpected
     note: set_unexpected  '
     std::set_unexpected^~~~~~~~~~~~~~'
   unexpected_handler
set_unexpected(unexpected_handler) _GLIBCXX_USE_NOEXCEPT;
                      ^~~~~~~~~~~~~~
C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:4019:5: note: suggested alternative:
In file included from C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/new:40,
                 from C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_construct.h:59,
                 from C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_tempbuf.h:60,
                 from C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/stl_algo.h:62,
                 from C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/algorithm:62,
                 from C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.hpp:73,
                 from C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\source_subfolder\backward.cpp:26:
C:/Users/AndreiMalashkin/.conan/data/mingw-w64/8.1/_/_/package/6903a9d1b48b06f7fbe0929db654512c77e6cc32/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/exception:79:22: note:   'std::set_unexpected'
   unexpected_handler set_unexpected(unexpected_handler) _GLIBCXX_USE_NOEXCEPT;
                      ^~~~~~~~~~~~~~
mingw32-make.exe[2]: *** [source_subfolder\CMakeFiles\backward_object.dir\build.make:76: source_subfolder/CMakeFiles/backward_object.dir/backward.cpp.obj] Error 1
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:99: source_subfolder/CMakeFiles/backward_object.dir/all] Error 2
mingw32-make.exe[1]: *** Waiting for unfinished jobs....
mingw32-make.exe[2]: *** [source_subfolder\CMakeFiles\backward.dir\build.make:76: source_subfolder/CMakeFiles/backward.dir/backward.cpp.obj] Error 1
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:125: source_subfolder/CMakeFiles/backward.dir/all] Error 2
mingw32-make.exe: *** [Makefile:135: all] Error 2
backward-cpp/1.5:
backward-cpp/1.5: ERROR: Package '4b8d03cfef6f209236f18445b773d36681be0d57' build failed
backward-cpp/1.5: WARN: Build folder C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57
ERROR: backward-cpp/1.5: Error in build() method, line 119
        cmake.build()
        ConanException: Error 2 while executing cmake --build C:\Users\AndreiMalashkin\.conan\data\backward-cpp\1.5\_\_\build\4b8d03cfef6f209236f18445b773d36681be0d57\build_subfolder -- -j12
```

</details>



Discussion:

Resolving patch:
diff --git a/recipes/backward-cpp/all/conanfile.py b/recipes/backward-cpp/all/conanfile.py
--- a/recipes/backward-cpp/all/conanfile.py
+++ b/recipes/backward-cpp/all/conanfile.py
@@ -2,6 +2,8 @@
 from conans.errors import ConanInvalidConfiguration
 import os
 
+required_conan_version = ">=1.33.0"
+
 
 class BackwardCppConan(ConanFile):
     name = "backward-cpp"
@@ -10,25 +12,32 @@ class BackwardCppConan(ConanFile):
     url = "https://github.com/conan-io/conan-center-index"
     topics = ("conan", "backward-cpp", "stack-trace")
     license = "MIT"
-    exports_sources = [ "CMakeLists.txt", "patches/backward-cpp-*.patch" ]
-    generators = "cmake"
 
     settings = "os", "arch", "compiler", "build_type"
     options = {
-       "stack_walking" : ["unwind", "backtrace"],
-       "stack_details" : ["dw", "bfd", "dwarf", "backtrace_symbol"],
-       "shared": [True, False],
-       "fPIC": [True, False]
+        "shared": [True, False],
+        "fPIC": [True, False],
+        "stack_walking" : ["unwind", "backtrace"],
+        "stack_details" : ["dw", "bfd", "dwarf", "backtrace_symbol"],
     }
     default_options = {
-       "stack_walking": "unwind",
-       "stack_details": "dwarf",
-       "shared": False,
-       "fPIC": True
+        "shared": False,
+        "fPIC": True,
+        "stack_walking": "unwind",
+        "stack_details": "dwarf",
     }
 
-    _source_subfolder = "source_subfolder"
-    _build_subfolder = "build_subfolder"
+    exports_sources = "CMakeLists.txt", "patches/backward-cpp-*.patch"
+    generators = "cmake"
+
+    _cmake = None
+    @property
+    def _source_subfolder(self):
+        return "source_subfolder"
+
+    @property
+    def _build_subfolder(self):
+        return "build_subfolder"
 
     def _has_stack_walking(self, type):
         return self.options.stack_walking == type
@@ -46,14 +55,8 @@ def config_options(self):
             del self.options.stack_details
 
     def configure(self):
-        if self.settings.os not in self._supported_os():
-            raise ConanInvalidConfiguration("upstream backward-cpp v{0} is not \
-                supported in {1}.".format(self.version, self.settings.os))
-
-        if self.settings.os == "Macos" and \
-           not self._has_stack_details("backtrace_symbol"):
-            raise ConanInvalidConfiguration("only stack_details=backtrace_symbol"
-                                            " is supported on Macos")
+        if self.options.shared:
+            del self.options.fPIC
 
     def requirements(self):
         if self.settings.os in ["Linux", "Android"] and \
@@ -88,30 +91,39 @@ def system_requirements(self):
             if not installer.installed(required_package):
                 raise ConanInvalidConfiguration("backward-cpp requires {}.".format(required_package))
 
+    def validate(self):
+        if self.settings.os not in self._supported_os():
+            raise ConanInvalidConfiguration("upstream backward-cpp v{0} is not"
+                " supported in {1}.".format(self.version, self.settings.os))
+
+        if self.settings.os == "Macos" and \
+                not self._has_stack_details("backtrace_symbol"):
+            raise ConanInvalidConfiguration("only stack_details=backtrace_symbol"
+                                            " is supported on Macos")
+
     def source(self):
-        tools.get(**self.conan_data["sources"][self.version])
-        extracted_dir = self.name + "-" + self.version
-        os.rename(extracted_dir, self._source_subfolder)
+        tools.get(**self.conan_data["sources"][self.version],
+                  destination=self._source_subfolder, strip_root=True)
 
     def _configure_cmake(self):
-        cmake = CMake(self)
-        cmake.definitions['STACK_WALKING_UNWIND'] = self._has_stack_walking("unwind")
-        cmake.definitions['STACK_WALKING_BACKTRACE'] = self._has_stack_walking("backtrace")
-        cmake.definitions['STACK_DETAILS_AUTO_DETECT'] = False
-        cmake.definitions['STACK_DETAILS_BACKTRACE_SYMBOL'] = self._has_stack_details("backtrace_symbol")
-        cmake.definitions['STACK_DETAILS_DW'] = self._has_stack_details("dw")
-        cmake.definitions['STACK_DETAILS_BFD'] = self._has_stack_details("bfd")
-        cmake.definitions['STACK_DETAILS_DWARF'] = self._has_stack_details("dwarf")
-        cmake.definitions['BACKWARD_SHARED'] = self.options.shared
-        cmake.definitions['BACKWARD_TESTS'] = False
-        cmake.configure(build_folder=self._build_subfolder)
-        return cmake
+        if self._cmake:
+            return self._cmake
+        self._cmake = CMake(self)
+        self._cmake.definitions["STACK_WALKING_UNWIND"] = self._has_stack_walking("unwind")
+        self._cmake.definitions["STACK_WALKING_BACKTRACE"] = self._has_stack_walking("backtrace")
+        self._cmake.definitions["STACK_DETAILS_AUTO_DETECT"] = False
+        self._cmake.definitions["STACK_DETAILS_BACKTRACE_SYMBOL"] = self._has_stack_details("backtrace_symbol")
+        self._cmake.definitions["STACK_DETAILS_DW"] = self._has_stack_details("dw")
+        self._cmake.definitions["STACK_DETAILS_BFD"] = self._has_stack_details("bfd")
+        self._cmake.definitions["STACK_DETAILS_DWARF"] = self._has_stack_details("dwarf")
+        self._cmake.definitions["BACKWARD_SHARED"] = self.options.shared
+        self._cmake.definitions["BACKWARD_TESTS"] = False
+        self._cmake.configure(build_folder=self._build_subfolder)
+        return self._cmake
 
     def _patch_sources(self):
-        if "patches" in self.conan_data:
-            if self.version in self.conan_data["patches"]:
-                for patch in self.conan_data["patches"][self.version]:
-                    tools.patch(**patch)
+        for patch in self.conan_data.get("patches", {}).get(self.version, []):
+            tools.patch(**patch)
 
     def build(self):
         self._patch_sources()
@@ -119,23 +131,23 @@ def build(self):
         cmake.build()
 
     def package(self):
+        self.copy(pattern="LICENSE*", dst="licenses", src=self._source_subfolder)
         cmake = self._configure_cmake()
         cmake.install()
-        self.copy(pattern="LICENSE*", dst="licenses", src=self._source_subfolder)
         os.remove(os.path.join(self.package_folder, "lib", "backward", "BackwardConfig.cmake"))
 
     def package_info(self):
         self.cpp_info.names["cmake_find_package"] = "Backward"
         self.cpp_info.names["cmake_find_package_multi"] = "Backward"
 
-        self.cpp_info.defines.append('BACKWARD_HAS_UNWIND={}'.format(int(self._has_stack_walking("unwind"))))
-        self.cpp_info.defines.append('BACKWARD_HAS_BACKTRACE={}'.format(int(self._has_stack_walking("backtrace"))))
+        self.cpp_info.defines.append("BACKWARD_HAS_UNWIND={}".format(int(self._has_stack_walking("unwind"))))
+        self.cpp_info.defines.append("BACKWARD_HAS_BACKTRACE={}".format(int(self._has_stack_walking("backtrace"))))
 
-        self.cpp_info.defines.append('BACKWARD_HAS_BACKTRACE_SYMBOL={}'.format(int(self._has_stack_details("backtrace_symbol"))))
-        self.cpp_info.defines.append('BACKWARD_HAS_DW={}'.format(int(self._has_stack_details("dw"))))
-        self.cpp_info.defines.append('BACKWARD_HAS_BFD={}'.format(int(self._has_stack_details("bfd"))))
-        self.cpp_info.defines.append('BACKWARD_HAS_DWARF={}'.format(int(self._has_stack_details("dwarf"))))
-        self.cpp_info.defines.append('BACKWARD_HAS_PDB_SYMBOL={}'.format(int(self.settings.os == "Windows")))
+        self.cpp_info.defines.append("BACKWARD_HAS_BACKTRACE_SYMBOL={}".format(int(self._has_stack_details("backtrace_symbol"))))
+        self.cpp_info.defines.append("BACKWARD_HAS_DW={}".format(int(self._has_stack_details("dw"))))
+        self.cpp_info.defines.append("BACKWARD_HAS_BFD={}".format(int(self._has_stack_details("bfd"))))
+        self.cpp_info.defines.append("BACKWARD_HAS_DWARF={}".format(int(self._has_stack_details("dwarf"))))
+        self.cpp_info.defines.append("BACKWARD_HAS_PDB_SYMBOL={}".format(int(self.settings.os == "Windows")))
 
         self.cpp_info.libs = tools.collect_libs(self)
         if self.settings.os == "Linux":


Test patch:
diff --git a/recipes/backward-cpp/all/test_package/CMakeLists.txt b/recipes/backward-cpp/all/test_package/CMakeLists.txt
--- a/recipes/backward-cpp/all/test_package/CMakeLists.txt
+++ b/recipes/backward-cpp/all/test_package/CMakeLists.txt
@@ -1,32 +1,8 @@
 cmake_minimum_required(VERSION 3.1)
 project(test_package CXX)
 
-set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
-
-# Force test_package to be generated in build_folder (CMAKE_BINARY_DIR)
-# so we get same behaviour between Unix Makefiles & Visual studio generator
-
-# First for the generic no-config case (e.g. with mingw)
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
-# Second, for multi-config builds (e.g. msvc)
-foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
-    string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
-    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR})
-endforeach(OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES)
-
-if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
-    if (CMAKE_BUILD_TYPE MATCHES "Debug" AND MSVC_RUNTIME_TYPE)
-        set (MSVC_RUNTIME_TYPE "${MSVC_RUNTIME_TYPE}d")
-    endif ()
-
-    set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${MSVC_RUNTIME_TYPE}")
-    set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${MSVC_RUNTIME_TYPE}")
-    set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${MSVC_RUNTIME_TYPE}")
-    set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/PROFILE")
-
-    message (STATUS "Build type: ${CMAKE_BUILD_TYPE}")
-    message (STATUS "USE MSVC RUNTIME: ${MSVC_RUNTIME_TYPE}")
-endif()
+include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
+conan_basic_setup(TARGETS)
 
 find_package(Backward REQUIRED)
 
diff --git a/recipes/backward-cpp/all/test_package/conanfile.py b/recipes/backward-cpp/all/test_package/conanfile.py
--- a/recipes/backward-cpp/all/test_package/conanfile.py
+++ b/recipes/backward-cpp/all/test_package/conanfile.py
@@ -4,18 +4,14 @@
 
 class TestPackageConan(ConanFile):
     settings = "os", "compiler", "build_type", "arch"
-    generators = "cmake_find_package"
+    generators = "cmake", "cmake_find_package"
 
     def build(self):
         cmake = CMake(self)
-        compiler = self.settings.compiler
-        if compiler == 'Visual Studio':
-            runtime = str(self.settings.compiler.runtime)
-            cmake.definitions["MSVC_RUNTIME_TYPE"] = '/' + runtime
         cmake.configure()
         cmake.build()
 
     def test(self):
-        if not tools.cross_building(self.settings):
-            bin_path = os.path.join(self.build_folder, "test_package")
+        if not tools.cross_building(self):
+            bin_path = os.path.join("bin", "test_package")
             self.run(bin_path, run_environment=True)