mirror of
https://github.com/drogonframework/drogon.git
synced 2025-09-28 00:00:52 -04:00
Fix Drogon not building caused by FindFilesystem (#1056)
* fix FindFilesystem not using the correct header for printf * fix FS not found on Yocto
This commit is contained in:
parent
5a03c9aa9f
commit
e2eb674781
@ -191,7 +191,11 @@ if(NEED_BOOST_FS)
|
||||
option(HAS_STD_FILESYSTEM_PATH "use boost::filesystem" OFF)
|
||||
else()
|
||||
option(HAS_STD_FILESYSTEM_PATH "use std::filesystem" ON)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC std::filesystem)
|
||||
# HACK: Needed to be compiled on Yocto Linux
|
||||
get_property(CAN_LINK_FS TARGET std::filesystem PROPERTY INTERFACE_LINK_LIBRARIES DEFINED)
|
||||
if ( CAN_LINK_FS )
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC std::filesystem)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# jsoncpp
|
||||
|
@ -194,7 +194,7 @@ set(_found FALSE)
|
||||
if(CXX_FILESYSTEM_HAVE_FS)
|
||||
# We have some filesystem library available. Do link checks
|
||||
string(CONFIGURE [[
|
||||
#include <cstdlib>
|
||||
#include <cstdio>
|
||||
#include <@CXX_FILESYSTEM_HEADER@>
|
||||
|
||||
int main() {
|
||||
@ -204,6 +204,11 @@ if(CXX_FILESYSTEM_HAVE_FS)
|
||||
}
|
||||
]] code @ONLY)
|
||||
|
||||
# HACK: Needed to compile correctly on Yocto Linux
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GCC" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
|
||||
OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
||||
set(CMAKE_REQUIRED_FLAGS ${prev_req_flags} -std=c++17)
|
||||
endif ()
|
||||
# Check a simple filesystem program without any linker flags
|
||||
_cmcm_check_cxx_source("${code}" CXX_FILESYSTEM_NO_LINK_NEEDED)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user