Skip to content

Commit

Permalink
Upgrade CMake mininum version to 3.24 and replace compile flags with …
Browse files Browse the repository at this point in the history
…generator expressions
  • Loading branch information
tdcosta100 committed Oct 25, 2024
1 parent d5642a8 commit 1e5ee01
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/actions/qt5-build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/maplibre/linux-builder:centos7-gcc11-cmake3.19
FROM ghcr.io/maplibre/linux-builder:centos7-gcc11-cmake3.24

# Copy and set the entry point
COPY entrypoint.sh /entrypoint.sh
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
cmake_minimum_required(VERSION 3.24 FATAL_ERROR)

option(MLN_WITH_CORE_ONLY "Build only the core bits, no platform code" OFF)
option(MLN_WITH_CLANG_TIDY "Build with clang-tidy checks enabled" OFF)
Expand Down
8 changes: 2 additions & 6 deletions platform/android/android.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@ target_link_libraries(
Mapbox::Base::jni.hpp
mbgl-compiler-options
$<$<BOOL:${curl_FOUND}>:curl::curl_static>
-Wl,--whole-archive
mbgl-test
-Wl,--no-whole-archive
$<LINK_LIBRARY:WHOLE_ARCHIVE,mbgl-test>
)


Expand Down Expand Up @@ -209,9 +207,7 @@ target_link_libraries(
PRIVATE
Mapbox::Base::jni.hpp
mbgl-compiler-options
-Wl,--whole-archive
mbgl-benchmark
-Wl,--no-whole-archive
$<LINK_LIBRARY:WHOLE_ARCHIVE,mbgl-benchmark>
)

add_custom_command(
Expand Down
8 changes: 2 additions & 6 deletions platform/linux/linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,7 @@ target_link_libraries(
mbgl-test-runner
PRIVATE
mbgl-compiler-options
-Wl,--whole-archive
mbgl-test
-Wl,--no-whole-archive
$<LINK_LIBRARY:WHOLE_ARCHIVE,mbgl-test>
)

add_executable(
Expand All @@ -217,9 +215,7 @@ target_link_libraries(
mbgl-benchmark-runner
PRIVATE
mbgl-compiler-options
-Wl,--whole-archive
mbgl-benchmark
-Wl,--no-whole-archive
$<LINK_LIBRARY:WHOLE_ARCHIVE,mbgl-benchmark>
)

add_executable(
Expand Down
2 changes: 1 addition & 1 deletion platform/macos/macos.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.19)
cmake_minimum_required(VERSION 3.24)
set(CMAKE_OSX_DEPLOYMENT_TARGET "14.3")

# Override default CMake NATIVE_ARCH_ACTUAL
Expand Down
2 changes: 1 addition & 1 deletion platform/qt/qt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ if(NOT MLN_QT_LIBRARY_ONLY)
else()
target_link_libraries(
mbgl-test-runner
PRIVATE -Wl,--whole-archive mbgl-test -Wl,--no-whole-archive
PRIVATE $<LINK_LIBRARY:WHOLE_ARCHIVE,mbgl-test>
)
endif()

Expand Down
8 changes: 3 additions & 5 deletions platform/windows/windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,8 @@ target_link_libraries(
mbgl-test-runner
PRIVATE
mbgl-compiler-options
-Wl,--whole-archive
mbgl-test
-Wl,--no-whole-archive
$<LINK_LIBRARY:WHOLE_ARCHIVE,mbgl-test>
$<IF:$<TARGET_EXISTS:libuv::uv_a>,libuv::uv_a,libuv::uv>
)

add_executable(
Expand All @@ -242,8 +241,7 @@ target_link_libraries(
mbgl-benchmark-runner
PRIVATE
mbgl-compiler-options
mbgl-benchmark
-WHOLEARCHIVE:mbgl-benchmark
$<LINK_LIBRARY:WHOLE_ARCHIVE,mbgl-benchmark>
$<IF:$<TARGET_EXISTS:libuv::uv_a>,libuv::uv_a,libuv::uv>
shlwapi
)
Expand Down
2 changes: 1 addition & 1 deletion render-test/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ android {
}
externalNativeBuild {
cmake {
version '3.19.0+'
version '3.24.0+'
path '../../../CMakeLists.txt'
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ else()
${PROJECT_SOURCE_DIR}/test/src/mbgl/test/http_server.cpp
PROPERTIES
COMPILE_FLAGS
-Wno-shadow
$<$<NOT:$<BOOL:${WIN32}>>:-Wno-shadow>
)
set_source_files_properties(
${PROJECT_SOURCE_DIR}/test/src/mbgl/test/http_server.cpp
Expand Down

0 comments on commit 1e5ee01

Please sign in to comment.