1
0
mirror of https://git.suyu.dev/suyu/suyu synced 2025-09-10 16:26:32 -05:00

Initial commit

This commit is contained in:
Crimson-Hawk
2024-03-05 16:42:40 +08:00
commit f1e4595ebf
39576 changed files with 7006612 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
# Copyright Rene Rivera 2015
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
exe predef_check_as_c : predef_check_as_c.c : <include>../include ;
exe predef_check_as_cpp : predef_check_as_cpp.cpp : <include>../include ;
exe predef_check_as_objc : predef_check_as_objc.m : <include>../include ;
exe predef_check_as_objcpp : predef_check_as_objcpp.mm : <include>../include ;

View File

@@ -0,0 +1,202 @@
# Copyright Rene Rivera 2015
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Defines rules that provide requirements based on checking
# conditions using Boost Predef definitions and version numbers.
import modules ;
import project ;
import feature ;
import string ;
import toolset ;
import modules ;
import path ;
import "class" : new ;
import regex ;
# Create a project for our targets.
project.extension predef check ;
# Feature to pass check expressions to check programs.
feature.feature predef-expression : : free ;
# Checks the expressions and when used evaluates to the true-properties
# if the expressions are all true. Otherwise evaluates to the
# false-properties.
rule check ( expressions + : language ? : true-properties * : false-properties * )
{
# Default to C++ on the check context.
language ?= cpp ;
local project_target = [ project.target $(__name__) ] ;
project.push-current $(project_target) ;
local terms ;
local result ;
for expression in $(expressions)
{
if $(expression:L) in "and" "or"
{
terms += $(expression:L) ;
}
else
{
# Create the check run if we don't have one yet.
local key = [ MD5 "$(language)::$(expression)" ] ;
if ! ( $(key) in $(_checks_) )
{
_checks_ += $(key) ;
_message_(/check/predef//predef_check_cc_$(key)) = $(expression) ;
check_target $(language) $(key) : [ change_term_to_def $(expression) ] ;
}
terms += /check/predef//predef_check_cc_$(key) ;
}
}
local instance = [ new check-expression-evaluator
$(terms) : $(true-properties) : $(false-properties) ] ;
result = <conditional>@$(instance).check ;
project.pop-current ;
return $(result) ;
}
# Checks the expressions and when used evaluates to <build>no
# if the expressions are all false. Otherwise evaluates to the
# nothing.
rule require ( expressions + : language ? )
{
return [ check $(expressions) : $(language) : : <build>no ] ;
}
#############################################################################
.c.ext = c ;
.cpp.ext = cpp ;
.objc.ext = m ;
.objcpp.ext = mm ;
# Check targets. Each needs to be compiled for different languages
# even though they are all the same source code.
local rule check_target ( language key : requirements * )
{
# Need to use absolute paths because we don't know the
# context of the invocation which affects where the paths
# originate from.
local predef_jam
= [ modules.binding $(__name__) ] ;
local source_path
= $(predef_jam:D)/predef_check_cc_as_$(language).$(.$(language).ext) ;
local include_path
= $(predef_jam:D)/../../include $(BOOST_ROOT) ;
obj predef_check_cc_$(key)
: $(source_path)
: <include>$(include_path) $(requirements) ;
explicit predef_check_cc_$(key) ;
return predef_check_cc_$(key) ;
}
local rule change_term_to_def ( term )
{
local parts = [ regex.split $(term) " " ] ;
if $(parts[3])
{
local version_number = [ regex.split $(parts[3]) "[.]" ] ;
if ! $(version_number[2]) { version_number += "0" ; }
if ! $(version_number[3]) { version_number += "0" ; }
parts = $(parts[1-2]) BOOST_VERSION_NUMBER($(version_number:J=",")) ;
}
return <define>CHECK=\"$(parts:J=" ")\" ;
}
class check-expression-evaluator
{
import configure ;
rule __init__ ( expression + : true-properties * : false-properties * )
{
self.expression = $(expression) ;
self.true-properties = $(true-properties) ;
self.false-properties = $(false-properties) ;
}
rule check ( properties * )
{
local to-eval ;
local tokens = "and" "or" ;
# Go through the expression and: eval the target values,
# and normalize to a full expression.
for local term in $(self.expression)
{
if ! ( $(term:L) in $(tokens) )
{
# A value is a target reference that will evan to "true"
# or "false".
if $(to-eval[-1]:L) && ! ( $(to-eval[-1]:L) in $(tokens) )
{
# Default to "and" operation.
to-eval += "and" ;
}
local message = [ modules.peek predef : _message_($(term)) ] ;
if [ configure.builds $(term) : $(properties) : $(message) ]
{
to-eval += "true" ;
}
else
{
to-eval += "false" ;
}
}
else
{
to-eval += $(term) ;
}
}
# Eval full the expression.
local eval-result = [ eval $(to-eval) ] ;
# And resolve true/false properties.
if $(eval-result) = "true"
{
return $(self.true-properties) ;
}
else
{
return $(self.false-properties) ;
}
}
rule eval ( e * )
{
local r ;
if $(e[1]) && $(e[2]) && $(e[3])
{
if $(e[2]) = "and"
{
if $(e[1]) = "true" && $(e[3]) = "true"
{
r = [ eval "true" $(e[4-]) ] ;
}
else
{
r = [ eval "false" $(e[4-]) ] ;
}
}
else if $(e[2]) = "or"
{
if $(e[1]) = "true" || $(e[3]) = "true"
{
r = [ eval "true" $(e[4-]) ] ;
}
else
{
r = [ eval "false" $(e[4-]) ] ;
}
}
}
else
{
r = $(e[1]) ;
}
return $(r) ;
}
}

View File

@@ -0,0 +1,98 @@
/*
Copyright Rene Rivera 2011-2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#include <boost/predef/detail/test_def.h>
const char * str_token(const char ** str, const char * space)
{
unsigned span;
char * token;
for (; **str != 0; *str += 1)
{
if (0 == strchr(space, **str))
{
break;
}
}
span = strcspn(*str, space);
token = (char *)malloc(span+1);
strncpy(token, *str, span);
token[span] = 0;
for (*str += span; **str != 0; *str += 1)
{
if (0 == strchr(space, **str))
{
break;
}
}
return token;
}
const char * whitespace = " ";
const char * dot = ".";
int main(int argc, const char ** argv)
{
unsigned x = 0;
int argi = 1;
create_predef_entries();
#if 0
qsort(generated_predef_info,generated_predef_info_count,
sizeof(predef_info),predef_info_compare);
for (x = 0; x < generated_predef_info_count; ++x)
{
printf("%s: %d\n", generated_predef_info[x].name, generated_predef_info[x].value);
}
#endif
int result = -1;
for (argi = 1; argi < argc; ++argi)
{
const char * exp = argv[argi];
const char * exp_name = str_token(&exp, whitespace);
const char * exp_op = str_token(&exp, whitespace);
const char * exp_val = str_token(&exp, whitespace);
unsigned exp_version = 0;
if (*exp_val != 0)
{
exp = exp_val;
const char * exp_val_a = str_token(&exp, dot);
const char * exp_val_b = str_token(&exp, dot);
const char * exp_val_c = str_token(&exp, dot);
exp_version = BOOST_VERSION_NUMBER(atoi(exp_val_a), atoi(exp_val_b),atoi(exp_val_c));
}
for (x = 0; x < generated_predef_info_count; ++x)
{
if (*exp_op == 0 &&
generated_predef_info[x].value > 0 &&
strcmp(exp_name, generated_predef_info[x].name) == 0)
{
/* Expression of the form "BOOST_x_yy" is true. */
result = 0;
break;
}
else if (*exp_op == 0 &&
generated_predef_info[x].value == 0 &&
strcmp(exp_name, generated_predef_info[x].name) == 0)
{
/* Expression of the form "BOOST_x_yy" is false. */
return argi;
}
else if (*exp_op != 0 && *exp_val != 0 &&
strcmp(exp_name, generated_predef_info[x].name) == 0)
{
/* Expression of the form "BOOST_x_yy op val". */
result = 0;
if (0 == strcmp(">",exp_op) && !(generated_predef_info[x].value > exp_version)) return argi;
if (0 == strcmp("<",exp_op) && !(generated_predef_info[x].value < exp_version)) return argi;
if (0 == strcmp(">=",exp_op) && !(generated_predef_info[x].value >= exp_version)) return argi;
if (0 == strcmp("<=",exp_op) && !(generated_predef_info[x].value <= exp_version)) return argi;
if (0 == strcmp("==",exp_op) && !(generated_predef_info[x].value == exp_version)) return argi;
if (0 == strcmp("!=",exp_op) && !(generated_predef_info[x].value != exp_version)) return argi;
}
}
}
return result;
}

