From 704b3719f5acfe2291c5976bf8c0935bb9523f5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Fri, 23 Jan 2015 18:52:29 +0100 Subject: use standard DEBUG macro rather than NDEBUG --- .gitmodules | 7 ++++--- app/ios | 1 - gyp/common.gypi | 17 +++++++++++++++-- include/mbgl/map/map.hpp | 2 +- include/mbgl/util/util.hpp | 6 ++++-- linux/mapboxgl-app.gyp | 6 +++--- macosx/mapboxgl-app.gyp | 4 ++-- src/mbgl/map/map.cpp | 10 +++++----- src/mbgl/util/uv-worker.c | 8 ++++---- src/mbgl/util/uv-worker.h | 2 +- test/test.gyp | 8 +++----- 11 files changed, 42 insertions(+), 29 deletions(-) delete mode 160000 app/ios diff --git a/.gitmodules b/.gitmodules index 9e4f20d0a7..8242fab9b2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,5 +1,5 @@ -[submodule "ios"] - path = ios +[submodule "ios/mapbox-gl-cocoa"] + path = ios/mapbox-gl-cocoa url = https://github.com/mapbox/mapbox-gl-cocoa.git [submodule "test/suite"] @@ -13,6 +13,7 @@ [submodule "styles"] path = styles url = https://github.com/mapbox/mapbox-gl-styles.git + [submodule "app/ios"] path = app/ios - url = https://github.com/mapbox/mapbox-gl-cocoa.git + url = https://github.com/mapbox/mapbox-gl-cocoa.git \ No newline at end of file diff --git a/app/ios b/app/ios deleted file mode 160000 index 2e5bfbdcd5..0000000000 --- a/app/ios +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2e5bfbdcd54c893864c263b41a27846627e10f0c diff --git a/gyp/common.gypi b/gyp/common.gypi index 67a8dcd9d7..f16bfb27d5 100644 --- a/gyp/common.gypi +++ b/gyp/common.gypi @@ -29,9 +29,23 @@ 'GCC_WARN_PEDANTIC': 'YES', 'GCC_WARN_UNINITIALIZED_AUTOS': 'YES_AGGRESSIVE', }, + }, { + 'cflags_cc': [ + '-std=c++11', + '-Werror', + '-Wall', + '-Wextra', + '-Wshadow', + '-Wno-variadic-macros', + '-Wno-error=unused-parameter', + '-Wno-unknown-warning-option', + '-frtti', + '-fexceptions', + ], }], ['OS=="linux"', { - 'cflags_cc': ['-Wno-unknown-pragmas', # We are using '#pragma mark', but it is only available on Darwin. + 'cflags_cc': [ + '-Wno-unknown-pragmas', # We are using '#pragma mark', but it is only available on Darwin. ], }], ], @@ -66,7 +80,6 @@ ], }], ], - 'cflags_cc': [ '-std=c++11', '-Werror', '-Wall', '-Wextra', '-Wshadow', '-frtti', '-fexceptions' ], 'configurations': { 'Debug': { 'cflags_cc': [ '-g', '-O0', '-fno-omit-frame-pointer','-fwrapv', '-fstack-protector-all', '-fno-common' ], diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 876b7b7207..ae0228544e 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -198,7 +198,7 @@ private: View &view; -#ifndef NDEBUG +#ifdef DEBUG const std::thread::id mainThread; std::thread::id mapThread; #endif diff --git a/include/mbgl/util/util.hpp b/include/mbgl/util/util.hpp index bf5dad3c01..2b0fd9cdd5 100644 --- a/include/mbgl/util/util.hpp +++ b/include/mbgl/util/util.hpp @@ -1,15 +1,17 @@ #ifndef MBGL_UTIL_UTIL #define MBGL_UTIL_UTIL -#include +#ifdef DEBUG -#ifndef NDEBUG #include #define MBGL_STORE_THREAD(tid) const std::thread::id tid = std::this_thread::get_id(); #define MBGL_VERIFY_THREAD(tid) assert(tid == std::this_thread::get_id()); + #else + #define MBGL_STORE_THREAD(tid) #define MBGL_VERIFY_THREAD(tid) + #endif #endif diff --git a/linux/mapboxgl-app.gyp b/linux/mapboxgl-app.gyp index e7db26f2b7..abc3db6ad8 100644 --- a/linux/mapboxgl-app.gyp +++ b/linux/mapboxgl-app.gyp @@ -23,7 +23,7 @@ ], 'variables' : { - 'cxxflags': [ + 'cflags_cc': [ '<@(glfw3_cflags)', ], 'ldflags': [ @@ -38,11 +38,11 @@ 'conditions': [ ['OS == "mac"', { 'xcode_settings': { - 'OTHER_CPLUSPLUSFLAGS': [ '<@(cxxflags)' ], + 'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags_cc)' ], 'OTHER_LDFLAGS': [ '<@(ldflags)' ], } }, { - 'cxxflags': [ '<@(cxxflags)' ], + 'cflags_cc': [ '<@(cflags_cc)' ], 'ldflags': [ '<@(ldflags)' ], }] ], diff --git a/macosx/mapboxgl-app.gyp b/macosx/mapboxgl-app.gyp index 6bb2537ceb..9221d7b386 100644 --- a/macosx/mapboxgl-app.gyp +++ b/macosx/mapboxgl-app.gyp @@ -29,7 +29,7 @@ ], 'variables' : { - 'cxxflags': [ + 'cflags_cc': [ '<@(glfw3_cflags)', ], 'ldflags': [ @@ -48,7 +48,7 @@ 'xcode_settings': { 'SDKROOT': 'macosx', 'SUPPORTED_PLATFORMS':'macosx', - 'OTHER_CPLUSPLUSFLAGS': [ '<@(cxxflags)' ], + 'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags_cc)' ], 'OTHER_LDFLAGS': [ '<@(ldflags)' ], 'SDKROOT': 'macosx', 'INFOPLIST_FILE': 'Info.plist', diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index d76023c8fb..5aff7a2b78 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -59,7 +59,7 @@ using namespace mbgl; Map::Map(View& view_, FileSource& fileSource_) : loop(util::make_unique()), view(view_), -#ifndef NDEBUG +#ifdef DEBUG mainThread(std::this_thread::get_id()), mapThread(mainThread), #endif @@ -152,7 +152,7 @@ void Map::start(bool startPaused) { } thread = std::thread([this]() { -#ifndef NDEBUG +#ifdef DEBUG mapThread = std::this_thread::get_id(); #endif @@ -162,7 +162,7 @@ void Map::start(bool startPaused) { run(); -#ifndef NDEBUG +#ifdef DEBUG mapThread = std::thread::id(); #endif @@ -230,7 +230,7 @@ void Map::resume() { void Map::run() { if (mode == Mode::None) { -#ifndef NDEBUG +#ifdef DEBUG mapThread = mainThread; #endif mode = Mode::Static; @@ -265,7 +265,7 @@ void Map::run() { // *after* all events have been processed. if (mode == Mode::Static) { render(); -#ifndef NDEBUG +#ifdef DEBUG mapThread = std::thread::id(); #endif mode = Mode::None; diff --git a/src/mbgl/util/uv-worker.c b/src/mbgl/util/uv-worker.c index d2aa908019..ec8eae461c 100644 --- a/src/mbgl/util/uv-worker.c +++ b/src/mbgl/util/uv-worker.c @@ -25,7 +25,7 @@ void uv__worker_free_messenger(uv_messenger_t *msgr) { void uv__worker_thread_finished(uv__worker_thread_t *worker_thread) { uv_worker_t *worker = worker_thread->worker; -#ifndef NDEBUG +#ifdef DEBUG assert(uv_thread_self() == worker->thread_id); #endif @@ -101,7 +101,7 @@ void uv__worker_thread_loop(void *ptr) { } int uv_worker_init(uv_worker_t *worker, uv_loop_t *loop, int count, const char *name) { -#ifndef NDEBUG +#ifdef DEBUG worker->thread_id = uv_thread_self(); #endif worker->loop = loop; @@ -134,7 +134,7 @@ int uv_worker_init(uv_worker_t *worker, uv_loop_t *loop, int count, const char * void uv_worker_send(uv_worker_t *worker, void *data, uv_worker_cb work_cb, uv_worker_after_cb after_work_cb) { -#ifndef NDEBUG +#ifdef DEBUG assert(uv_thread_self() == worker->thread_id); #endif @@ -155,7 +155,7 @@ void uv_worker_send(uv_worker_t *worker, void *data, uv_worker_cb work_cb, } void uv_worker_close(uv_worker_t *worker, uv_worker_close_cb close_cb) { -#ifndef NDEBUG +#ifdef DEBUG assert(uv_thread_self() == worker->thread_id); #endif diff --git a/src/mbgl/util/uv-worker.h b/src/mbgl/util/uv-worker.h index cb2075d1c3..5640bfd14d 100644 --- a/src/mbgl/util/uv-worker.h +++ b/src/mbgl/util/uv-worker.h @@ -17,7 +17,7 @@ typedef void (*uv_worker_after_cb)(void *data); typedef void (*uv_worker_close_cb)(uv_worker_t *worker); struct uv_worker_s { -#ifndef NDEBUG +#ifdef DEBUG unsigned long thread_id; #endif uv_loop_t *loop; diff --git a/test/test.gyp b/test/test.gyp index 012d88e56b..c6bf4d7520 100644 --- a/test/test.gyp +++ b/test/test.gyp @@ -69,7 +69,7 @@ '<@(curl_static_libs)', ], 'variables': { - 'cxxflags': [ + 'cflags_cc': [ '<@(uv_cflags)', '-I<(boost_root)/include', ], @@ -84,13 +84,11 @@ 'conditions': [ ['OS == "mac"', { 'xcode_settings': { - 'OTHER_CFLAGS': [ '<@(cxxflags)' ], - 'OTHER_CPLUSPLUSFLAGS': [ '<@(cxxflags)' ], + 'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags_cc)' ], 'OTHER_LDFLAGS': [ '<@(ldflags)' ], }, }, { - 'cflags': [ '<@(cxxflags)' ], - 'cxxflags': [ '<@(cxxflags)' ], + 'cflags_cc': [ '<@(cflags_cc)' ], 'libraries': [ '<@(ldflags)' ], }], ], -- cgit v1.2.1