summaryrefslogtreecommitdiff
path: root/next/platform
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2019-12-11 14:17:27 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2019-12-11 17:12:25 +0200
commit36793156334c70d0c264e87d5b8c4f1c146fc135 (patch)
tree27a38a5e83b1cd11a09757110494996fcd621109 /next/platform
parent3b14aef334c47a3548e8545da2c4113248885dd2 (diff)
downloadqtlocation-mapboxgl-36793156334c70d0c264e87d5b8c4f1c146fc135.tar.gz
[build] Better isolate compiler flags
Previously we had UndefinedBehavior mixed with other sanitizers, in special implicit conversions and overflows. Also, run the sanitizers in Release configuration, so they will run faster. -O1 is just needed for perfectly nice stack traces. Also, moving the flags to an interface will prevent them to leak to our external dependencies.
Diffstat (limited to 'next/platform')
-rw-r--r--next/platform/android/android.cmake22
-rw-r--r--next/platform/glfw/CMakeLists.txt1
-rw-r--r--next/platform/linux/linux.cmake6
-rw-r--r--next/platform/macos/macos.cmake6
-rw-r--r--next/platform/node/CMakeLists.txt2
-rw-r--r--next/platform/qt/qt.cmake15
6 files changed, 37 insertions, 15 deletions
diff --git a/next/platform/android/android.cmake b/next/platform/android/android.cmake
index 9d19edd560..559baf3cbc 100644
--- a/next/platform/android/android.cmake
+++ b/next/platform/android/android.cmake
@@ -254,7 +254,7 @@ target_include_directories(
target_link_libraries(
mbgl-core-android
- PRIVATE Mapbox::Base::jni.hpp mbgl-core
+ PRIVATE Mapbox::Base::jni.hpp mbgl-compiler-options mbgl-core
)
add_library(
@@ -269,7 +269,11 @@ target_include_directories(
target_link_libraries(
mapbox-gl
- PRIVATE Mapbox::Base::jni.hpp mbgl-core mbgl-core-android
+ PRIVATE
+ Mapbox::Base::jni.hpp
+ mbgl-compiler-options
+ mbgl-core
+ mbgl-core-android
)
add_library(
@@ -291,6 +295,7 @@ target_link_libraries(
Mapbox::Base::value
Mapbox::Base::weak
log
+ mbgl-compiler-options
)
add_executable(
@@ -301,7 +306,11 @@ add_executable(
target_link_libraries(
mbgl-test-runner
- PRIVATE Mapbox::Base::jni.hpp mapbox-gl mbgl-test
+ PRIVATE
+ Mapbox::Base::jni.hpp
+ mapbox-gl
+ mbgl-compiler-options
+ mbgl-test
)
add_executable(
@@ -312,7 +321,11 @@ add_executable(
target_link_libraries(
mbgl-benchmark-runner
- PRIVATE Mapbox::Base::jni.hpp mapbox-gl mbgl-benchmark
+ PRIVATE
+ Mapbox::Base::jni.hpp
+ mapbox-gl
+ mbgl-compiler-options
+ mbgl-benchmark
)
add_library(
@@ -335,6 +348,7 @@ target_link_libraries(
Mapbox::Base::jni.hpp
android
log
+ mbgl-compiler-options
mbgl-render-test
)
diff --git a/next/platform/glfw/CMakeLists.txt b/next/platform/glfw/CMakeLists.txt
index b0263362a7..a599082584 100644
--- a/next/platform/glfw/CMakeLists.txt
+++ b/next/platform/glfw/CMakeLists.txt
@@ -35,6 +35,7 @@ target_link_libraries(
Mapbox::Base::Extras::rapidjson
Mapbox::Map
OpenGL::GL
+ mbgl-compiler-options
mbgl-vendor-cheap-ruler-cpp
)
diff --git a/next/platform/linux/linux.cmake b/next/platform/linux/linux.cmake
index 5374ede323..cb866d8334 100644
--- a/next/platform/linux/linux.cmake
+++ b/next/platform/linux/linux.cmake
@@ -96,7 +96,7 @@ target_compile_definitions(
target_link_libraries(
mbgl-test-runner
- PRIVATE mbgl-test
+ PRIVATE mbgl-compiler-options mbgl-test
)
add_executable(
@@ -106,7 +106,7 @@ add_executable(
target_link_libraries(
mbgl-benchmark-runner
- PRIVATE mbgl-benchmark
+ PRIVATE mbgl-compiler-options mbgl-benchmark
)
add_executable(
@@ -116,7 +116,7 @@ add_executable(
target_link_libraries(
mbgl-render-test-runner
- PRIVATE mbgl-render-test
+ PRIVATE mbgl-compiler-options mbgl-render-test
)
add_test(NAME mbgl-benchmark-runner COMMAND mbgl-benchmark-runner WORKING_DIRECTORY ${MBGL_ROOT})
diff --git a/next/platform/macos/macos.cmake b/next/platform/macos/macos.cmake
index 721d19e625..915bd99c0e 100644
--- a/next/platform/macos/macos.cmake
+++ b/next/platform/macos/macos.cmake
@@ -169,7 +169,7 @@ target_compile_definitions(
target_link_libraries(
mbgl-test-runner
- PRIVATE mbgl-test
+ PRIVATE mbgl-compiler-options mbgl-test
)
add_executable(
@@ -179,7 +179,7 @@ add_executable(
target_link_libraries(
mbgl-benchmark-runner
- PRIVATE mbgl-benchmark
+ PRIVATE mbgl-compiler-options mbgl-benchmark
)
add_executable(
@@ -189,7 +189,7 @@ add_executable(
target_link_libraries(
mbgl-render-test-runner
- PRIVATE mbgl-render-test
+ PRIVATE mbgl-compiler-options mbgl-render-test
)
set_property(TARGET mbgl-benchmark-runner PROPERTY FOLDER Executables)
diff --git a/next/platform/node/CMakeLists.txt b/next/platform/node/CMakeLists.txt
index 840fab2964..adabd620c3 100644
--- a/next/platform/node/CMakeLists.txt
+++ b/next/platform/node/CMakeLists.txt
@@ -46,7 +46,7 @@ target_link_libraries(
# FIXME: Node bindings only run fully on Linux now because it requires libuv RunLoop (which is the default on Linux). Also, Sanitizer will
# not work here because node will do a dlopen(), which is not currently supported.
-if(CMAKE_SYSTEM_NAME STREQUAL Linux AND NOT CMAKE_BUILD_TYPE STREQUAL Sanitize)
+if(CMAKE_SYSTEM_NAME STREQUAL Linux AND NOT MBGL_WITH_SANITIZER)
add_test(NAME mbgl-node-memory COMMAND npm run test-memory WORKING_DIRECTORY ${MBGL_ROOT})
add_test(NAME mbgl-node-query COMMAND npm run test-query WORKING_DIRECTORY ${MBGL_ROOT})
add_test(NAME mbgl-node-test COMMAND npm run test WORKING_DIRECTORY ${MBGL_ROOT})
diff --git a/next/platform/qt/qt.cmake b/next/platform/qt/qt.cmake
index 4fb56176d0..4d81891947 100644
--- a/next/platform/qt/qt.cmake
+++ b/next/platform/qt/qt.cmake
@@ -132,9 +132,11 @@ target_compile_definitions(
target_link_libraries(
qmapboxgl
- Qt5::Core
- Qt5::Gui
- mbgl-core
+ PRIVATE
+ Qt5::Core
+ Qt5::Gui
+ mbgl-compiler-options
+ mbgl-core
)
add_executable(
@@ -150,7 +152,11 @@ set_property(TARGET mbgl-qt PROPERTY CXX_STANDARD 98)
target_link_libraries(
mbgl-qt
- PRIVATE Qt5::Widgets Qt5::Gui qmapboxgl
+ PRIVATE
+ Qt5::Widgets
+ Qt5::Gui
+ mbgl-compiler-options
+ qmapboxgl
)
add_executable(
@@ -168,6 +174,7 @@ target_link_libraries(
PRIVATE
Qt5::Gui
Qt5::OpenGL
+ mbgl-compiler-options
mbgl-test
pthread
)