drogon icon indicating copy to clipboard operation
drogon copied to clipboard

FindFilesystem.cmake not work on clang20 in centos

Open rc-power opened this issue 5 months ago • 0 comments

Notice If you need support or clarification regarding the usage of Drogon in your project, visit the official Drogon support channel at gitter

Please create a new issue only if you think you have found a bug or if have a feature request/enhancement.

Describe the bug In output

-- Performing Test CXX_FILESYSTEM_NO_LINK_NEEDED
-- Performing Test CXX_FILESYSTEM_NO_LINK_NEEDED - Failed
-- Performing Test CXX_FILESYSTEM_STDCPPFS_NEEDED
-- Performing Test CXX_FILESYSTEM_STDCPPFS_NEEDED - Failed
-- Performing Test CXX_FILESYSTEM_CPPFS_NEEDED
-- Performing Test CXX_FILESYSTEM_CPPFS_NEEDED - Failed

In FindFilesystem.cmake

#HACK: Needed to compile correctly on Yocto Linux
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
    OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
    set(CMAKE_REQUIRED_FLAGS ${prev_req_flags} -std=c++17)
    #  ----------------------- should add this ------------------------
    set(CMAKE_REQUIRED_LIBRARIES ${prev_libraries} -lstdc++)
endif ()

To Reproduce Steps to reproduce the behavior: 1.install clang on centos 9 2.compile project use c++20

Expected behavior

-- Performing Test CXX_FILESYSTEM_NO_LINK_NEEDED
-- Performing Test CXX_FILESYSTEM_NO_LINK_NEEDED - Success

Screenshots If applicable, add screenshots to help explain your problem.

Image

rc-power avatar Jul 11 '25 14:07 rc-power