diff options
| author | Joakim L. Gilje <jgilje@jgilje.net> | 2020-11-23 18:43:23 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-23 09:43:23 -0800 |
| commit | d9633d939c665e527f8bda22669f543f03540b17 (patch) | |
| tree | 0cfe4b406fa116b4d962952f93781a3d65840232 /scripts/cmake | |
| parent | 42456b785a4508386f080ae8fad2642e056b747d (diff) | |
| download | vcpkg-d9633d939c665e527f8bda22669f543f03540b17.tar.gz vcpkg-d9633d939c665e527f8bda22669f543f03540b17.zip | |
[vcpkg] initial openbsd (community) support (#14549)
* initial openbsd support in vcpkg
* after clang-format
* hardcoded in the preferred compiler for openbsd in bootstrap scipt (thanks @tormfinn)
* Fetch a patched pkg-config because openbsd pkg-config lacks {fcfiledir}
* fixes from review feedback
* corrected hash for pkg-config.openbsd
* re-added missing endif()
* regenerate docs
* Update scripts/cmake/vcpkg_configure_meson.cmake
Co-authored-by: Nicole Mazzuca <mazzucan@outlook.com>
Diffstat (limited to 'scripts/cmake')
| -rw-r--r-- | scripts/cmake/vcpkg_build_make.cmake | 6 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_common_definitions.cmake | 16 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_configure_cmake.cmake | 2 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_configure_make.cmake | 3 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_configure_meson.cmake | 2 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_find_acquire_program.cmake | 11 |
6 files changed, 32 insertions, 8 deletions
diff --git a/scripts/cmake/vcpkg_build_make.cmake b/scripts/cmake/vcpkg_build_make.cmake index 6deded647..d74db5f45 100644 --- a/scripts/cmake/vcpkg_build_make.cmake +++ b/scripts/cmake/vcpkg_build_make.cmake @@ -94,7 +94,11 @@ function(vcpkg_build_make) #TODO: optimize for install-data (release) and install-exec (release/debug)
else()
# Compiler requriements
- find_program(MAKE make REQUIRED)
+ if(VCPKG_HOST_IS_OPENBSD)
+ find_program(MAKE gmake REQUIRED)
+ else()
+ find_program(MAKE make REQUIRED)
+ endif()
set(MAKE_COMMAND "${MAKE}")
# Set make command and install command
set(MAKE_OPTS ${_bc_MAKE_OPTIONS} V=1 -j ${VCPKG_CONCURRENCY} -f ${_bc_MAKEFILE} ${_bc_BUILD_TARGET})
diff --git a/scripts/cmake/vcpkg_common_definitions.cmake b/scripts/cmake/vcpkg_common_definitions.cmake index ee5288db2..33c66c3ec 100644 --- a/scripts/cmake/vcpkg_common_definitions.cmake +++ b/scripts/cmake/vcpkg_common_definitions.cmake @@ -4,8 +4,8 @@ ## ## ## The following variables are available: ## ```cmake -## VCPKG_TARGET_IS_<target> with <target> being one of the following: WINDOWS, UWP, LINUX, OSX, ANDROID, FREEBSD. only defined if <target> -## VCPKG_HOST_IS_<target> with <host> being one of the following: WINDOWS, LINUX, OSX, FREEBSD. only defined if <host> +## VCPKG_TARGET_IS_<target> with <target> being one of the following: WINDOWS, UWP, LINUX, OSX, ANDROID, FREEBSD, OPENBSD. only defined if <target> +## VCPKG_HOST_IS_<target> with <host> being one of the following: WINDOWS, LINUX, OSX, FREEBSD, OPENBSD. only defined if <host> ## VCPKG_HOST_PATH_SEPARATOR Host specific path separator (USAGE: "<something>${VCPKG_HOST_PATH_SEPARATOR}<something>"; only use and pass variables with VCPKG_HOST_PATH_SEPARATOR within "") ## VCPKG_HOST_EXECUTABLE_SUFFIX executable suffix of the host ## VCPKG_TARGET_EXECUTABLE_SUFFIX executable suffix of the target @@ -41,6 +41,8 @@ elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Android") set(VCPKG_TARGET_IS_ANDROID 1) elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") set(VCPKG_TARGET_IS_FREEBSD 1) +elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") + set(VCPKG_TARGET_IS_OPENBSD 1) elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW") set(VCPKG_TARGET_IS_WINDOWS 1) set(VCPKG_TARGET_IS_MINGW 1) @@ -55,6 +57,8 @@ elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") set(VCPKG_HOST_IS_LINUX 1) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD") set(VCPKG_HOST_IS_FREEBSD 1) +elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "OpenBSD") + set(VCPKG_HOST_IS_OPENBSD 1) endif() #Helper variable to identify the host path separator. @@ -136,17 +140,17 @@ if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_OSX) endif() # Platforms with libm -if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_MINGW) +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_OPENBSD OR VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_MINGW) list(APPEND VCPKG_SYSTEM_LIBRARIES m) endif() # Platforms with pthread -if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_MINGW) +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_OPENBSD OR VCPKG_TARGET_IS_MINGW) list(APPEND VCPKG_SYSTEM_LIBRARIES pthread) endif() # Platforms with libstdc++ -if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_MINGW) +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_OPENBSD OR VCPKG_TARGET_IS_MINGW) list(APPEND VCPKG_SYSTEM_LIBRARIES [=[stdc\+\+]=]) endif() @@ -161,7 +165,7 @@ if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_OSX OR VC endif() # Platforms with GCC libs -if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_MINGW) +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_OPENBSD OR VCPKG_TARGET_IS_MINGW) list(APPEND VCPKG_SYSTEM_LIBRARIES gcc) list(APPEND VCPKG_SYSTEM_LIBRARIES gcc_s) endif() diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 9f71b2208..14df78e53 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -217,6 +217,8 @@ function(vcpkg_configure_cmake) set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/ios.cmake") elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/freebsd.cmake") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/openbsd.cmake") elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW") set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake") endif() diff --git a/scripts/cmake/vcpkg_configure_make.cmake b/scripts/cmake/vcpkg_configure_make.cmake index 0d80e148c..8e079b64d 100644 --- a/scripts/cmake/vcpkg_configure_make.cmake +++ b/scripts/cmake/vcpkg_configure_make.cmake @@ -663,7 +663,8 @@ function(vcpkg_configure_make) if (CMAKE_HOST_WIN32)
set(command ${base_cmd} -c "${CONFIGURE_ENV} ./${RELATIVE_BUILD_PATH}/configure ${_csc_BUILD_TRIPLET} ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}")
else()
- set(command /bin/bash "./${RELATIVE_BUILD_PATH}/configure" ${_csc_BUILD_TRIPLET} ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}})
+ find_program(BASH bash REQUIRED) + set(command "${BASH}" "./${RELATIVE_BUILD_PATH}/configure" ${_csc_BUILD_TRIPLET} ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildtype}}) endif()
if(_csc_ADD_BIN_TO_PATH)
set(PATH_BACKUP $ENV{PATH})
diff --git a/scripts/cmake/vcpkg_configure_meson.cmake b/scripts/cmake/vcpkg_configure_meson.cmake index 982e3a5e1..8bcb654d9 100644 --- a/scripts/cmake/vcpkg_configure_meson.cmake +++ b/scripts/cmake/vcpkg_configure_meson.cmake @@ -143,6 +143,8 @@ function(vcpkg_internal_meson_generate_native_file_config _config) #https://meso set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/ios.cmake") elseif(VCPKG_TARGET_IS_FREEBSD) set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/freebsd.cmake") + elseif(VCPKG_TARGET_IS_OPENBSD) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/openbsd.cmake") elseif(VCPKG_TARGET_IS_MINGW) set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake") endif() diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 875ba1f14..970a41d7d 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -423,6 +423,17 @@ function(vcpkg_find_acquire_program VAR) debug_message(STATUS "PKG_CONFIG found in ENV! Using $ENV{PKG_CONFIG}") set(PKGCONFIG $ENV{PKG_CONFIG} PARENT_SCOPE) return() + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "OpenBSD") + # As of 6.8, the OpenBSD specific pkg-config doesn't support {pcfiledir} + set(_vfa_SUPPORTED ON) + set(_vfa_RENAME "pkg-config") + set(PKGCONFIG_VERSION 0.29.2.1) + set(NOEXTRACT ON) + set(ARCHIVE "pkg-config.openbsd") + set(SUBDIR "openbsd") + set(URL "https://raw.githubusercontent.com/jgilje/pkg-config-openbsd/master/pkg-config") + set(HASH b7ec9017b445e00ae1377e36e774cf3f5194ab262595840b449832707d11e443a102675f66d8b7e8b2e2f28cebd6e256835507b1e0c69644cc9febab8285080b) + set(VERSION_CMD --version) elseif(CMAKE_HOST_WIN32) if(NOT EXISTS "${PKGCONFIG}") set(VERSION 0.29.2-1) |
