mirror of
https://github.com/yse/easy_profiler.git
synced 2024-12-26 16:11:02 +08:00
Support build with QNX 7.0 toolchain
Steps to build: 1. Source qnx700-env.sh 2. Use QNXToolchain.cmake to build: cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/QNXToolchain.cmake ../
This commit is contained in:
parent
0567f2db54
commit
19237c3c52
@ -220,9 +220,12 @@ easy_define_target_option(easy_profiler EASY_OPTION_PREDEFINED_COLORS EASY_OPTIO
|
|||||||
# Add platform specific compile options:
|
# Add platform specific compile options:
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
target_compile_options(easy_profiler PRIVATE -Wall -Wno-long-long -Wno-reorder -Wno-braced-scalar-init -pedantic)
|
target_compile_options(easy_profiler PRIVATE -Wall -Wno-long-long -Wno-reorder -Wno-braced-scalar-init -pedantic)
|
||||||
if (NOT ANDROID)
|
if (NOT ANDROID AND NOT QNX)
|
||||||
target_link_libraries(easy_profiler pthread)
|
target_link_libraries(easy_profiler pthread)
|
||||||
endif()
|
endif()
|
||||||
|
if (QNX)
|
||||||
|
target_link_libraries(easy_profiler socket)
|
||||||
|
endif()
|
||||||
elseif (WIN32)
|
elseif (WIN32)
|
||||||
target_compile_definitions(easy_profiler PRIVATE -D_WIN32_WINNT=0x0600 -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
target_compile_definitions(easy_profiler PRIVATE -D_WIN32_WINNT=0x0600 -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
||||||
target_link_libraries(easy_profiler ws2_32 psapi)
|
target_link_libraries(easy_profiler ws2_32 psapi)
|
||||||
|
@ -50,6 +50,10 @@ The Apache License, Version 2.0 (the "License");
|
|||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
# include <pthread.h>
|
# include <pthread.h>
|
||||||
# include <Availability.h>
|
# include <Availability.h>
|
||||||
|
#elif defined(__QNX__)
|
||||||
|
# include <sys/mman.h>
|
||||||
|
# include <process.h>
|
||||||
|
# define __NR_gettid SYS_gettid
|
||||||
#else
|
#else
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
@ -70,6 +74,9 @@ inline profiler::thread_id_t getCurrentThreadId()
|
|||||||
# else
|
# else
|
||||||
return (profiler::thread_id_t)pthread_self();
|
return (profiler::thread_id_t)pthread_self();
|
||||||
# endif
|
# endif
|
||||||
|
#elif defined(__QNX__)
|
||||||
|
EASY_THREAD_LOCAL static const profiler::thread_id_t _id = (profiler::thread_id_t)gettid();
|
||||||
|
return _id;
|
||||||
#else
|
#else
|
||||||
EASY_THREAD_LOCAL static const profiler::thread_id_t _id = (profiler::thread_id_t)syscall(__NR_gettid);
|
EASY_THREAD_LOCAL static const profiler::thread_id_t _id = (profiler::thread_id_t)syscall(__NR_gettid);
|
||||||
return _id;
|
return _id;
|
||||||
|
@ -43,6 +43,9 @@ limitations under the License.
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
#if defined(__QNX__)
|
||||||
|
# include <sys/time.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
# pragma comment (lib, "Ws2_32.lib")
|
# pragma comment (lib, "Ws2_32.lib")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user