summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-10-28 12:47:58 -0400
committerKonstantin Käfer <mail@kkaefer.com>2014-10-28 12:47:58 -0400
commitdbddd3c904d34eecdda4bb7d1d0dc30c4ea7e13b (patch)
treec3f40984bd0ec4cf136ad90de871b5e87a55062b
parent602b9da9928e10b55489d2a5c9599107b32dc90a (diff)
downloadqtlocation-mapboxgl-dbddd3c904d34eecdda4bb7d1d0dc30c4ea7e13b.tar.gz
gyp fixes
-rw-r--r--Makefile12
-rwxr-xr-xconfigure20
-rw-r--r--gyp/mbgl-headless.gypi4
-rw-r--r--gyp/mbgl-ios.gypi18
-rw-r--r--gyp/mbgl-linux.gypi47
-rw-r--r--gyp/mbgl-osx.gypi17
-rw-r--r--gyp/mbgl.gypi64
-rw-r--r--include/mbgl/util/stopwatch.hpp40
-rw-r--r--include/mbgl/util/timer.hpp40
-rw-r--r--linux/mapboxgl-app.gyp21
-rw-r--r--macosx/mapboxgl-app.gyp5
-rw-r--r--src/renderer/painter.cpp4
-rw-r--r--src/shader/shader.cpp4
-rw-r--r--src/util/stopwatch.cpp (renamed from src/util/timer.cpp)16
-rw-r--r--test/test.gyp7
15 files changed, 170 insertions, 149 deletions
diff --git a/Makefile b/Makefile
index 2431f7be73..9a6faf985d 100644
--- a/Makefile
+++ b/Makefile
@@ -22,10 +22,22 @@ mbgl: config.gypi mapboxgl.gyp
deps/run_gyp mapboxgl.gyp -Iconfig.gypi -Dplatform=$(PLATFORM) --depth=. -Goutput_dir=.. --generator-output=./build/mbgl -f make
$(MAKE) -C build/mbgl BUILDTYPE=$(BUILDTYPE) V=$(V) mbgl
+mbgl-platform: config.gypi mapboxgl.gyp
+ deps/run_gyp mapboxgl.gyp -Iconfig.gypi -Dplatform=$(PLATFORM) --depth=. -Goutput_dir=.. --generator-output=./build/mbgl -f make
+ $(MAKE) -C build/mbgl BUILDTYPE=$(BUILDTYPE) V=$(V) mbgl-$(PLATFORM)
+
+mbgl-headless: config.gypi mapboxgl.gyp
+ deps/run_gyp mapboxgl.gyp -Iconfig.gypi -Dplatform=$(PLATFORM) --depth=. -Goutput_dir=.. --generator-output=./build/mbgl -f make
+ $(MAKE) -C build/mbgl BUILDTYPE=$(BUILDTYPE) V=$(V) mbgl-headless
+
install: config.gypi mapboxgl.gyp
deps/run_gyp mapboxgl.gyp -Iconfig.gypi -Dplatform=$(PLATFORM) -Dinstall_prefix=$(PREFIX) --depth=. -Goutput_dir=.. --generator-output=./build/mbgl -f make
$(MAKE) -C build/mbgl BUILDTYPE=$(BUILDTYPE) V=$(V) install
+config: config.gypi mapboxgl.gyp
+ deps/run_gyp mapboxgl.gyp -Iconfig.gypi -Dplatform=$(PLATFORM) --depth=. -Goutput_dir=.. --generator-output=./build/mbgl -f make
+ $(MAKE) -C build/mbgl BUILDTYPE=$(BUILDTYPE) V=$(V) mbgl-config
+
##### Test cases ###############################################################
build/test/Makefile: src common config.gypi test/test.gyp
diff --git a/configure b/configure
index ef289ac5d2..43a665f29b 100755
--- a/configure
+++ b/configure
@@ -69,7 +69,7 @@ PYTHON=`which python || abort 'Cannot find python'`
>&2 echo -en "\033[0m";
function quote_flags {
- ${PYTHON} -c "import sys, re; print re.split('(?<!-framework)\s+', ' '.join(sys.argv[1:]))" "$@"
+ ${PYTHON} -c "import sys, re; print filter(None, re.split('(?<!-framework)\s+', ' '.join(sys.argv[1:])))" "$@"
}
LN=$'\n'
@@ -96,38 +96,44 @@ fi
if [ ! -z ${LIBCURL_VERSION} ]; then
mason install libcurl ${LIBCURL_VERSION}
+ CONFIG+=" 'curl_static_libs': $(quote_flags $(mason static_libs libcurl ${LIBCURL_VERSION})),"$LN
CONFIG+=" 'curl_cflags': $(quote_flags $(mason cflags libcurl ${LIBCURL_VERSION})),"$LN
- CONFIG+=" 'curl_libraries': $(quote_flags $(mason ldflags libcurl ${LIBCURL_VERSION})),"$LN
+ CONFIG+=" 'curl_ldflags': $(quote_flags $(mason ldflags libcurl ${LIBCURL_VERSION})),"$LN
fi
if [ ! -z ${GLFW_VERSION} ]; then
mason install glfw ${GLFW_VERSION}
+ CONFIG+=" 'glfw3_static_libs': $(quote_flags $(mason static_libs glfw ${GLFW_VERSION})),"$LN
CONFIG+=" 'glfw3_cflags': $(quote_flags $(mason cflags glfw ${GLFW_VERSION})),"$LN
- CONFIG+=" 'glfw3_libraries': $(quote_flags $(mason ldflags glfw ${GLFW_VERSION})),"$LN
+ CONFIG+=" 'glfw3_ldflags': $(quote_flags $(mason ldflags glfw ${GLFW_VERSION})),"$LN
fi
if [ ! -z ${LIBPNG_VERSION} ]; then
mason install libpng ${LIBPNG_VERSION}
+ CONFIG+=" 'png_static_libs': $(quote_flags $(mason static_libs libpng ${LIBPNG_VERSION})),"$LN
CONFIG+=" 'png_cflags': $(quote_flags $(mason cflags libpng ${LIBPNG_VERSION})),"$LN
- CONFIG+=" 'png_libraries': $(quote_flags $(mason ldflags libpng ${LIBPNG_VERSION})),"$LN
+ CONFIG+=" 'png_ldflags': $(quote_flags $(mason ldflags libpng ${LIBPNG_VERSION})),"$LN
fi
if [ ! -z ${SQLITE_VERSION} ]; then
mason install sqlite ${SQLITE_VERSION}
+ CONFIG+=" 'sqlite3_static_libs': $(quote_flags $(mason static_libs sqlite ${SQLITE_VERSION})),"$LN
CONFIG+=" 'sqlite3_cflags': $(quote_flags $(mason cflags sqlite ${SQLITE_VERSION})),"$LN
- CONFIG+=" 'sqlite3_libraries': $(quote_flags $(mason ldflags sqlite ${SQLITE_VERSION})),"$LN
+ CONFIG+=" 'sqlite3_ldflags': $(quote_flags $(mason ldflags sqlite ${SQLITE_VERSION})),"$LN
fi
if [ ! -z ${LIBUV_VERSION} ]; then
mason install libuv ${LIBUV_VERSION}
+ CONFIG+=" 'uv_static_libs': $(quote_flags $(mason static_libs libuv ${LIBUV_VERSION})),"$LN
CONFIG+=" 'uv_cflags': $(quote_flags $(mason cflags libuv ${LIBUV_VERSION})),"$LN
- CONFIG+=" 'uv_libraries': $(quote_flags $(mason ldflags libuv ${LIBUV_VERSION})),"$LN
+ CONFIG+=" 'uv_ldflags': $(quote_flags $(mason ldflags libuv ${LIBUV_VERSION})),"$LN
fi
if [ ! -z ${ZLIB_VERSION} ]; then
mason install zlib ${ZLIB_VERSION}
+ CONFIG+=" 'zlib_static_libs': $(quote_flags $(mason static_libs zlib ${ZLIB_VERSION})),"$LN
CONFIG+=" 'zlib_cflags': $(quote_flags $(mason cflags zlib ${ZLIB_VERSION})),"$LN
- CONFIG+=" 'zlib_libraries': $(quote_flags $(mason ldflags zlib ${ZLIB_VERSION})),"$LN
+ CONFIG+=" 'zlib_ldflags': $(quote_flags $(mason ldflags zlib ${ZLIB_VERSION})),"$LN
fi
CONFIG+=" }
diff --git a/gyp/mbgl-headless.gypi b/gyp/mbgl-headless.gypi
index 5ffc251d22..644f164866 100644
--- a/gyp/mbgl-headless.gypi
+++ b/gyp/mbgl-headless.gypi
@@ -11,5 +11,5 @@
'../platform/default/headless_display.cpp',
],
},
- ]
-} \ No newline at end of file
+ ],
+}
diff --git a/gyp/mbgl-ios.gypi b/gyp/mbgl-ios.gypi
index dbad60086c..daa0052b12 100644
--- a/gyp/mbgl-ios.gypi
+++ b/gyp/mbgl-ios.gypi
@@ -12,7 +12,6 @@
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
'CLANG_ENABLE_OBJC_ARC': 'YES',
'CODE_SIGN_IDENTITY': 'iPhone Developer',
- 'PUBLIC_HEADERS_FOLDER_PATH': 'include',
},
'configurations': {
'Release': {
@@ -29,28 +28,27 @@
'product_name': 'mbgl-ios',
'type': 'static_library',
'hard_dependency': 1,
- 'include_dirs': [
- '../include',
- ],
'sources': [
'../platform/ios/cache_database_library.mm',
'../platform/darwin/log_nslog.mm',
'../platform/darwin/string_nsstring.mm',
'../platform/darwin/http_request_baton_cocoa.mm',
],
+ 'include_dirs': [
+ '../include',
+ ],
'xcode_settings': {
- 'OTHER_CPLUSPLUSFLAGS': [
- '<@(uv_cflags)',
- ],
+ 'OTHER_CPLUSPLUSFLAGS': [ '<@(uv_cflags)' ],
},
+ 'libraries': [
+ '<@(uv_static_libs)',
+ ],
'direct_dependent_settings': {
'include_dirs': [
'../include',
],
'xcode_settings': {
- 'OTHER_LDFLAGS': [
- '<@(uv_libraries)',
- ],
+ 'OTHER_LDFLAGS': [ '<@(uv_ldflags)' ],
},
},
},
diff --git a/gyp/mbgl-linux.gypi b/gyp/mbgl-linux.gypi
index 39a1755569..a09f3d963e 100644
--- a/gyp/mbgl-linux.gypi
+++ b/gyp/mbgl-linux.gypi
@@ -4,28 +4,36 @@
'product_name': 'mbgl-linux',
'type': 'static_library',
'hard_dependency': 1,
- 'include_dirs': [
- '../include'
- ],
+ 'variables': {
+ 'cflags_cc': [
+ '<@(uv_cflags)',
+ '<@(curl_cflags)',
+ ],
+ 'ldflags': [
+ '<@(uv_ldflags)',
+ '<@(curl_ldflags)',
+ ],
+ },
'sources': [
'../platform/default/cache_database_tmp.cpp',
'../platform/default/log_stderr.cpp',
'../platform/default/string_stdlib.cpp',
'../platform/default/http_request_baton_curl.cpp',
],
+ 'include_dirs': [
+ '../include',
+ ],
+ 'libraries': [
+ '<@(uv_static_libs)',
+ '<@(curl_static_libs)',
+ ],
'conditions': [
['OS == "mac"', {
'xcode_settings': {
- 'OTHER_CPLUSPLUSFLAGS': [
- '<@(uv_cflags)',
- '<@(curl_cflags)',
- ],
+ 'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags_cc)' ],
}
}, {
- 'cflags': [
- '<@(uv_cflags)',
- '<@(curl_cflags)',
- ],
+ 'ldflags': [ '<@(ldflags)' ],
}]
],
'direct_dependent_settings': {
@@ -35,20 +43,13 @@
'conditions': [
['OS == "mac"', {
'xcode_settings': {
- 'OTHER_LDFLAGS': [
- '<@(uv_libraries)',
- '<@(curl_libraries)',
- ]
+ 'OTHER_LDFLAGS': [ '<@(ldflags)' ],
}
}, {
- 'libraries': [
- '<@(uv_libraries)',
- '<@(curl_libraries)',
- '-lboost_regex',
- ]
+ 'ldflags': [ '<@(ldflags)' ],
}]
- ]
- }
+ ],
+ },
},
- ]
+ ],
}
diff --git a/gyp/mbgl-osx.gypi b/gyp/mbgl-osx.gypi
index ba117e5a59..e0a683f218 100644
--- a/gyp/mbgl-osx.gypi
+++ b/gyp/mbgl-osx.gypi
@@ -4,28 +4,27 @@
'product_name': 'mbgl-osx',
'type': 'static_library',
'hard_dependency': 1,
- 'include_dirs': [
- '../include',
- ],
'sources': [
'../platform/osx/cache_database_application_support.mm',
'../platform/darwin/log_nslog.mm',
'../platform/darwin/string_nsstring.mm',
'../platform/darwin/http_request_baton_cocoa.mm',
],
+ 'include_dirs': [
+ '../include',
+ ],
'xcode_settings': {
- 'OTHER_CPLUSPLUSFLAGS': [
- '<@(uv_cflags)',
- ],
+ 'OTHER_CPLUSPLUSFLAGS': [ '<@(uv_cflags)' ],
},
+ 'libraries': [
+ '<@(uv_static_libs)',
+ ],
'direct_dependent_settings': {
'include_dirs': [
'../include',
],
'xcode_settings': {
- 'OTHER_LDFLAGS': [
- '<@(uv_libraries)',
- ],
+ 'OTHER_LDFLAGS': [ '<@(uv_ldflags)' ],
},
},
},
diff --git a/gyp/mbgl.gypi b/gyp/mbgl.gypi
index f268fd6255..d69fcc95b2 100644
--- a/gyp/mbgl.gypi
+++ b/gyp/mbgl.gypi
@@ -7,6 +7,24 @@
'dependencies': [
'shaders',
],
+ 'variables': {
+ 'cflags_cc': [
+ '<@(png_cflags)',
+ '<@(uv_cflags)',
+ '<@(sqlite3_cflags)',
+ '<@(zlib_cflags)',
+ '-I<(boost_root)/include',
+ ],
+ 'cflags': [
+ '<@(uv_cflags)',
+ ],
+ 'ldflags': [
+ '<@(png_ldflags)',
+ '<@(uv_ldflags)',
+ '<@(sqlite3_ldflags)',
+ '<@(zlib_ldflags)',
+ ],
+ },
'sources': [
'<!@(find src -name "*.cpp")',
'<!@(test -f "config/constants_local.cpp" && echo "config/constants_local.cpp" || echo "config/constants.cpp")',
@@ -18,31 +36,25 @@
'bin/style.json'
],
'include_dirs': [
- '../include'
+ '../include',
+ ],
+ 'libraries': [
+ '<@(png_static_libs)',
+ '<@(uv_static_libs)',
+ '<@(sqlite3_static_libs)',
+ '<@(zlib_static_libs)',
],
'conditions': [
['OS == "mac"', {
'xcode_settings': {
- 'PUBLIC_HEADERS_FOLDER_PATH': 'include',
- 'OTHER_CPLUSPLUSFLAGS': [
- '<@(png_cflags)',
- '<@(uv_cflags)',
- '<@(sqlite3_cflags)',
- '<@(zlib_cflags)',
- '-I<(boost_root)/include',
- ],
- 'OTHER_CFLAGS': [
- '<@(uv_cflags)',
- ],
+ 'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags_cc)' ],
+ 'OTHER_CFLAGS': [ '<@(cflags)' ],
+ # Makefile builds don't respect 'libraries' on OS X.
+ 'OTHER_LDFLAGS': [ '>@(_libraries)' ],
},
}, {
- 'cflags': [
- '<@(png_cflags)',
- '<@(uv_cflags)',
- '<@(sqlite3_cflags)',
- '<@(zlib_cflags)',
- '-I<(boost_root)/include',
- ],
+ 'cflags_cc': [ '<@(cflags_cc)' ],
+ 'cflags': [ '<@(cflags)' ],
}]
],
'direct_dependent_settings': {
@@ -52,20 +64,10 @@
'conditions': [
['OS == "mac"', {
'xcode_settings': {
- 'OTHER_LDFLAGS': [
- '<@(png_libraries)',
- '<@(uv_libraries)',
- '<@(sqlite3_libraries)',
- '<@(zlib_libraries)',
- ]
+ 'OTHER_LDFLAGS': [ '<@(ldflags)' ]
}
}, {
- 'libraries': [
- '<@(png_libraries)',
- '<@(uv_libraries)',
- '<@(sqlite3_libraries)',
- '<@(zlib_libraries)',
- ]
+ 'ldflags': [ '<@(ldflags)' ]
}]
]
}
diff --git a/include/mbgl/util/stopwatch.hpp b/include/mbgl/util/stopwatch.hpp
new file mode 100644
index 0000000000..663bbb6fc7
--- /dev/null
+++ b/include/mbgl/util/stopwatch.hpp
@@ -0,0 +1,40 @@
+#ifndef MBGL_UTIL_STOPWATCH
+#define MBGL_UTIL_STOPWATCH
+
+#include <mbgl/platform/event.hpp>
+
+#include <string>
+
+namespace mbgl {
+namespace util {
+
+#ifndef DISABLE_STOPWATCH
+class stopwatch {
+public:
+ stopwatch(Event event = Event::General);
+ stopwatch(EventSeverity severity, Event event = Event::General);
+ stopwatch(const std::string &name, Event event = Event::General);
+ stopwatch(const std::string &name, EventSeverity severity, Event event = Event::General);
+ void report(const std::string &name);
+ ~stopwatch();
+
+private:
+ const std::string name;
+ EventSeverity severity = EventSeverity::Debug;
+ Event event = Event::General;
+ uint64_t start;
+};
+#else
+class stopwatch {
+ inline stopwatch(Event event = Event::General);
+ inline stopwatch(EventSeverity severity, Event event = Event::General);
+ inline stopwatch(const std::string &name, Event event = Event::General);
+ inline stopwatch(const std::string &name, EventSeverity severity, Event event = Event::General);
+ inline void report(const std::string &name) {}
+ inline ~stopwatch() {}
+};
+#endif
+}
+}
+
+#endif
diff --git a/include/mbgl/util/timer.hpp b/include/mbgl/util/timer.hpp
deleted file mode 100644
index 8171c2f5d1..0000000000
--- a/include/mbgl/util/timer.hpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef MBGL_UTIL_TIMER
-#define MBGL_UTIL_TIMER
-
-#include <mbgl/platform/event.hpp>
-
-#include <string>
-
-namespace mbgl {
-namespace util {
-
-#ifndef DISABLE_TIMER
-class timer {
-public:
- timer(Event event = Event::General);
- timer(EventSeverity severity, Event event = Event::General);
- timer(const std::string &name, Event event = Event::General);
- timer(const std::string &name, EventSeverity severity, Event event = Event::General);
- void report(const std::string &name);
- ~timer();
-
-private:
- const std::string name;
- EventSeverity severity = EventSeverity::Debug;
- Event event = Event::General;
- uint64_t start;
-};
-#else
-class timer {
- inline timer(Event event = Event::General);
- inline timer(EventSeverity severity, Event event = Event::General);
- inline timer(const std::string &name, Event event = Event::General);
- inline timer(const std::string &name, EventSeverity severity, Event event = Event::General);
- inline void report(const std::string &name) {}
- inline ~timer() {}
-};
-#endif
-}
-}
-
-#endif
diff --git a/linux/mapboxgl-app.gyp b/linux/mapboxgl-app.gyp
index ee38b4b266..92175d1c0b 100644
--- a/linux/mapboxgl-app.gyp
+++ b/linux/mapboxgl-app.gyp
@@ -13,7 +13,9 @@
'../platform/default/glfw_view.cpp',
'../platform/default/log_stderr.cpp',
],
-
+ 'libraries': [
+ '<@(glfw3_static_libs)',
+ ],
'conditions': [
['OS == "mac"',
@@ -24,23 +26,22 @@
'<@(glfw3_cflags)',
],
'OTHER_LDFLAGS': [
- '<@(glfw3_libraries)',
+ '<@(glfw3_ldflags)',
],
}
},
# Non-Mac OS X
{
- 'cflags': [
+ 'cflags_cc': [
'<@(glfw3_cflags)',
+ '-I<(boost_root)/include',
+ ],
+ 'ldflags': [
+ '<@(glfw3_ldflags)',
+ '-L<(boost_root)/lib',
+ '-lboost_regex',
],
- 'link_settings': {
- 'libraries': [
- '<@(glfw3_libraries)',
- '-L<(boost_root)/lib',
- '-lboost_regex',
- ],
- },
}],
],
'dependencies': [
diff --git a/macosx/mapboxgl-app.gyp b/macosx/mapboxgl-app.gyp
index fe8d9f7ae1..b6881c1a52 100644
--- a/macosx/mapboxgl-app.gyp
+++ b/macosx/mapboxgl-app.gyp
@@ -27,7 +27,7 @@
'<@(glfw3_cflags)'
],
'OTHER_LDFLAGS': [
- '<@(glfw3_libraries)',
+ '<@(glfw3_ldflags)',
'-framework SystemConfiguration',
],
'SDKROOT': 'macosx',
@@ -35,6 +35,9 @@
'MACOSX_DEPLOYMENT_TARGET':'10.9',
'CLANG_ENABLE_OBJC_ARC': 'YES'
},
+ 'libraries': [
+ '<@(glfw3_static_libs)',
+ ],
'dependencies': [
'../mapboxgl.gyp:bundle_styles',
'../mapboxgl.gyp:mbgl',
diff --git a/src/renderer/painter.cpp b/src/renderer/painter.cpp
index 38c2176aed..228783b3c3 100644
--- a/src/renderer/painter.cpp
+++ b/src/renderer/painter.cpp
@@ -11,7 +11,7 @@
#include <mbgl/geometry/sprite_atlas.hpp>
#if defined(DEBUG)
-#include <mbgl/util/timer.hpp>
+#include <mbgl/util/stopwatch.hpp>
#endif
#include <cassert>
@@ -35,7 +35,7 @@ bool Painter::needsAnimation() const {
void Painter::setup() {
#if defined(DEBUG)
- util::timer timer("painter setup");
+ util::stopwatch stopwatch("painter setup");
#endif
setupShaders();
diff --git a/src/shader/shader.cpp b/src/shader/shader.cpp
index d9f63cae12..84cb55eac4 100644
--- a/src/shader/shader.cpp
+++ b/src/shader/shader.cpp
@@ -1,6 +1,6 @@
#include <mbgl/shader/shader.hpp>
#include <mbgl/platform/gl.hpp>
-#include <mbgl/util/timer.hpp>
+#include <mbgl/util/stopwatch.hpp>
#include <mbgl/platform/log.hpp>
#include <cstring>
@@ -12,7 +12,7 @@ Shader::Shader(const char *name_, const GLchar *vertSource, const GLchar *fragSo
: name(name_),
valid(false),
program(0) {
- util::timer timer("shader compilation", Event::Shader);
+ util::stopwatch stopwatch("shader compilation", Event::Shader);
GLuint vertShader;
if (!compileShader(&vertShader, GL_VERTEX_SHADER, vertSource)) {
diff --git a/src/util/timer.cpp b/src/util/stopwatch.cpp
index 5c4af51da4..c9b8756e3b 100644
--- a/src/util/timer.cpp
+++ b/src/util/stopwatch.cpp
@@ -1,5 +1,5 @@
-#ifndef DISABLE_TIMER
-#include <mbgl/util/timer.hpp>
+#ifndef DISABLE_STOPWATCH
+#include <mbgl/util/stopwatch.hpp>
#include <mbgl/util/time.hpp>
#include <mbgl/platform/log.hpp>
@@ -8,26 +8,26 @@
using namespace mbgl::util;
-timer::timer(Event event_)
+stopwatch::stopwatch(Event event_)
: event(event_), start(now()) {}
-timer::timer(EventSeverity severity_, Event event_)
+stopwatch::stopwatch(EventSeverity severity_, Event event_)
: severity(severity_), event(event_), start(now()) {}
-timer::timer(const std::string &name_, Event event_)
+stopwatch::stopwatch(const std::string &name_, Event event_)
: name(name_), event(event_), start(now()) {}
-timer::timer(const std::string &name_, EventSeverity severity_, Event event_)
+stopwatch::stopwatch(const std::string &name_, EventSeverity severity_, Event event_)
: name(name_), severity(severity_), event(event_), start(now()) {}
-void timer::report(const std::string &name_) {
+void stopwatch::report(const std::string &name_) {
timestamp duration = now() - start;
Log::Record(severity, event, name_ + ": " + std::to_string((double)(duration) / 1_millisecond) + "ms");
start += duration;
}
-timer::~timer() {
+stopwatch::~stopwatch() {
if (name.size()) {
report(name);
}
diff --git a/test/test.gyp b/test/test.gyp
index daf74b3e99..a01d1b32be 100644
--- a/test/test.gyp
+++ b/test/test.gyp
@@ -111,8 +111,6 @@
'./headless.cpp',
'./fixtures/fixture_request.cpp',
'./fixtures/fixture_log.cpp',
- '../platform/default/headless_view.cpp',
- '../platform/default/headless_display.cpp',
],
'conditions': [
# add libuv include path and OpenGL libs
@@ -120,17 +118,18 @@
{
'xcode_settings': {
'OTHER_CPLUSPLUSFLAGS': ['<@(uv_cflags)'],
- 'OTHER_LDFLAGS': ['<@(glfw3_libraries)'],
+ 'OTHER_LDFLAGS': ['<@(glfw3_ldflags)'],
},
},
{
'cflags': ['<@(uv_cflags)'],
- 'libraries': ['<@(glfw3_libraries)'],
+ 'libraries': ['<@(glfw3_ldflags)'],
}],
],
'dependencies': [
'../deps/gtest/gtest.gyp:gtest',
'../mapboxgl.gyp:mbgl',
+ '../mapboxgl.gyp:mbgl-headless',
'<(platform_library)',
],
},