mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-25 06:31:07 +02:00
Improve QNX support
This cherry-picks the source changes from PR made by @pkleymonov-qnx, without including the build path changes that are irrelevant unless we can add a QNX target to our CI. Close #2953
This commit is contained in:
@@ -161,7 +161,11 @@ namespace {
|
|||||||
#endif // Windows/ ANSI/ None
|
#endif // Windows/ ANSI/ None
|
||||||
|
|
||||||
|
|
||||||
#if defined( CATCH_PLATFORM_LINUX ) || defined( CATCH_PLATFORM_MAC ) || defined( __GLIBC__ ) || defined(__FreeBSD__)
|
#if defined( CATCH_PLATFORM_LINUX ) \
|
||||||
|
|| defined( CATCH_PLATFORM_MAC ) \
|
||||||
|
|| defined( __GLIBC__ ) \
|
||||||
|
|| defined( __FreeBSD__ ) \
|
||||||
|
|| defined( CATCH_PLATFORM_QNX )
|
||||||
# define CATCH_INTERNAL_HAS_ISATTY
|
# define CATCH_INTERNAL_HAS_ISATTY
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
@@ -69,7 +69,7 @@
|
|||||||
#endif
|
#endif
|
||||||
} // namespace Catch
|
} // namespace Catch
|
||||||
|
|
||||||
#elif defined(CATCH_PLATFORM_LINUX)
|
#elif defined(CATCH_PLATFORM_LINUX) || defined(CATCH_PLATFORM_QNX)
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@@ -49,7 +49,7 @@ namespace Catch {
|
|||||||
#define CATCH_TRAP() __asm__(".inst 0xde01")
|
#define CATCH_TRAP() __asm__(".inst 0xde01")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#elif defined(CATCH_PLATFORM_LINUX)
|
#elif defined(CATCH_PLATFORM_LINUX) || defined(CATCH_PLATFORM_QNX)
|
||||||
// If we can use inline assembler, do it because this allows us to break
|
// If we can use inline assembler, do it because this allows us to break
|
||||||
// directly at the location of the failing check instead of breaking inside
|
// directly at the location of the failing check instead of breaking inside
|
||||||
// raise() called from it, i.e. one stack frame below.
|
// raise() called from it, i.e. one stack frame below.
|
||||||
|
@@ -25,6 +25,9 @@
|
|||||||
#elif defined(linux) || defined(__linux) || defined(__linux__)
|
#elif defined(linux) || defined(__linux) || defined(__linux__)
|
||||||
# define CATCH_PLATFORM_LINUX
|
# define CATCH_PLATFORM_LINUX
|
||||||
|
|
||||||
|
#elif defined(__QNX__)
|
||||||
|
# define CATCH_PLATFORM_QNX
|
||||||
|
|
||||||
#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__)
|
#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__)
|
||||||
# define CATCH_PLATFORM_WINDOWS
|
# define CATCH_PLATFORM_WINDOWS
|
||||||
|
|
||||||
|
@@ -95,7 +95,7 @@ foreach(target DisabledExceptions-DefaultHandler DisabledExceptions-CustomHandle
|
|||||||
target_compile_options(${target}
|
target_compile_options(${target}
|
||||||
PUBLIC
|
PUBLIC
|
||||||
$<$<CXX_COMPILER_ID:MSVC>:/EHs-c-;/D_HAS_EXCEPTIONS=0>
|
$<$<CXX_COMPILER_ID:MSVC>:/EHs-c-;/D_HAS_EXCEPTIONS=0>
|
||||||
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:AppleClang>>:-fno-exceptions>
|
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:QCC>,$<CXX_COMPILER_ID:AppleClang>>:-fno-exceptions>
|
||||||
)
|
)
|
||||||
target_link_libraries(${target} Catch2_buildall_interface)
|
target_link_libraries(${target} Catch2_buildall_interface)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
Reference in New Issue
Block a user