View File

@@ -0,0 +1,7 @@
/*
Copyright Rene Rivera 2011-2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#include "predef_check.h"

View File

@@ -0,0 +1,7 @@
/*
Copyright Rene Rivera 2011-2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#include "predef_check.h"

View File

@@ -0,0 +1,7 @@
/*
Copyright Rene Rivera 2011-2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#include "predef_check.h"

View File

@@ -0,0 +1,7 @@
/*
Copyright Rene Rivera 2011-2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#include "predef_check.h"

View File

@@ -0,0 +1,19 @@
/*
Copyright Rene Rivera 2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#include <boost/predef.h>
#ifdef CHECK
# if ((CHECK) == 0)
# error "FAILED"
# endif
#endif
int dummy()
{
static int d = 0;
return d++;
}

View File

@@ -0,0 +1,7 @@
/*
Copyright Rene Rivera 2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#include "predef_check_cc.h"

View File

@@ -0,0 +1,7 @@
/*
Copyright Rene Rivera 2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#include "predef_check_cc.h"

View File

@@ -0,0 +1,7 @@
/*
Copyright Rene Rivera 2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#include "predef_check_cc.h"

View File

@@ -0,0 +1,7 @@
/*
Copyright Rene Rivera 2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#include "predef_check_cc.h"

View File

@@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,4 @@
The package boost is compatible with built-in CMake targets:
find_package(Boost REQUIRED [COMPONENTS <libs>...])
target_link_libraries(main PRIVATE Boost::boost Boost::<lib1> Boost::<lib2> ...)

View File

@@ -0,0 +1,115 @@
{
"$schema": "https://raw.githubusercontent.com/spdx/spdx-spec/v2.2.1/schemas/spdx-schema.json",
"spdxVersion": "SPDX-2.2",
"dataLicense": "CC0-1.0",
"SPDXID": "SPDXRef-DOCUMENT",
"documentNamespace": "https://spdx.org/spdxdocs/boost-predef-x64-windows-1.79.0-309b9960-6f6e-47ee-bbcf-d7d2860a3b65",
"name": "boost-predef:x64-windows@1.79.0 81dee9e0bcf888e119f86c0e53f2b816cb91df516cbab38757aa4502b0f9a74b",
"creationInfo": {
"creators": [
"Tool: vcpkg-9268e366206712e38102b28dbd1617697a99ff2e"
],
"created": "2022-07-23T08:22:05Z"
},
"relationships": [
{
"spdxElementId": "SPDXRef-port",
"relationshipType": "GENERATES",
"relatedSpdxElement": "SPDXRef-binary"
},
{
"spdxElementId": "SPDXRef-port",
"relationshipType": "CONTAINS",
"relatedSpdxElement": "SPDXRef-file-0"
},
{
"spdxElementId": "SPDXRef-port",
"relationshipType": "CONTAINS",
"relatedSpdxElement": "SPDXRef-file-1"
},
{
"spdxElementId": "SPDXRef-binary",
"relationshipType": "GENERATED_FROM",
"relatedSpdxElement": "SPDXRef-port"
},
{
"spdxElementId": "SPDXRef-file-0",
"relationshipType": "CONTAINED_BY",
"relatedSpdxElement": "SPDXRef-port"
},
{
"spdxElementId": "SPDXRef-file-1",
"relationshipType": "CONTAINED_BY",
"relatedSpdxElement": "SPDXRef-port"
},
{
"spdxElementId": "SPDXRef-file-1",
"relationshipType": "DEPENDENCY_MANIFEST_OF",
"relatedSpdxElement": "SPDXRef-port"
}
],
"packages": [
{
"name": "boost-predef",
"SPDXID": "SPDXRef-port",
"versionInfo": "1.79.0",
"downloadLocation": "NOASSERTION",
"homepage": "https://github.com/boostorg/predef",
"licenseConcluded": "BSL-1.0",
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
"description": "Boost predef module",
"comment": "This is the port (recipe) consumed by vcpkg."
},
{
"name": "boost-predef:x64-windows",
"SPDXID": "SPDXRef-binary",
"versionInfo": "81dee9e0bcf888e119f86c0e53f2b816cb91df516cbab38757aa4502b0f9a74b",
"downloadLocation": "NONE",
"licenseConcluded": "BSL-1.0",
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
"comment": "This is a binary package built by vcpkg."
},
{
"SPDXID": "SPDXRef-resource-1",
"name": "boostorg/predef",
"downloadLocation": "git+https://github.com/boostorg/predef@boost-1.79.0",
"licenseConcluded": "NOASSERTION",
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
"checksums": [
{
"algorithm": "SHA512",
"checksumValue": "329616d4b1e1e160b92f3f33f3172eeb124c9167616c29443804a817230c747fb51f211b2727b28c9a9a50364b4b7fb535000f22572e6db4f9e4b31b8ca375b9"
}
]
}
],
"files": [
{
"fileName": "./portfile.cmake",
"SPDXID": "SPDXRef-file-0",
"checksums": [
{
"algorithm": "SHA256",
"checksumValue": "8eb98cbb0b21f4da0925e63234255a89a8e5e584aa200166659e7148b957d89d"
}
],
"licenseConcluded": "NOASSERTION",
"copyrightText": "NOASSERTION"
},
{
"fileName": "./vcpkg.json",
"SPDXID": "SPDXRef-file-1",
"checksums": [
{
"algorithm": "SHA256",
"checksumValue": "d89698569e4924e1e9ea138ce584e2769dc2799ff4df44cd1381ddc81aa0b583"
}
],
"licenseConcluded": "NOASSERTION",
"copyrightText": "NOASSERTION"
}
]
}

View File

@@ -0,0 +1,12 @@
boost-vcpkg-helpers c81c7b003df356a1a120a7c0c2f5a2ac95f3c33b006a2a5b4c02dcf0c9f3deaa
cmake 3.23.2
features core
portfile.cmake 8eb98cbb0b21f4da0925e63234255a89a8e5e584aa200166659e7148b957d89d
ports.cmake 366c60b768113102408b32ac1d7c7b48ef7d30a477af2a220ecc222d9ffa3166
post_build_checks 2
powershell 7.2.5
triplet x64-windows
triplet_abi 4556164a2cd3dd6f4742101eabb46def7e71b6e5856faa88e5d005aac12a803c-c0600b35e024ce0485ed253ef5419f3686f7257cfb58cb6a24febcb600fc4b4c-27ebd443f77a6c449168adfa6ce8def60cf46e88
vcpkg.json d89698569e4924e1e9ea138ce584e2769dc2799ff4df44cd1381ddc81aa0b583
vcpkg_from_git 0aab20e34e84d52ba4763f009e539bfa8f418c41c918c8cf700156f1a8551a10
vcpkg_from_github b743742296a114ea1b18ae99672e02f142c4eb2bef7f57d36c038bedbfb0502f