diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2019-12-20 17:05:50 +0100 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2019-12-21 00:38:41 +0100 |
commit | 6d876f1d6bf95827598809b965ed6a6e06008675 (patch) | |
tree | 0b95cd106a739f2e1f6faa6072b3327f99f49ebf /next | |
parent | d009ce88e012eba46bd4f30b21ab32bc53020f8a (diff) | |
download | qtlocation-mapboxgl-6d876f1d6bf95827598809b965ed6a6e06008675.tar.gz |
[build] Make the configuration simpler
Moved the Android flags to the compilation options interface
and removed build options we are not using and go back to CMake
defaults.
Diffstat (limited to 'next')
-rw-r--r-- | next/CMakeLists.txt | 8 | ||||
-rw-r--r-- | next/benchmark/CMakeLists.txt | 4 | ||||
-rw-r--r-- | next/platform/android/android.cmake | 42 | ||||
-rw-r--r-- | next/render-test/CMakeLists.txt | 4 | ||||
-rw-r--r-- | next/test/CMakeLists.txt | 4 |
5 files changed, 24 insertions, 38 deletions
diff --git a/next/CMakeLists.txt b/next/CMakeLists.txt index 6ee1593bbd..f0beebdb46 100644 --- a/next/CMakeLists.txt +++ b/next/CMakeLists.txt @@ -14,14 +14,6 @@ set( include(CTest) -set( - CMAKE_CONFIGURATION_TYPES - Debug - MinSizeRel - RelWithDebInfo - Release -) - if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() diff --git a/next/benchmark/CMakeLists.txt b/next/benchmark/CMakeLists.txt index 338c7185ba..c42ef0815a 100644 --- a/next/benchmark/CMakeLists.txt +++ b/next/benchmark/CMakeLists.txt @@ -39,8 +39,4 @@ target_link_libraries( $<$<PLATFORM_ID:Android>:mbgl-core-android> ) -if(CMAKE_SYSTEM_NAME STREQUAL Android) - set_target_properties(mbgl-benchmark PROPERTIES LINK_FLAGS_RELEASE "-fuse-ld=gold -O2 -flto -Wl,--icf=safe") -endif() - set_property(TARGET mbgl-benchmark PROPERTY FOLDER Core) diff --git a/next/platform/android/android.cmake b/next/platform/android/android.cmake index 52c932395d..c60704d542 100644 --- a/next/platform/android/android.cmake +++ b/next/platform/android/android.cmake @@ -7,6 +7,30 @@ target_compile_definitions( PUBLIC MBGL_USE_GLES2 ) +include(${PROJECT_SOURCE_DIR}/vendor/icu.cmake) +include(${PROJECT_SOURCE_DIR}/vendor/sqlite.cmake) + +target_compile_options(mbgl-vendor-icu PRIVATE $<$<CONFIG:Release>:-Oz> $<$<CONFIG:Release>:-Qunused-arguments> $<$<CONFIG:Release>:-flto>) + +target_compile_options( + mbgl-vendor-sqlite + PRIVATE $<$<CONFIG:Release>:-Oz> $<$<CONFIG:Release>:-Qunused-arguments> $<$<CONFIG:Release>:-flto> +) + +target_compile_options( + mbgl-compiler-options + INTERFACE $<$<CONFIG:Release>:-Oz> $<$<CONFIG:Release>:-Qunused-arguments> $<$<CONFIG:Release>:-flto> +) + +target_link_libraries( + mbgl-compiler-options + INTERFACE + $<$<CONFIG:Release>:-O2> + $<$<CONFIG:Release>:-Wl,--icf=all> + $<$<CONFIG:Release>:-flto> + $<$<CONFIG:Release>:-fuse-ld=gold> +) + target_sources( mbgl-core PRIVATE @@ -214,9 +238,6 @@ target_include_directories( PRIVATE ${MBGL_ROOT}/platform/default/include ) -include(${PROJECT_SOURCE_DIR}/vendor/icu.cmake) -include(${PROJECT_SOURCE_DIR}/vendor/sqlite.cmake) - target_link_libraries( mbgl-core PRIVATE @@ -365,19 +386,4 @@ add_custom_command( WORKING_DIRECTORY ${MBGL_ROOT} ) -# Android has no concept of MinSizeRel on android.toolchain.cmake and provides configurations tuned for binary size. We can push it a bit -# more with code folding and LTO. -set_target_properties(example-custom-layer PROPERTIES LINK_FLAGS_RELEASE "-fuse-ld=gold -O2 -flto -Wl,--icf=all") -set_target_properties(mapbox-gl PROPERTIES LINK_FLAGS_RELEASE "-fuse-ld=gold -O2 -flto -Wl,--icf=all") -set_target_properties(mbgl-benchmark-runner PROPERTIES LINK_FLAGS_RELEASE "-fuse-ld=gold -O2 -flto -Wl,--icf=all") -set_target_properties(mbgl-render-test-runner PROPERTIES LINK_FLAGS_RELEASE "-fuse-ld=gold -O2 -flto -Wl,--icf=all") -set_target_properties(mbgl-test-runner PROPERTIES LINK_FLAGS_RELEASE "-fuse-ld=gold -O2 -flto -Wl,--icf=all") - -target_compile_options(example-custom-layer PRIVATE $<$<CONFIG:Release>:-Oz -Qunused-arguments -flto>) -target_compile_options(mapbox-gl PRIVATE $<$<CONFIG:Release>:-Oz -Qunused-arguments -flto>) -target_compile_options(mbgl-core PRIVATE $<$<CONFIG:Release>:-Oz -Qunused-arguments -flto>) -target_compile_options(mbgl-render-test-runner PRIVATE $<$<CONFIG:Release>:-Oz -Qunused-arguments -flto>) -target_compile_options(mbgl-vendor-icu PRIVATE $<$<CONFIG:Release>:-Oz -Qunused-arguments -flto>) -target_compile_options(mbgl-vendor-sqlite PRIVATE $<$<CONFIG:Release>:-Oz -Qunused-arguments -flto>) - install(TARGETS mapbox-gl LIBRARY DESTINATION lib) diff --git a/next/render-test/CMakeLists.txt b/next/render-test/CMakeLists.txt index 3cec9dc4bd..55accfcbb4 100644 --- a/next/render-test/CMakeLists.txt +++ b/next/render-test/CMakeLists.txt @@ -47,8 +47,4 @@ target_link_libraries( PUBLIC mbgl-core ) -if(CMAKE_SYSTEM_NAME STREQUAL Android) - set_target_properties(mbgl-render-test PROPERTIES LINK_FLAGS_RELEASE "-fuse-ld=gold -O2 -flto -Wl,--icf=safe") -endif() - set_property(TARGET mbgl-render-test PROPERTY FOLDER Core) diff --git a/next/test/CMakeLists.txt b/next/test/CMakeLists.txt index 5063111c6c..761064f5b2 100644 --- a/next/test/CMakeLists.txt +++ b/next/test/CMakeLists.txt @@ -166,8 +166,4 @@ target_link_libraries( PUBLIC mbgl-vendor-googletest ) -if(CMAKE_SYSTEM_NAME STREQUAL Android) - set_target_properties(mbgl-test PROPERTIES LINK_FLAGS_RELEASE "-fuse-ld=gold -O2 -flto -Wl,--icf=safe") -endif() - set_property(TARGET mbgl-test PROPERTY FOLDER Core) |