mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-04 17:23:33 +01:00
build: replace FindPkgConfig hack with BUILD_STATIC variable set by CI toolchain file
This commit is contained in:
parent
7c13d850b7
commit
056cee8585
3 changed files with 10 additions and 11 deletions
6
.github/toolchains/x86_64-w64-mingw32.cmake
vendored
6
.github/toolchains/x86_64-w64-mingw32.cmake
vendored
|
@ -1,6 +1,6 @@
|
|||
set(TARGET x86_64-w64-mingw32)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/.github/toolchains/${TARGET})
|
||||
set(BUILD_STATIC ON)
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
set(CMAKE_SYSROOT /usr/${TARGET})
|
||||
|
@ -16,7 +16,3 @@ set(ENV{PKG_CONFIG_LIBDIR} ${CMAKE_SYSROOT}/lib/pkgconfig:${CMAKE_SYSROOT}/share
|
|||
set(ENV{PKG_CONFIG_PATH} $ENV{PKG_CONFIG_LIBDIR})
|
||||
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-static")
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
# Hack: The toolchain file is evaluated too early to set the library suffixes, so we use a wrapper
|
||||
# around FindPkgConfig set it right before we search for libraries.
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
||||
|
||||
include(${CMAKE_ROOT}/Modules/FindPkgConfig.cmake)
|
|
@ -1,6 +1,14 @@
|
|||
cmake_minimum_required(VERSION 3.7)
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project(MINEDMAP CXX)
|
||||
|
||||
# May not work with all toolchains, added for the Windows CI build
|
||||
option(BUILD_STATIC "Create a statically linked MinedMap executable")
|
||||
|
||||
if(BUILD_STATIC)
|
||||
list(REMOVE_ITEM CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".dll.a")
|
||||
add_link_options("-static")
|
||||
endif()
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
pkg_check_modules(ZLIB REQUIRED IMPORTED_TARGET zlib)
|
||||
|
|
Loading…
Add table
Reference in a new issue