xref: /freebsd/contrib/libfido2/windows/const.ps1 (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
1 # Copyright (c) 2021-2023 Yubico AB. All rights reserved.
2 # Use of this source code is governed by a BSD-style
3 # license that can be found in the LICENSE file.
4 # SPDX-License-Identifier: BSD-2-Clause
5 
6 # LibreSSL coordinates.
7 New-Variable -Name 'LIBRESSL_URL' `
8     -Value 'https://cloudflare.cdn.openbsd.org/pub/OpenBSD/LibreSSL' `
9     -Option Constant
10 New-Variable -Name 'LIBRESSL' -Value 'libressl-3.7.3' -Option Constant
11 New-Variable -Name 'CRYPTO_LIBRARIES' -Value 'crypto-50' -Option Constant
12 
13 # libcbor coordinates.
14 New-Variable -Name 'LIBCBOR' -Value 'libcbor-0.10.2' -Option Constant
15 New-Variable -Name 'LIBCBOR_BRANCH' -Value 'v0.10.2' -Option Constant
16 New-Variable -Name 'LIBCBOR_GIT' -Value 'https://github.com/pjk/libcbor' `
17     -Option Constant
18 
19 # zlib coordinates.
20 New-Variable -Name 'ZLIB' -Value 'zlib-1.3' -Option Constant
21 New-Variable -Name 'ZLIB_BRANCH' -Value 'v1.3' -Option Constant
22 New-Variable -Name 'ZLIB_GIT' -Value 'https://github.com/madler/zlib' `
23     -Option Constant
24 
25 # Work directories.
26 New-Variable -Name 'BUILD' -Value "$PSScriptRoot\..\build" -Option Constant
27 New-Variable -Name 'OUTPUT' -Value "$PSScriptRoot\..\output" -Option Constant
28 
29 # Prefixes.
30 New-Variable -Name 'STAGE' -Value "${BUILD}\${Arch}\${Type}" -Option Constant
31 New-Variable -Name 'PREFIX' -Value "${OUTPUT}\${Arch}\${Type}" -Option Constant
32 
33 # Build flags.
34 if ("${Type}" -eq "dynamic") {
35 	New-Variable -Name 'RUNTIME' -Value '/MD' -Option Constant
36 	New-Variable -Name 'SHARED' -Value 'ON' -Option Constant
37 	New-Variable -Name 'CMAKE_MSVC_RUNTIME_LIBRARY' -Option Constant `
38 	    -Value 'MultiThreaded$<$<CONFIG:Debug>:Debug>DLL'
39 } else {
40 	New-Variable -Name 'RUNTIME' -Value '/MT' -Option Constant
41 	New-Variable -Name 'SHARED' -Value 'OFF' -Option Constant
42 	New-Variable -Name 'CMAKE_MSVC_RUNTIME_LIBRARY' -Option Constant `
43 	    -Value 'MultiThreaded$<$<CONFIG:Debug>:Debug>'
44 }
45 New-Variable -Name 'CFLAGS_DEBUG' -Value "${RUNTIME}d /Zi /guard:cf /sdl" `
46     -Option Constant
47 New-Variable -Name 'CFLAGS_RELEASE' -Value "${RUNTIME} /Zi /guard:cf /sdl" `
48     -Option Constant
49