diff --git a/cmake/render-test.cmake b/cmake/render-test.cmake index 6505cc73f..32a7965f5 100644 --- a/cmake/render-test.cmake +++ b/cmake/render-test.cmake @@ -4,11 +4,7 @@ add_executable(mbgl-render-test render-test/runner.cpp ) -if(APPLE) - target_link_libraries(mbgl-render-test PRIVATE mbgl-loop-darwin) -else() - target_link_libraries(mbgl-render-test PRIVATE mbgl-loop-uv) -endif() +target_link_libraries(mbgl-render-test PRIVATE mbgl-loop-uv) target_include_directories(mbgl-render-test PRIVATE src diff --git a/include/mbgl/util/string.hpp b/include/mbgl/util/string.hpp index 1e0f512ba..afe573762 100644 --- a/include/mbgl/util/string.hpp +++ b/include/mbgl/util/string.hpp @@ -47,6 +47,10 @@ inline std::string toString(uint8_t t) { return toString(static_cast(t)); } +inline std::string toString(long t) { + return toString(static_cast(t)); +} + template ::value>> inline std::string toString(unsigned long t) { return toString(static_cast(t)); diff --git a/platform/default/src/mbgl/storage/http_file_source.cpp b/platform/default/src/mbgl/storage/http_file_source.cpp index 213b53de9..552e73b9a 100644 --- a/platform/default/src/mbgl/storage/http_file_source.cpp +++ b/platform/default/src/mbgl/storage/http_file_source.cpp @@ -71,9 +71,9 @@ static void* load(const char* name) { __attribute__((constructor)) static void load() { assert(!handle); - handle = dlopen("libcurl.so.4", RTLD_LAZY | RTLD_LOCAL); + handle = dlopen("libcurl.4.dylib", RTLD_LAZY | RTLD_LOCAL); if (!handle) { - fprintf(stderr, "Could not open shared library '%s'\n", "libcurl.so.4"); + fprintf(stderr, "Could not open shared library '%s'\n", "libcurl.4.dylib"); abort(); } diff --git a/platform/default/src/mbgl/util/thread.cpp b/platform/default/src/mbgl/util/thread.cpp index 28772d956..d29de0321 100644 --- a/platform/default/src/mbgl/util/thread.cpp +++ b/platform/default/src/mbgl/util/thread.cpp @@ -18,20 +18,29 @@ std::string getCurrentThreadName() { } void setCurrentThreadName(const std::string& name) { +#if (defined(__APPLE__) && defined(__MACH__)) + std::string qualifiedName = "com.mapbox.mbgl." + name; + pthread_setname_np(qualifiedName.c_str()); +#else if (name.size() > 15) { // Linux hard limit (see manpages). pthread_setname_np(pthread_self(), name.substr(0, 15).c_str()); } else { pthread_setname_np(pthread_self(), name.c_str()); } +#endif } void makeThreadLowPriority() { +#if (defined(__APPLE__) && defined(__MACH__)) + //Log::Warning(Event::General, "Couldn't set thread scheduling policy"); +#else struct sched_param param; param.sched_priority = 0; if (sched_setscheduler(0, SCHED_IDLE, ¶m) != 0) { Log::Warning(Event::General, "Couldn't set thread scheduling policy"); } +#endif } void attachThread() { diff --git a/platform/linux/config.cmake b/platform/linux/config.cmake index aa65ddb60..7d55cbd60 100644 --- a/platform/linux/config.cmake +++ b/platform/linux/config.cmake @@ -102,6 +102,7 @@ macro(mbgl_platform_core) PUBLIC -lz ) + # Linux only if(WITH_CXX11ABI) # Statically link libstdc++ when we're using the new STL ABI target_link_libraries(mbgl-core @@ -120,7 +121,7 @@ macro(mbgl_filesource) # link the library anyway since we're definitely going to load it on startup anyway. target_link_libraries(mbgl-filesource PUBLIC sqlite - PUBLIC -Wl,--no-as-needed -lcurl -Wl,--as-needed + PUBLIC -lcurl ) endmacro()