Fix build for QNX

This commit is contained in:
Jay 2023-02-14 14:27:31 +09:00
parent b668742447
commit c79ae36c2a
3 changed files with 6 additions and 4 deletions

View File

@ -159,8 +159,8 @@ else()
target_link_libraries(Foundation PUBLIC ${CMAKE_DL_LIBS})
else()
target_compile_definitions(Foundation PUBLIC _REENTRANT _THREAD_SAFE _LARGEFILE64_SOURCE _FILE_OFFSET_BITS=64)
if(QNX)
target_compile_definitions(Foundation PUBLIC POCO_HAVE_FD_POLL)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "QNX")
target_compile_definitions(Foundation PUBLIC _QNX_SOURCE=1 POCO_HAVE_FD_POLL)
target_link_libraries(Foundation PUBLIC m socket)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
target_compile_definitions(Foundation PUBLIC POCO_HAVE_FD_POLL)

View File

@ -42,14 +42,14 @@ using UIntPtr = std::uintptr_t;
#define POCO_PTR_IS_64_BIT 1
#endif
#define POCO_HAVE_INT64 1
#elif defined(__GNUC__) || defined(__clang__)
#elif defined(__GNUC__) || defined(__clang__) || defined(__QNX__)
#if defined(_WIN64)
#define POCO_PTR_IS_64_BIT 1
#else
#if defined(__LP64__)
#define POCO_PTR_IS_64_BIT 1
#define POCO_LONG_IS_64_BIT 1
#if POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_FREE_BSD || POCO_OS == POCO_OS_ANDROID || POCO_OS == POCO_OS_AIX
#if POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_FREE_BSD || POCO_OS == POCO_OS_ANDROID || POCO_OS == POCO_OS_AIX || POCO_OS == POCO_OS_QNX
#define POCO_INT64_IS_LONG 1
#endif
#endif

View File

@ -33,6 +33,7 @@ macro(check_for_cxx11_compiler _VAR)
endif()
if(_COMPILER_TEST_RESULT AND ((MSVC AND (MSVC10 OR MSVC11 OR MSVC12 OR MSVC14)) OR
(CMAKE_COMPILER_IS_GNUCXX AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.8.1) OR
(CMAKE_CXX_COMPILER_ID STREQUAL "QCC" AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.8.1) OR
(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 3.3) OR
(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")))
set(${_VAR} 1)
@ -57,6 +58,7 @@ macro(check_for_cxx14_compiler _VAR)
endif()
if(_COMPILER_TEST_RESULT AND ((MSVC AND (MSVC14)) OR
(CMAKE_COMPILER_IS_GNUCXX AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.9.2) OR
(CMAKE_CXX_COMPILER_ID STREQUAL "QCC" AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.9.2) OR
(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 3.4) OR
(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")))
set(${_VAR} 1)