nlohmann / fifo_map

a FIFO-ordered associative container for C++
MIT License
179 stars 77 forks source link

Clang libstdc++ failed with gcc #11

Closed alexcvc closed 3 years ago

alexcvc commented 3 years ago

It is about

    set(CMAKE_CXX_FLAGS
        "-std=c++11 -stdlib=libc++"
    )

In general, only clang supports libstdc++.

-stdlib=<library>
Specify the C++ standard library to use; supported options are libstdc++ and libc++. If not specified, platform default will be used. 

It doesn't work with gcc and github CI. If I use fifo_map as submodule, immediately occurs error in cmake routine

[  3%] Building CXX object external/fifo_map/CMakeFiles/unit.dir/test/unit.cpp.o
c++: error: unrecognized command line option '-stdlib=libc++'
external/fifo_map/CMakeFiles/unit.dir/build.make:79: recipe for target 'external/fifo_map/CMakeFiles/unit.dir/test/unit.cpp.o' failed
make[2]: *** [external/fifo_map/CMakeFiles/unit.dir/test/unit.cpp.o] Error 1
CMakeFiles/Makefile2:197: recipe for target 'external/fifo_map/CMakeFiles/unit.dir/all' failed
make[1]: *** [external/fifo_map/CMakeFiles/unit.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Looking forward to your reply!