Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support build with QNX 7.0 toolchain #145

Merged
merged 1 commit into from
Jan 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion easy_profiler_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,12 @@ easy_define_target_option(easy_profiler EASY_OPTION_PREDEFINED_COLORS EASY_OPTIO
# Add platform specific compile options:
if (UNIX)
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)
endif()
if (QNX)
target_link_libraries(easy_profiler socket)
endif()
elseif (WIN32)
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)
Expand Down
7 changes: 7 additions & 0 deletions easy_profiler_core/current_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ The Apache License, Version 2.0 (the "License");
#elif defined(__APPLE__)
# include <pthread.h>
# include <Availability.h>
#elif defined(__QNX__)
# include <sys/mman.h>
# include <process.h>
# define __NR_gettid SYS_gettid
#else
# include <sys/types.h>
# include <unistd.h>
Expand All @@ -70,6 +74,9 @@ inline profiler::thread_id_t getCurrentThreadId()
# else
return (profiler::thread_id_t)pthread_self();
# endif
#elif defined(__QNX__)
EASY_THREAD_LOCAL static const profiler::thread_id_t _id = (profiler::thread_id_t)gettid();
return _id;
#else
EASY_THREAD_LOCAL static const profiler::thread_id_t _id = (profiler::thread_id_t)syscall(__NR_gettid);
return _id;
Expand Down
3 changes: 3 additions & 0 deletions easy_profiler_core/easy_socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ limitations under the License.
#include <string.h>
#include <thread>
#include <limits>
#if defined(__QNX__)
# include <sys/time.h>
#endif

#if defined(_WIN32)
# pragma comment (lib, "Ws2_32.lib")
Expand Down