dlang-sqlite inital
This commit is contained in:
commit
ce0a6c08e4
160 files changed
+362540
No files matched your search
@@ -0,0 +1,15 @@
|
|||||||
|
# CMakeList.txt : Top-level CMake project file, do global configuration
|
||||||
|
# and include sub-projects here.
|
||||||
|
#
|
||||||
|
cmake_minimum_required (VERSION 3.10)
|
||||||
|
|
||||||
|
# Enable Hot Reload for MSVC compilers if supported.
|
||||||
|
if (POLICY CMP0141)
|
||||||
|
cmake_policy(SET CMP0141 NEW)
|
||||||
|
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
project ("dlang.sqlite")
|
||||||
|
|
||||||
|
# Include sub-projects.
|
||||||
|
add_subdirectory ("dlang.sqlite")
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"configurePresets": [
|
||||||
|
{
|
||||||
|
"name": "windows-base",
|
||||||
|
"hidden": true,
|
||||||
|
"generator": "Ninja",
|
||||||
|
"binaryDir": "${sourceDir}/out/build/${presetName}",
|
||||||
|
"installDir": "${sourceDir}/out/install/${presetName}",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_C_COMPILER": "cl.exe",
|
||||||
|
"CMAKE_CXX_COMPILER": "cl.exe"
|
||||||
|
},
|
||||||
|
"condition": {
|
||||||
|
"type": "equals",
|
||||||
|
"lhs": "${hostSystemName}",
|
||||||
|
"rhs": "Windows"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x64-debug",
|
||||||
|
"displayName": "x64 Debug",
|
||||||
|
"inherits": "windows-base",
|
||||||
|
"architecture": {
|
||||||
|
"value": "x64",
|
||||||
|
"strategy": "external"
|
||||||
|
},
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Debug",
|
||||||
|
"CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "$env{VSINSTALLDIR}Common7/IDE/CommonExtensions/Microsoft/CMake/cmake/Microsoft/SegmentHeap.cmake"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x64-release",
|
||||||
|
"displayName": "x64 Release",
|
||||||
|
"inherits": "x64-debug",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Release",
|
||||||
|
"CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "$env{VSINSTALLDIR}Common7/IDE/CommonExtensions/Microsoft/CMake/cmake/Microsoft/SegmentHeap.cmake"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x86-debug",
|
||||||
|
"displayName": "x86 Debug",
|
||||||
|
"inherits": "windows-base",
|
||||||
|
"architecture": {
|
||||||
|
"value": "x86",
|
||||||
|
"strategy": "external"
|
||||||
|
},
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Debug",
|
||||||
|
"CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "$env{VSINSTALLDIR}Common7/IDE/CommonExtensions/Microsoft/CMake/cmake/Microsoft/SegmentHeap.cmake"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "x86-release",
|
||||||
|
"displayName": "x86 Release",
|
||||||
|
"inherits": "x86-debug",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Release",
|
||||||
|
"CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "$env{VSINSTALLDIR}Common7/IDE/CommonExtensions/Microsoft/CMake/cmake/Microsoft/SegmentHeap.cmake"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "linux-debug",
|
||||||
|
"displayName": "Linux Debug",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"binaryDir": "${sourceDir}/out/build/${presetName}",
|
||||||
|
"installDir": "${sourceDir}/out/install/${presetName}",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Debug"
|
||||||
|
},
|
||||||
|
"condition": {
|
||||||
|
"type": "equals",
|
||||||
|
"lhs": "${hostSystemName}",
|
||||||
|
"rhs": "Linux"
|
||||||
|
},
|
||||||
|
"vendor": {
|
||||||
|
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": {
|
||||||
|
"sourceDir": "$env{HOME}/.vs/$ms{projectDirName}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "macos-debug",
|
||||||
|
"displayName": "macOS Debug",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"binaryDir": "${sourceDir}/out/build/${presetName}",
|
||||||
|
"installDir": "${sourceDir}/out/install/${presetName}",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Debug"
|
||||||
|
},
|
||||||
|
"condition": {
|
||||||
|
"type": "equals",
|
||||||
|
"lhs": "${hostSystemName}",
|
||||||
|
"rhs": "Darwin"
|
||||||
|
},
|
||||||
|
"vendor": {
|
||||||
|
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": {
|
||||||
|
"sourceDir": "$env{HOME}/.vs/$ms{projectDirName}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# CMakeList.txt : CMake project for dlang.plugin.sdk, include source and define
|
||||||
|
# project specific logic here.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Add source to this project's executable.
|
||||||
|
include_directories(dlang/)
|
||||||
|
add_library (dlang.sqlite SHARED
|
||||||
|
"entry.cpp"
|
||||||
|
"dlang/src/compiler.cpp"
|
||||||
|
"dlang/src/lexer.cpp"
|
||||||
|
"dlang/src/parser.cpp"
|
||||||
|
"dlang/src/vm.cpp"
|
||||||
|
)
|
||||||
|
|
||||||
|
if (CMAKE_VERSION VERSION_GREATER 3.12)
|
||||||
|
set_property(TARGET dlang.sqlite PROPERTY CXX_STANDARD 20)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FetchContent)
|
||||||
|
|
||||||
|
FetchContent_Declare(
|
||||||
|
sqlite3
|
||||||
|
GIT_REPOSITORY https://github.com/sjinks/sqlite3-cmake.git
|
||||||
|
GIT_TAG v3.49.1
|
||||||
|
)
|
||||||
|
FetchContent_MakeAvailable(sqlite3)
|
||||||
|
|
||||||
|
target_link_libraries(dlang.sqlite PRIVATE
|
||||||
|
SQLite::SQLite3
|
||||||
|
)
|
||||||
|
|
||||||
|
# TODO: Add tests and install targets if needed.
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
#ifndef DLANG_COMPILER_HPP
|
||||||
|
#define DLANG_COMPILER_HPP
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "types/include.hpp"
|
||||||
|
#include "program.hpp"
|
||||||
|
|
||||||
|
#include "parser/expressions.hpp"
|
||||||
|
#include "parser/statements.hpp"
|
||||||
|
|
||||||
|
class Compiler
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
std::vector<double> _bytecode;
|
||||||
|
std::vector<std::string> _stringTable;
|
||||||
|
std::vector<std::string> _includes;
|
||||||
|
Program* _program = nullptr;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Emit(Opcodes op);
|
||||||
|
void Emit(const std::string& str);
|
||||||
|
void Emit(double value);
|
||||||
|
|
||||||
|
void Compile(Statement* stmt);
|
||||||
|
void Compile(Expression* expr);
|
||||||
|
|
||||||
|
void FinalCompile();
|
||||||
|
|
||||||
|
public:
|
||||||
|
Compiler(Program* program);
|
||||||
|
|
||||||
|
void Compile();
|
||||||
|
const std::vector<double>& GetBytecode() const;
|
||||||
|
|
||||||
|
void Print();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
#ifndef DLANG_HPP
|
||||||
|
#define DLANG_HPP
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "types/include.hpp"
|
||||||
|
|
||||||
|
#include "parser/expressions.hpp"
|
||||||
|
#include "parser/statements.hpp"
|
||||||
|
|
||||||
|
#include "lexer.hpp"
|
||||||
|
#include "parser.hpp"
|
||||||
|
#include "compiler.hpp"
|
||||||
|
|
||||||
|
#include "vm.hpp"
|
||||||
|
|
||||||
|
#include "helpers.hpp"
|
||||||
|
#include "libs/dev.hpp"
|
||||||
|
#include "libs/os.hpp"
|
||||||
|
#include "libs/math.hpp"
|
||||||
|
#include "libs/io.hpp"
|
||||||
|
#include "libs/debug.hpp"
|
||||||
|
#include "libs/string.hpp"
|
||||||
|
#include "libs/table.hpp"
|
||||||
|
#include "libs/list.hpp"
|
||||||
|
#include "libs/regex.hpp"
|
||||||
|
|
||||||
|
static void OpenStandardLibs(DlangVM* vm)
|
||||||
|
{
|
||||||
|
openlib_dev(vm);
|
||||||
|
openlib_os(vm);
|
||||||
|
openlib_math(vm);
|
||||||
|
openlib_io(vm);
|
||||||
|
openlib_debug(vm);
|
||||||
|
openlib_string(vm);
|
||||||
|
openlib_table(vm);
|
||||||
|
openlib_list(vm);
|
||||||
|
openlib_regex(vm);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,171 @@
|
|||||||
|
#ifndef DLANG_HELPERS_HPP
|
||||||
|
#define DLANG_HELPERS_HPP
|
||||||
|
|
||||||
|
#define _WINSOCK_DEPRECATED_NO_WARNINGS
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <winsock2.h>
|
||||||
|
#include <ws2tcpip.h>
|
||||||
|
#pragma comment(lib, "ws2_32.lib")
|
||||||
|
#else
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <cstring>
|
||||||
|
#define SOCKET int
|
||||||
|
#define INVALID_SOCKET -1
|
||||||
|
#define SOCKET_ERROR -1
|
||||||
|
#define closesocket close
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <sstream>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
|
static bool isvalidnumber(char c)
|
||||||
|
{
|
||||||
|
return ::isdigit(c) || c == '.' || c == ',';
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool IsStringNumber(const std::string& input)
|
||||||
|
{
|
||||||
|
return std::all_of(
|
||||||
|
input.begin(),
|
||||||
|
input.end(),
|
||||||
|
::isvalidnumber
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool IsIdentifier(const std::string& input)
|
||||||
|
{
|
||||||
|
if (!::isdigit(input.at(0)))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string DoubleToString(double val) {
|
||||||
|
double intPart;
|
||||||
|
double fracPart = std::modf(val, &intPart);
|
||||||
|
|
||||||
|
if (fracPart == 0.0) {
|
||||||
|
return std::to_string(static_cast<long long>(val));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
std::ostringstream oss;
|
||||||
|
oss << val;
|
||||||
|
return oss.str();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string NoSpacesString(const std::string& input)
|
||||||
|
{
|
||||||
|
std::string output = "";
|
||||||
|
for (const auto& c : input)
|
||||||
|
if (::isdigit(c) || ::isalpha(c) || c == '.')
|
||||||
|
output += c;
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string getLatestVersion(const std::string& host, const std::string& path) {
|
||||||
|
#ifdef _WIN32
|
||||||
|
WSADATA wsaData;
|
||||||
|
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) return "";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
SOCKET sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
|
if (sock == INVALID_SOCKET) {
|
||||||
|
#ifdef _WIN32
|
||||||
|
WSACleanup();
|
||||||
|
#endif
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
struct hostent* server = gethostbyname(host.c_str());
|
||||||
|
if (!server) {
|
||||||
|
closesocket(sock);
|
||||||
|
#ifdef _WIN32
|
||||||
|
WSACleanup();
|
||||||
|
#endif
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
struct sockaddr_in serv_addr;
|
||||||
|
::memset(&serv_addr, 0, sizeof(serv_addr));
|
||||||
|
serv_addr.sin_family = AF_INET;
|
||||||
|
::memcpy(&serv_addr.sin_addr.s_addr, server->h_addr, server->h_length);
|
||||||
|
serv_addr.sin_port = htons(80);
|
||||||
|
|
||||||
|
if (connect(sock, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) == SOCKET_ERROR) {
|
||||||
|
closesocket(sock);
|
||||||
|
#ifdef _WIN32
|
||||||
|
WSACleanup();
|
||||||
|
#endif
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string request = "GET " + path + " HTTP/1.0\r\nHost: " + host + "\r\nConnection: close\r\n\r\n";
|
||||||
|
send(sock, request.c_str(), (int)request.length(), 0);
|
||||||
|
|
||||||
|
std::string response;
|
||||||
|
char buffer[1024];
|
||||||
|
int bytesReceived;
|
||||||
|
while ((bytesReceived = recv(sock, buffer, sizeof(buffer) - 1, 0)) > 0) {
|
||||||
|
buffer[bytesReceived] = '\0';
|
||||||
|
response += buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
closesocket(sock);
|
||||||
|
#ifdef _WIN32
|
||||||
|
WSACleanup();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
size_t pos = response.find("\r\n\r\n");
|
||||||
|
if (pos != std::string::npos) {
|
||||||
|
return NoSpacesString(response.substr(pos + 4));
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
#define dlang_pop(vm) vm->Pop()
|
||||||
|
#define dlang_top(vm) (vm->stack.top())
|
||||||
|
#define dlang_tonumber(vm) std::get<double>(vm->stack.pop().data)
|
||||||
|
#define dlang_toboolean(vm) std::get<bool>(vm->stack.pop().data)
|
||||||
|
#define dlang_tostring(vm) std::get<std::string>(vm->stack.pop().data)
|
||||||
|
#define dlang_totoken(vm) (vm->stack.pop())
|
||||||
|
#define dlang_totable(vm) std::get<std::shared_ptr<DlangTable>>(vm->stack.pop().data)
|
||||||
|
#define dlang_tolist(vm) std::get<std::shared_ptr<DlangList>>(vm->stack.pop().data)
|
||||||
|
#define dlang_tocfunction(vm) std::get<NativeFunctionPtr>(vm->stack.pop().data)
|
||||||
|
|
||||||
|
#define dlang_pushnumber(vm, number) vm->PushNumber(number)
|
||||||
|
#define dlang_pushboolean(vm, boolean) vm->PushBoolean(boolean)
|
||||||
|
#define dlang_pushstring(vm, stringv) vm->PushString(stringv)
|
||||||
|
#define dlang_pushnil(vm) vm->stack.push(StackValue())
|
||||||
|
#define dlang_push(vm, stackval) vm->stack.push(stackval)
|
||||||
|
|
||||||
|
#define dlang_isnumber(vm) (vm->stack.peek().type == StackValueType::Int)
|
||||||
|
#define dlang_isstring(vm) (vm->stack.peek().type == StackValueType::String)
|
||||||
|
#define dlang_isboolean(vm) (vm->stack.peek().type == StackValueType::Bool)
|
||||||
|
#define dlang_istable(vm) (vm->stack.peek().type == StackValueType::Table)
|
||||||
|
#define dlang_islist(vm) (vm->stack.peek().type == StackValueType::List)
|
||||||
|
#define dlang_isfunction(vm) (vm->stack.peek().type == StackValueType::Function)
|
||||||
|
#define dlang_isnil(vm) (vm->stack.peek().type == StackValueType::NIL)
|
||||||
|
|
||||||
|
#define dlang_pushcfunction(vm, func) vm->PushCFunction(func)
|
||||||
|
#define dlang_setglobal(vm, name) vm->globals.Set(name, vm->stack.pop())
|
||||||
|
#define dlang_getglobal(vm, name) vm->stack.push(vm->globals.Get(name))
|
||||||
|
#define dlang_call(vm, args) vm->CallFunc(args)
|
||||||
|
|
||||||
|
#define dlang_newtable(vm) vm->stack.push(StackValue(StackValueType::Table, std::make_shared<DlangTable>()))
|
||||||
|
#define dlang_setfield(vm, keyName) vm->SetField(keyName)
|
||||||
|
#define dlang_getfield(vm, keyName) vm->GetField(keyName)
|
||||||
|
// dlang_getfieldp will pop the table from stack and not return it
|
||||||
|
#define dlang_getfieldp(vm, keyName) vm->GetField(keyName, true)
|
||||||
|
|
||||||
|
#define dlang_newlist(vm) vm->PushList(std::make_shared<DlangList>());
|
||||||
|
#define dlang_setindex(vm) vm->SetListIndex()
|
||||||
|
#define dlang_getindex(vm) vm->GetListIndex()
|
||||||
|
#define dlang_pushindex(vm) vm->PushListIndex();
|
||||||
|
|
||||||
|
#endif
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,91 @@
|
|||||||
|
#ifndef _LANGUAGE_HPP
|
||||||
|
#define _LANGUAGE_HPP
|
||||||
|
|
||||||
|
#include <array>
|
||||||
|
#include <string_view>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace Dlang::Language
|
||||||
|
{
|
||||||
|
// --- Single Character Tokens (char) ---
|
||||||
|
inline constexpr char op_endl = ';';
|
||||||
|
inline constexpr char op_exprstart = '(';
|
||||||
|
inline constexpr char op_exprend = ')';
|
||||||
|
inline constexpr char op_arraystart = '{';
|
||||||
|
inline constexpr char op_arrayend = '}';
|
||||||
|
inline constexpr char op_liststart = '[';
|
||||||
|
inline constexpr char op_listend = ']';
|
||||||
|
inline constexpr char op_equals = '=';
|
||||||
|
inline constexpr char op_multi = '*';
|
||||||
|
inline constexpr char op_add = '+';
|
||||||
|
inline constexpr char op_sub = '-';
|
||||||
|
inline constexpr char op_div = '/';
|
||||||
|
inline constexpr char op_separator = ',';
|
||||||
|
inline constexpr char op_above = '>';
|
||||||
|
inline constexpr char op_below = '<';
|
||||||
|
inline constexpr char op_colon = ':';
|
||||||
|
inline constexpr char op_dot = '.';
|
||||||
|
inline constexpr char op_not = '!';
|
||||||
|
inline constexpr char op_size = '#';
|
||||||
|
|
||||||
|
inline constexpr std::array single_char_tokens = {
|
||||||
|
op_endl, op_exprstart, op_exprend, op_arraystart, op_arrayend,
|
||||||
|
op_liststart, op_listend, op_equals, op_multi, op_add, op_sub,
|
||||||
|
op_div, op_separator, op_above, op_below, op_colon, op_dot, op_not,
|
||||||
|
op_size
|
||||||
|
};
|
||||||
|
|
||||||
|
// --- Multi-Character Operators (const char*) ---
|
||||||
|
inline constexpr const char* op_eq = "==";
|
||||||
|
inline constexpr const char* op_neq = "!=";
|
||||||
|
inline constexpr const char* op_gte = ">=";
|
||||||
|
inline constexpr const char* op_lte = "<=";
|
||||||
|
inline constexpr const char* op_add_assign = "+=";
|
||||||
|
inline constexpr const char* op_sub_assign = "-=";
|
||||||
|
inline constexpr const char* op_mul_assign = "*=";
|
||||||
|
inline constexpr const char* op_div_assign = "/=";
|
||||||
|
inline constexpr const char* op_and = "&&";
|
||||||
|
inline constexpr const char* op_or = "||";
|
||||||
|
|
||||||
|
// --- Keywords (const char*) ---
|
||||||
|
inline constexpr const char* kw_var = "var";
|
||||||
|
inline constexpr const char* kw_while = "while";
|
||||||
|
inline constexpr const char* kw_do = "do";
|
||||||
|
inline constexpr const char* kw_end = "end";
|
||||||
|
inline constexpr const char* kw_for = "for";
|
||||||
|
inline constexpr const char* kw_foreach = "foreach";
|
||||||
|
inline constexpr const char* kw_in = "in";
|
||||||
|
inline constexpr const char* kw_if = "if";
|
||||||
|
inline constexpr const char* kw_then = "then";
|
||||||
|
inline constexpr const char* kw_else = "else";
|
||||||
|
inline constexpr const char* kw_func = "func";
|
||||||
|
inline constexpr const char* kw_return = "return";
|
||||||
|
inline constexpr const char* kw_include = "include";
|
||||||
|
|
||||||
|
inline constexpr std::array<std::string_view, 13> keywords = {
|
||||||
|
kw_var, kw_while, kw_do, kw_end, kw_for, kw_foreach,
|
||||||
|
kw_in, kw_if, kw_then, kw_else, kw_func, kw_return, kw_include
|
||||||
|
};
|
||||||
|
|
||||||
|
// --- Booleans ---
|
||||||
|
inline constexpr const char* kw_true = "true";
|
||||||
|
inline constexpr const char* kw_false = "false";
|
||||||
|
|
||||||
|
constexpr bool IsSingleCharToken(char c)
|
||||||
|
{
|
||||||
|
return std::find(single_char_tokens.begin(), single_char_tokens.end(), c) != single_char_tokens.end();
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr bool IsKeyword(std::string_view token)
|
||||||
|
{
|
||||||
|
return std::find(keywords.begin(), keywords.end(), token) != keywords.end();
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr bool IsBoolean(std::string_view token)
|
||||||
|
{
|
||||||
|
return token == kw_true || token == kw_false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // _LANGUAGE_HPP
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
#ifndef DLANG_LEXER_HPP
|
||||||
|
#define DLANG_LEXER_HPP
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include "types/include.hpp"
|
||||||
|
|
||||||
|
class Lexer
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
std::vector<PreToken> _tokens;
|
||||||
|
std::vector<Token> _organizedTokens;
|
||||||
|
|
||||||
|
public:
|
||||||
|
Lexer() = default;
|
||||||
|
|
||||||
|
void Parse(const std::string& code);
|
||||||
|
void ParseOrganizedTokens();
|
||||||
|
|
||||||
|
std::vector<PreToken> GetTokens() const;
|
||||||
|
std::vector<Token> GetOrganizedTokens() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
#ifndef DLANG_LIBS_DEBUG_HPP
|
||||||
|
#define DLANG_LIBS_DEBUG_HPP
|
||||||
|
|
||||||
|
#include "../vm.hpp"
|
||||||
|
#include "../helpers.hpp"
|
||||||
|
|
||||||
|
static void NativeStackDump(DlangVM* vm)
|
||||||
|
{
|
||||||
|
std::stringstream ss;
|
||||||
|
for (int i = 0; i < dlang_top(vm); i++)
|
||||||
|
{
|
||||||
|
auto value = vm->stack[i];
|
||||||
|
|
||||||
|
if (value.type == StackValueType::NIL)
|
||||||
|
printf("%i\t%s\n");
|
||||||
|
else if (value.type == StackValueType::Int)
|
||||||
|
printf("%i\t%s\n", i, std::to_string(std::get<double>(value.data)).c_str());
|
||||||
|
else if (value.type == StackValueType::Bool)
|
||||||
|
printf("%i\t%s\n", i, std::get<bool>(value.data) ? "True" : "False");
|
||||||
|
else if (value.type == StackValueType::String)
|
||||||
|
printf("%i\t%s\n", i, std::get<std::string>(value.data).c_str());
|
||||||
|
else if (value.type == StackValueType::Function)
|
||||||
|
{
|
||||||
|
auto func = std::get<std::shared_ptr<DlangFunction>>(value.data);
|
||||||
|
|
||||||
|
if (func->isNative)
|
||||||
|
printf("%i\tfunction\tnative\t0x%llX\n", i, func->nativeFunction);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("%i\tfunction\tnon-native\tlocation: %i\n", i, static_cast<int64_t>(func->bodyAddress));
|
||||||
|
printf("\tParameters:\n");
|
||||||
|
|
||||||
|
for (const auto& param : func->parameters)
|
||||||
|
printf("\t\t%s\n", param.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (value.type == StackValueType::Table)
|
||||||
|
printf("%i\ttable\t0x%llX\n", i, std::get<std::shared_ptr<DlangTable>>(value.data).get());
|
||||||
|
else
|
||||||
|
printf("%i\tunknown\n", i);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeGlobalsDump(DlangVM* vm)
|
||||||
|
{
|
||||||
|
std::stringstream ss;
|
||||||
|
for (int i = 0; i < vm->globals.top(); i++)
|
||||||
|
{
|
||||||
|
auto value = vm->globals.Get(i);
|
||||||
|
|
||||||
|
if (value.type == StackValueType::NIL)
|
||||||
|
printf("%i\t%s\n");
|
||||||
|
else if (value.type == StackValueType::Int)
|
||||||
|
printf("%i\t%s\n", i, std::to_string(std::get<double>(value.data)).c_str());
|
||||||
|
else if (value.type == StackValueType::Bool)
|
||||||
|
printf("%i\t%s\n", i, std::get<bool>(value.data) ? "True" : "False");
|
||||||
|
else if (value.type == StackValueType::String)
|
||||||
|
printf("%i\t%s\n", i, std::get<std::string>(value.data).c_str());
|
||||||
|
else if (value.type == StackValueType::Function)
|
||||||
|
{
|
||||||
|
auto func = std::get<std::shared_ptr<DlangFunction>>(value.data);
|
||||||
|
|
||||||
|
if (func->isNative)
|
||||||
|
printf("%i\tfunction\tnative\t0x%llX\n", i, func->nativeFunction);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("%i\tfunction\tnon-native\tlocation: %i\n", i, static_cast<int64_t>(func->bodyAddress));
|
||||||
|
printf("\tParameters:\n");
|
||||||
|
|
||||||
|
for (const auto& param : func->parameters)
|
||||||
|
printf("\t\t%s\n", param.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (value.type == StackValueType::Table)
|
||||||
|
printf("%i\ttable\t0x%llX\n", i, std::get<std::shared_ptr<DlangTable>>(value.data).get());
|
||||||
|
else
|
||||||
|
printf("%i\tunknown\n", i);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void openlib_debug(DlangVM* vm)
|
||||||
|
{
|
||||||
|
dlang_newtable(vm);
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeStackDump);
|
||||||
|
dlang_setfield(vm, "stackDump");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeGlobalsDump);
|
||||||
|
dlang_setfield(vm, "globalsDump");
|
||||||
|
|
||||||
|
dlang_setglobal(vm, "debug");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
#ifndef DLANG_LIBS_DEV_HPP
|
||||||
|
#define DLANG_LIBS_DEV_HPP
|
||||||
|
|
||||||
|
#include "../vm.hpp"
|
||||||
|
#include "../helpers.hpp"
|
||||||
|
|
||||||
|
static void NativePrint(DlangVM* vm)
|
||||||
|
{
|
||||||
|
std::stringstream ss;
|
||||||
|
auto argCount = dlang_top(vm);
|
||||||
|
|
||||||
|
std::vector<StackValue> values;
|
||||||
|
for (int i = 0; i < argCount; ++i)
|
||||||
|
values.push_back(dlang_totoken(vm));
|
||||||
|
|
||||||
|
for (auto it = values.rbegin(); it != values.rend(); ++it)
|
||||||
|
{
|
||||||
|
if (it->type == StackValueType::NIL)
|
||||||
|
{
|
||||||
|
printf("nil");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
std::visit([&ss](auto&& arg) {
|
||||||
|
using T = std::decay_t<decltype(arg)>;
|
||||||
|
if constexpr (std::is_same_v<T, bool>) {
|
||||||
|
ss << (arg ? "true" : "false") << " ";
|
||||||
|
}
|
||||||
|
else if constexpr (std::is_same_v<T, double>) {
|
||||||
|
ss << DoubleToString(arg) << " ";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ss << arg << " ";
|
||||||
|
}
|
||||||
|
}, it->data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cout << ss.str() << '\n';
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeToNumber(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto content = dlang_tostring(vm);
|
||||||
|
try {
|
||||||
|
dlang_pushnumber(vm, std::stod(content));
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
dlang_pushnumber(vm, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeIsNil(DlangVM* vm)
|
||||||
|
{
|
||||||
|
dlang_pushboolean(vm, dlang_isnil(vm));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeIsString(DlangVM* vm)
|
||||||
|
{
|
||||||
|
dlang_pushboolean(vm, dlang_isstring(vm));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeIsNumber(DlangVM* vm)
|
||||||
|
{
|
||||||
|
dlang_pushboolean(vm, dlang_isnumber(vm));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeIsBoolean(DlangVM* vm)
|
||||||
|
{
|
||||||
|
dlang_pushboolean(vm, dlang_isboolean(vm));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeRequire(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto name = dlang_tostring(vm);
|
||||||
|
|
||||||
|
if (vm->loadedPlugins.Contains(name))
|
||||||
|
{
|
||||||
|
dlang_pushstring(vm, "plugin already loaded!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* rawPtr = pluginManager->GetOrLoadInitFunc("./plugins/" + name);
|
||||||
|
if (rawPtr)
|
||||||
|
{
|
||||||
|
vm->loadedPlugins.push(name);
|
||||||
|
|
||||||
|
using InitFunc = void(*)(DlangVM*);
|
||||||
|
auto init = reinterpret_cast<InitFunc>(rawPtr);
|
||||||
|
init(vm);
|
||||||
|
|
||||||
|
dlang_pushstring(vm, "plugin loaded!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
dlang_pushstring(vm, "Failed to load plugin!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void openlib_dev(DlangVM* vm)
|
||||||
|
{
|
||||||
|
dlang_pushcfunction(vm, NativePrint);
|
||||||
|
dlang_setglobal(vm, "print");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeToNumber);
|
||||||
|
dlang_setglobal(vm, "tonumber");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeIsNil);
|
||||||
|
dlang_setglobal(vm, "isnil");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeIsString);
|
||||||
|
dlang_setglobal(vm, "isstring");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeIsNumber);
|
||||||
|
dlang_setglobal(vm, "isnumber");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeIsBoolean);
|
||||||
|
dlang_setglobal(vm, "isbool");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeRequire);
|
||||||
|
dlang_setglobal(vm, "require");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
#ifndef DLANG_LIBS_IO_HPP
|
||||||
|
#define DLANG_LIBS_IO_HPP
|
||||||
|
|
||||||
|
#include <fstream>
|
||||||
|
#include "../vm.hpp"
|
||||||
|
#include "../helpers.hpp"
|
||||||
|
|
||||||
|
static void NativeRead(DlangVM* vm)
|
||||||
|
{
|
||||||
|
bool binary = false;
|
||||||
|
if (dlang_isboolean(vm))
|
||||||
|
binary = dlang_toboolean(vm);
|
||||||
|
std::string path = dlang_tostring(vm);
|
||||||
|
|
||||||
|
std::ifstream stream(path, (binary ? std::ios::binary : std::ios::in));
|
||||||
|
if (!stream.is_open())
|
||||||
|
{
|
||||||
|
dlang_pushstring(vm, "Failed to open file!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string content(
|
||||||
|
(std::istreambuf_iterator<char>(stream)),
|
||||||
|
std::istreambuf_iterator<char>()
|
||||||
|
);
|
||||||
|
|
||||||
|
stream.close();
|
||||||
|
|
||||||
|
dlang_pushstring(vm, content);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeWrite(DlangVM* vm)
|
||||||
|
{
|
||||||
|
bool binary = false;
|
||||||
|
if (dlang_isboolean(vm))
|
||||||
|
binary = dlang_toboolean(vm);
|
||||||
|
|
||||||
|
std::string content = dlang_tostring(vm);
|
||||||
|
std::string path = dlang_tostring(vm);
|
||||||
|
|
||||||
|
std::ofstream stream(path, (binary ? std::ios::binary : std::ios::out));
|
||||||
|
if (!stream.is_open())
|
||||||
|
{
|
||||||
|
dlang_pushboolean(vm, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
stream.write(reinterpret_cast<const char*>(content.data()), content.size());
|
||||||
|
stream.close();
|
||||||
|
|
||||||
|
dlang_pushboolean(vm, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeInput(DlangVM* vm)
|
||||||
|
{
|
||||||
|
if (dlang_isstring(vm))
|
||||||
|
{
|
||||||
|
auto promp = dlang_tostring(vm);
|
||||||
|
printf("%s", promp.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string inputLine;
|
||||||
|
if (std::getline(std::cin, inputLine))
|
||||||
|
dlang_pushstring(vm, inputLine);
|
||||||
|
else
|
||||||
|
dlang_pushstring(vm, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void openlib_io(DlangVM* vm)
|
||||||
|
{
|
||||||
|
dlang_newtable(vm);
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeRead);
|
||||||
|
dlang_setfield(vm, "read");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeWrite);
|
||||||
|
dlang_setfield(vm, "write");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeInput);
|
||||||
|
dlang_setfield(vm, "input");
|
||||||
|
|
||||||
|
dlang_setglobal(vm, "io");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
#ifndef DLANG_LIBS_LIST_HPP
|
||||||
|
#define DLANG_LIBS_LIST_HPP
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
#include <thread>
|
||||||
|
#include "../vm.hpp"
|
||||||
|
#include "../helpers.hpp"
|
||||||
|
|
||||||
|
void NativeListInsert(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto newListOrValue = dlang_pop(vm);
|
||||||
|
auto insertList = dlang_tolist(vm);
|
||||||
|
|
||||||
|
if (newListOrValue.type == StackValueType::List)
|
||||||
|
{
|
||||||
|
auto list = std::get<std::shared_ptr<DlangList>>(newListOrValue.data);
|
||||||
|
|
||||||
|
for (const auto& val : list->values)
|
||||||
|
insertList->values.push_back(val);
|
||||||
|
}
|
||||||
|
else if (newListOrValue.type == StackValueType::Int ||
|
||||||
|
newListOrValue.type == StackValueType::Bool ||
|
||||||
|
newListOrValue.type == StackValueType::String)
|
||||||
|
insertList->values.push_back(newListOrValue);
|
||||||
|
|
||||||
|
dlang_push(vm, StackValue(StackValueType::List, insertList));
|
||||||
|
}
|
||||||
|
|
||||||
|
void NativeListRemove(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto idx = dlang_tonumber(vm);
|
||||||
|
auto list = dlang_tolist(vm);
|
||||||
|
|
||||||
|
list->values.erase(list->values.begin() + idx);
|
||||||
|
|
||||||
|
dlang_push(vm, StackValue(StackValueType::List, list));
|
||||||
|
}
|
||||||
|
|
||||||
|
void NativeListConcat(DlangVM* vm)
|
||||||
|
{
|
||||||
|
std::string seperator = "";
|
||||||
|
if (dlang_isstring(vm))
|
||||||
|
seperator = dlang_tostring(vm);
|
||||||
|
|
||||||
|
auto list = dlang_tolist(vm);
|
||||||
|
|
||||||
|
std::stringstream ss;
|
||||||
|
for (const auto& item : list->values)
|
||||||
|
{
|
||||||
|
switch (item.type)
|
||||||
|
{
|
||||||
|
case StackValueType::Int:
|
||||||
|
ss << std::get<double>(item.data);
|
||||||
|
break;
|
||||||
|
case StackValueType::Bool:
|
||||||
|
ss << std::get<bool>(item.data) ? "True" : "False";
|
||||||
|
break;
|
||||||
|
case StackValueType::String:
|
||||||
|
ss << std::get<std::string>(item.data);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!seperator.empty())
|
||||||
|
ss << seperator;
|
||||||
|
}
|
||||||
|
|
||||||
|
dlang_pushstring(vm, ss.str().substr(0, ss.str().size() - seperator.size()));
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void openlib_list(DlangVM* vm)
|
||||||
|
{
|
||||||
|
dlang_newtable(vm);
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeListInsert);
|
||||||
|
dlang_setfield(vm, "insert");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeListRemove);
|
||||||
|
dlang_setfield(vm, "remove");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeListConcat);
|
||||||
|
dlang_setfield(vm, "concat");
|
||||||
|
|
||||||
|
dlang_setglobal(vm, "list");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
#ifndef DLANG_LIBS_MATH_HPP
|
||||||
|
#define DLANG_LIBS_MATH_HPP
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
#include <thread>
|
||||||
|
#include <random>
|
||||||
|
|
||||||
|
#include "../vm.hpp"
|
||||||
|
#include "../helpers.hpp"
|
||||||
|
|
||||||
|
static void NativeMathAbs(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto val = dlang_tonumber(vm);
|
||||||
|
dlang_pushnumber(vm, std::fabs(val));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeMathFloor(DlangVM* vm)
|
||||||
|
{
|
||||||
|
double val = dlang_tonumber(vm);
|
||||||
|
dlang_pushnumber(vm, std::floor(val));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeMathCeil(DlangVM* vm)
|
||||||
|
{
|
||||||
|
double val = dlang_tonumber(vm);
|
||||||
|
dlang_pushnumber(vm, std::ceil(val));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeMathSqrt(DlangVM* vm)
|
||||||
|
{
|
||||||
|
double val = dlang_tonumber(vm);
|
||||||
|
dlang_pushnumber(vm, std::sqrt(val));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeMathPow(DlangVM* vm)
|
||||||
|
{
|
||||||
|
double exp = dlang_tonumber(vm);
|
||||||
|
double base = dlang_tonumber(vm);
|
||||||
|
dlang_pushnumber(vm, std::pow(base, exp));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeMathSin(DlangVM* vm)
|
||||||
|
{
|
||||||
|
double val = dlang_tonumber(vm);
|
||||||
|
dlang_pushnumber(vm, std::sin(val));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeMathCos(DlangVM* vm)
|
||||||
|
{
|
||||||
|
double val = dlang_tonumber(vm);
|
||||||
|
dlang_pushnumber(vm, std::cos(val));
|
||||||
|
}
|
||||||
|
|
||||||
|
thread_local static std::random_device rd;
|
||||||
|
thread_local static std::mt19937 gen(rd());
|
||||||
|
|
||||||
|
static void NativeMathSeed(DlangVM* vm)
|
||||||
|
{
|
||||||
|
double seedVal = dlang_tonumber(vm);
|
||||||
|
gen.seed(static_cast<unsigned int>(seedVal));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeMathRandom(DlangVM* vm)
|
||||||
|
{
|
||||||
|
double max = dlang_tonumber(vm);
|
||||||
|
double min = dlang_tonumber(vm);
|
||||||
|
|
||||||
|
std::uniform_real_distribution<double> dis(min, max);
|
||||||
|
dlang_pushnumber(vm, dis(gen));
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void openlib_math(DlangVM* vm)
|
||||||
|
{
|
||||||
|
dlang_newtable(vm);
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeMathAbs);
|
||||||
|
dlang_setfield(vm, "abs");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeMathFloor);
|
||||||
|
dlang_setfield(vm, "floor");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeMathCeil);
|
||||||
|
dlang_setfield(vm, "ceil");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeMathSqrt);
|
||||||
|
dlang_setfield(vm, "sqrt");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeMathPow);
|
||||||
|
dlang_setfield(vm, "pow");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeMathSin);
|
||||||
|
dlang_setfield(vm, "sin");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeMathCos);
|
||||||
|
dlang_setfield(vm, "cos");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeMathSeed);
|
||||||
|
dlang_setfield(vm, "seed");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeMathRandom);
|
||||||
|
dlang_setfield(vm, "random");
|
||||||
|
|
||||||
|
dlang_setglobal(vm, "math");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
#ifndef DLANG_LIBS_OS_HPP
|
||||||
|
#define DLANG_LIBS_OS_HPP
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
#include <thread>
|
||||||
|
#include <filesystem>
|
||||||
|
#include "../vm.hpp"
|
||||||
|
#include "../helpers.hpp"
|
||||||
|
|
||||||
|
static void NativeOsTime(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto now = std::chrono::system_clock::now();
|
||||||
|
auto duration = std::chrono::duration_cast<std::chrono::seconds>(now.time_since_epoch()).count();
|
||||||
|
|
||||||
|
dlang_pushnumber(vm, duration);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeSleep(DlangVM* vm) {
|
||||||
|
double ms = dlang_tonumber(vm);
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(static_cast<int64_t>(ms)));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeClock(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto now = std::chrono::steady_clock::now();
|
||||||
|
auto duration = std::chrono::duration_cast<std::chrono::seconds>(now.time_since_epoch()).count();
|
||||||
|
|
||||||
|
dlang_pushnumber(vm, duration);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeCreateDir(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto dir = dlang_tostring(vm);
|
||||||
|
std::filesystem::create_directories(dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeRemove(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto path = dlang_tostring(vm);
|
||||||
|
std::filesystem::remove_all(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeListDir(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto dir = dlang_tostring(vm);
|
||||||
|
|
||||||
|
dlang_newlist(vm);
|
||||||
|
|
||||||
|
for (const auto& entry : std::filesystem::directory_iterator(dir))
|
||||||
|
{
|
||||||
|
dlang_pushstring(vm, entry.path().string());
|
||||||
|
dlang_pushindex(vm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void openlib_os(DlangVM* vm)
|
||||||
|
{
|
||||||
|
dlang_newtable(vm);
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeOsTime);
|
||||||
|
dlang_setfield(vm, "time");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeSleep);
|
||||||
|
dlang_setfield(vm, "sleep");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeClock);
|
||||||
|
dlang_setfield(vm, "clock");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeCreateDir);
|
||||||
|
dlang_setfield(vm, "createdir");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeRemove);
|
||||||
|
dlang_setfield(vm, "remove");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeListDir);
|
||||||
|
dlang_setfield(vm, "listdir");
|
||||||
|
|
||||||
|
dlang_setglobal(vm, "os");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
#ifndef DLANG_LIBS_REGEX_HPP
|
||||||
|
#define DLANG_LIBS_REGEX_HPP
|
||||||
|
|
||||||
|
#include <regex>
|
||||||
|
#include <string>
|
||||||
|
#include "../vm.hpp"
|
||||||
|
#include "../helpers.hpp"
|
||||||
|
|
||||||
|
static void NativeRegexMatch(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto pattern = dlang_tostring(vm);
|
||||||
|
auto text = dlang_tostring(vm);
|
||||||
|
|
||||||
|
try {
|
||||||
|
std::regex rx(pattern);
|
||||||
|
bool matched = std::regex_match(text, rx);
|
||||||
|
dlang_pushnumber(vm, matched ? 1.0 : 0.0);
|
||||||
|
}
|
||||||
|
catch (...) {
|
||||||
|
dlang_pushnumber(vm, 0.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeRegexSearch(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto pattern = dlang_tostring(vm);
|
||||||
|
auto text = dlang_tostring(vm);
|
||||||
|
|
||||||
|
try {
|
||||||
|
std::regex rx(pattern);
|
||||||
|
bool found = std::regex_search(text, rx);
|
||||||
|
dlang_pushnumber(vm, found ? 1.0 : 0.0);
|
||||||
|
}
|
||||||
|
catch (...) {
|
||||||
|
dlang_pushnumber(vm, 0.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeRegexReplace(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto fmt = dlang_tostring(vm);
|
||||||
|
auto pattern = dlang_tostring(vm);
|
||||||
|
auto text = dlang_tostring(vm);
|
||||||
|
|
||||||
|
try {
|
||||||
|
std::regex rx(pattern);
|
||||||
|
std::string result = std::regex_replace(text, rx, fmt);
|
||||||
|
dlang_pushstring(vm, result);
|
||||||
|
dlang_pushindex(vm);
|
||||||
|
}
|
||||||
|
catch (...) {
|
||||||
|
dlang_pushstring(vm, text);
|
||||||
|
dlang_pushindex(vm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void openlib_regex(DlangVM* vm)
|
||||||
|
{
|
||||||
|
dlang_newtable(vm);
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeRegexMatch);
|
||||||
|
dlang_setfield(vm, "match");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeRegexSearch);
|
||||||
|
dlang_setfield(vm, "search");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeRegexReplace);
|
||||||
|
dlang_setfield(vm, "replace");
|
||||||
|
|
||||||
|
dlang_setglobal(vm, "regex");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,146 @@
|
|||||||
|
#ifndef DLANG_LIBS_STRING_HPP
|
||||||
|
#define DLANG_LIBS_STRING_HPP
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
#include <thread>
|
||||||
|
#include "../vm.hpp"
|
||||||
|
#include "../helpers.hpp"
|
||||||
|
|
||||||
|
static void NativeSubString(DlangVM* vm)
|
||||||
|
{
|
||||||
|
double to = -1;
|
||||||
|
if (dlang_top(vm) > 2)
|
||||||
|
to = dlang_tonumber(vm);
|
||||||
|
|
||||||
|
auto from = dlang_tonumber(vm);
|
||||||
|
auto str = dlang_tostring(vm);
|
||||||
|
|
||||||
|
if (to == -1)
|
||||||
|
dlang_pushstring(vm, str.substr(from));
|
||||||
|
else
|
||||||
|
dlang_pushstring(vm, str.substr(from, to));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeContains(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto needle = dlang_tostring(vm);
|
||||||
|
auto haystack = dlang_tostring(vm);
|
||||||
|
|
||||||
|
auto found = haystack.find(needle);
|
||||||
|
dlang_pushboolean(vm, found != std::string::npos);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeReplace(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto to = dlang_tostring(vm);
|
||||||
|
auto from = dlang_tostring(vm);
|
||||||
|
auto str = dlang_tostring(vm);
|
||||||
|
|
||||||
|
size_t startPos = 0;
|
||||||
|
if (!from.empty())
|
||||||
|
{
|
||||||
|
while ((startPos = str.find(from, startPos)) != std::string::npos)
|
||||||
|
{
|
||||||
|
str.replace(startPos, from.length(), to);
|
||||||
|
startPos += to.length();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dlang_pushstring(vm, str);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeLower(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto str = dlang_tostring(vm);
|
||||||
|
|
||||||
|
std::transform(
|
||||||
|
str.begin(), str.end(),
|
||||||
|
str.begin(), ::tolower
|
||||||
|
);
|
||||||
|
|
||||||
|
dlang_pushstring(vm, str);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeUpper(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto str = dlang_tostring(vm);
|
||||||
|
|
||||||
|
std::transform(
|
||||||
|
str.begin(), str.end(),
|
||||||
|
str.begin(), ::toupper
|
||||||
|
);
|
||||||
|
|
||||||
|
dlang_pushstring(vm, str);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeSplit(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto delimiter = dlang_tostring(vm);
|
||||||
|
auto str = dlang_tostring(vm);
|
||||||
|
|
||||||
|
std::vector<std::string> parts;
|
||||||
|
|
||||||
|
if (delimiter.empty()) {
|
||||||
|
for (char c : str) {
|
||||||
|
parts.push_back(std::string(1, c));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
size_t pos = 0;
|
||||||
|
size_t delimSize = delimiter.size();
|
||||||
|
|
||||||
|
while ((pos = str.find(delimiter)) != std::string::npos) {
|
||||||
|
parts.push_back(str.substr(0, pos));
|
||||||
|
str.erase(0, pos + delimSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
parts.push_back(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
dlang_newlist(vm);
|
||||||
|
for (size_t i = 0; i < parts.size(); ++i)
|
||||||
|
{
|
||||||
|
dlang_pushstring(vm, parts[i]);
|
||||||
|
dlang_pushindex(vm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void NativeFind(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto needle = dlang_tostring(vm);
|
||||||
|
auto str = dlang_tostring(vm);
|
||||||
|
|
||||||
|
size_t pos = str.find(needle);
|
||||||
|
|
||||||
|
dlang_pushnumber(vm, static_cast<double>(pos));
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void openlib_string(DlangVM* vm)
|
||||||
|
{
|
||||||
|
dlang_newtable(vm);
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeSubString);
|
||||||
|
dlang_setfield(vm, "substr");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeContains);
|
||||||
|
dlang_setfield(vm, "contains");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeReplace);
|
||||||
|
dlang_setfield(vm, "replace");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeLower);
|
||||||
|
dlang_setfield(vm, "lower");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeUpper);
|
||||||
|
dlang_setfield(vm, "upper");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeSplit);
|
||||||
|
dlang_setfield(vm, "split");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeFind);
|
||||||
|
dlang_setfield(vm, "find");
|
||||||
|
|
||||||
|
dlang_setglobal(vm, "string");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,166 @@
|
|||||||
|
#ifndef DLANG_LIBS_TABLE_HPP
|
||||||
|
#define DLANG_LIBS_TABLE_HPP
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
#include <thread>
|
||||||
|
#include "../vm.hpp"
|
||||||
|
#include "../helpers.hpp"
|
||||||
|
#include "../json.hpp"
|
||||||
|
|
||||||
|
void NativeTableInsert(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto newTable = dlang_totable(vm);
|
||||||
|
auto insertTable = dlang_totable(vm);
|
||||||
|
|
||||||
|
for (const auto [key, val] : newTable->fields)
|
||||||
|
insertTable->fields[key] = val;
|
||||||
|
|
||||||
|
dlang_push(vm, StackValue(StackValueType::Table, insertTable));
|
||||||
|
}
|
||||||
|
|
||||||
|
void NativeTableRemove(DlangVM* vm)
|
||||||
|
{
|
||||||
|
auto key = dlang_tostring(vm);
|
||||||
|
auto table = dlang_totable(vm);
|
||||||
|
|
||||||
|
auto it = table->fields.find(key);
|
||||||
|
if (it != table->fields.end())
|
||||||
|
table->fields.erase(it);
|
||||||
|
|
||||||
|
dlang_push(vm, StackValue(StackValueType::Table, table));
|
||||||
|
}
|
||||||
|
|
||||||
|
nlohmann::json DlangValueToJson(const StackValue& val)
|
||||||
|
{
|
||||||
|
switch (val.type)
|
||||||
|
{
|
||||||
|
case StackValueType::Int: return std::get<double>(val.data);
|
||||||
|
case StackValueType::Bool: return std::get<bool>(val.data);
|
||||||
|
case StackValueType::String: return std::get<std::string>(val.data);
|
||||||
|
case StackValueType::NIL: return nullptr;
|
||||||
|
|
||||||
|
case StackValueType::Table:
|
||||||
|
{
|
||||||
|
auto tablePtr = std::get<std::shared_ptr<DlangTable>>(val.data);
|
||||||
|
nlohmann::json jObj = nlohmann::json::object();
|
||||||
|
|
||||||
|
for (const auto& [key, fieldVal] : tablePtr->fields)
|
||||||
|
jObj[key] = DlangValueToJson(fieldVal);
|
||||||
|
|
||||||
|
return jObj;
|
||||||
|
}
|
||||||
|
|
||||||
|
case StackValueType::List:
|
||||||
|
{
|
||||||
|
auto listPtr = std::get<std::shared_ptr<DlangList>>(val.data);
|
||||||
|
nlohmann::json jArr = nlohmann::json::array();
|
||||||
|
|
||||||
|
for (const auto& elemVal : listPtr->values)
|
||||||
|
jArr.push_back(DlangValueToJson(elemVal));
|
||||||
|
|
||||||
|
return jArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PushJsonToVM(DlangVM* vm, const nlohmann::json& j)
|
||||||
|
{
|
||||||
|
if (j.is_number())
|
||||||
|
{
|
||||||
|
dlang_pushnumber(vm, j.get<double>());
|
||||||
|
}
|
||||||
|
else if (j.is_boolean())
|
||||||
|
{
|
||||||
|
dlang_pushboolean(vm, j.get<bool>());
|
||||||
|
}
|
||||||
|
else if (j.is_string())
|
||||||
|
{
|
||||||
|
dlang_pushstring(vm, j.get<std::string>());
|
||||||
|
}
|
||||||
|
else if (j.is_array())
|
||||||
|
{
|
||||||
|
dlang_newlist(vm);
|
||||||
|
auto listPtr = dlang_tolist(vm);
|
||||||
|
|
||||||
|
for (const auto& element : j)
|
||||||
|
{
|
||||||
|
PushJsonToVM(vm, element);
|
||||||
|
listPtr->values.push_back(vm->stack.pop());
|
||||||
|
}
|
||||||
|
|
||||||
|
vm->stack.push(StackValue(StackValueType::List, listPtr));
|
||||||
|
}
|
||||||
|
else if (j.is_object())
|
||||||
|
{
|
||||||
|
dlang_newtable(vm);
|
||||||
|
auto tablePtr = dlang_totable(vm);
|
||||||
|
|
||||||
|
for (auto it = j.begin(); it != j.end(); ++it)
|
||||||
|
{
|
||||||
|
PushJsonToVM(vm, it.value());
|
||||||
|
tablePtr->fields[it.key()] = vm->stack.pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
vm->stack.push(StackValue(StackValueType::Table, tablePtr));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dlang_pushnil(vm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void NativeJsonEncode(DlangVM* vm)
|
||||||
|
{
|
||||||
|
int indent = 0;
|
||||||
|
if (dlang_isnumber(vm))
|
||||||
|
indent = dlang_tonumber(vm);
|
||||||
|
|
||||||
|
if (!dlang_istable(vm))
|
||||||
|
{
|
||||||
|
dlang_pushnil(vm);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
nlohmann::json j = DlangValueToJson(dlang_pop(vm));
|
||||||
|
|
||||||
|
dlang_pushstring(vm, j.dump(indent));
|
||||||
|
}
|
||||||
|
|
||||||
|
void NativeJsonDecode(DlangVM* vm)
|
||||||
|
{
|
||||||
|
std::string jsonStr = dlang_tostring(vm);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
nlohmann::json j = nlohmann::json::parse(jsonStr);
|
||||||
|
PushJsonToVM(vm, j);
|
||||||
|
}
|
||||||
|
catch (const nlohmann::json::parse_error& e)
|
||||||
|
{
|
||||||
|
throw std::runtime_error("JSON Parse Error: " + std::string(e.what()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void openlib_table(DlangVM* vm)
|
||||||
|
{
|
||||||
|
dlang_newtable(vm);
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeTableInsert);
|
||||||
|
dlang_setfield(vm, "insert");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeTableRemove);
|
||||||
|
dlang_setfield(vm, "remove");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeJsonEncode);
|
||||||
|
dlang_setfield(vm, "json_encode");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeJsonDecode);
|
||||||
|
dlang_setfield(vm, "json_decode");
|
||||||
|
|
||||||
|
dlang_setglobal(vm, "table");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
#ifndef DLANG_PARSER_HPP
|
||||||
|
#define DLANG_PARSER_HPP
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "types/include.hpp"
|
||||||
|
#include "program.hpp"
|
||||||
|
|
||||||
|
#include "parser/expressions.hpp"
|
||||||
|
#include "parser/statements.hpp"
|
||||||
|
|
||||||
|
#include "language.hpp"
|
||||||
|
|
||||||
|
class Parser
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
std::vector<Token> _tokens;
|
||||||
|
size_t _pos = 0;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Token& Current();
|
||||||
|
Token& Consume();
|
||||||
|
Token& Peek(size_t offset = 1);
|
||||||
|
bool Match(TokenType type, const std::string& value);
|
||||||
|
Token& ShouldBe(TokenType type, const std::string& value = "");
|
||||||
|
bool Match(TokenType type, char value);
|
||||||
|
Token& ShouldBe(TokenType type, char value);
|
||||||
|
|
||||||
|
public:
|
||||||
|
Parser(const std::vector<Token>& tokens);
|
||||||
|
Program ParseProgram();
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::unique_ptr<Statement> ParseStatement();
|
||||||
|
std::unique_ptr<Statement> ParseVariableDeclaration();
|
||||||
|
std::unique_ptr<Statement> ParseAssignment();
|
||||||
|
std::unique_ptr<Statement> ParseWhileDeclaration();
|
||||||
|
std::unique_ptr<Statement> ParseForDeclaration();
|
||||||
|
std::unique_ptr<Statement> ParseForeachDeclaration();
|
||||||
|
std::unique_ptr<Statement> ParseIfDeclaration();
|
||||||
|
std::unique_ptr<Statement> ParseFunctionDeclaration();
|
||||||
|
std::unique_ptr<Statement> ParseReturnStatement();
|
||||||
|
std::unique_ptr<Statement> ParseIncludeStatement();
|
||||||
|
|
||||||
|
std::unique_ptr<Expression> ParseFunctionCall(std::unique_ptr<Expression> callee);
|
||||||
|
std::unique_ptr<Expression> ParseExpression();
|
||||||
|
std::unique_ptr<Expression> ParsePrimary();
|
||||||
|
std::unique_ptr<Expression> ParseMultiplicative();
|
||||||
|
std::unique_ptr<Expression> ParseAdditive();
|
||||||
|
std::unique_ptr<Expression> ParseComparison();
|
||||||
|
std::unique_ptr<Expression> ParseTableLiteral();
|
||||||
|
std::unique_ptr<Expression> ParseListLiteral();
|
||||||
|
std::unique_ptr<Expression> ParseLogicalAndOr();
|
||||||
|
std::unique_ptr<Expression> ParseFunctionExpression();
|
||||||
|
std::unique_ptr<Expression> ParseSizeExpression();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
#ifndef DLANG_EXPRESSIONS_HPP
|
||||||
|
#define DLANG_EXPRESSIONS_HPP
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "../types/include.hpp"
|
||||||
|
|
||||||
|
struct Expression {
|
||||||
|
virtual ~Expression() = default;
|
||||||
|
virtual void Print(int indent = 0) const = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct NumberExpression : Expression {
|
||||||
|
double value;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ')
|
||||||
|
<< "Number: " << value << '\n';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct BooleanExpression : Expression {
|
||||||
|
bool value;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ')
|
||||||
|
<< "Boolean: " << (value ? "true" : "false") << '\n';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct StringExpression : Expression {
|
||||||
|
std::string value;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ')
|
||||||
|
<< "string: " << value << '\n';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct IdentifierExpression : Expression {
|
||||||
|
std::string name;
|
||||||
|
std::string keyName;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ')
|
||||||
|
<< "Identifier: " << name << '\n';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct BinaryExpression : Expression {
|
||||||
|
std::unique_ptr<Expression> left;
|
||||||
|
std::string op;
|
||||||
|
std::unique_ptr<Expression> right;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ')
|
||||||
|
<< "Binary: " << op << '\n';
|
||||||
|
|
||||||
|
left->Print(indent + 2);
|
||||||
|
right->Print(indent + 2);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CallExpression : Expression
|
||||||
|
{
|
||||||
|
std::unique_ptr<Expression> callee;
|
||||||
|
std::vector< std::unique_ptr<Expression>> expressions;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ') << " Call" << "\n";
|
||||||
|
callee->Print(indent + 2);
|
||||||
|
for (const auto& expr : expressions)
|
||||||
|
expr->Print(indent + 2);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct TableLiteralExpression : Expression
|
||||||
|
{
|
||||||
|
std::vector<std::pair<std::string, std::unique_ptr<Expression>>> fields;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ')
|
||||||
|
<< "TableLiteral {\n";
|
||||||
|
|
||||||
|
for (const auto& [key, expr] : fields)
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent + 2, ' ')
|
||||||
|
<< key << ":\n";
|
||||||
|
if (expr)
|
||||||
|
{
|
||||||
|
expr->Print(indent + 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cout << std::string(indent, ' ')
|
||||||
|
<< "}\n";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ListLiteralExpression : Expression
|
||||||
|
{
|
||||||
|
std::vector<std::unique_ptr<Expression>> fields;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ')
|
||||||
|
<< "TableLiteral {\n";
|
||||||
|
|
||||||
|
for (const auto& val : fields)
|
||||||
|
val->Print(indent + 2);
|
||||||
|
|
||||||
|
std::cout << std::string(indent, ' ')
|
||||||
|
<< "}\n";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct MemberAccessExpression : Expression
|
||||||
|
{
|
||||||
|
std::unique_ptr<Expression> object;
|
||||||
|
std::string memberName;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ')
|
||||||
|
<< "MemberAccess: ." << memberName << '\n';
|
||||||
|
|
||||||
|
if (object)
|
||||||
|
{
|
||||||
|
object->Print(indent + 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct IndexAccessExpression : Expression
|
||||||
|
{
|
||||||
|
std::unique_ptr<Expression> object;
|
||||||
|
std::unique_ptr<Expression> memberIndex;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ')
|
||||||
|
<< "IndexAccess: ." << '\n';
|
||||||
|
|
||||||
|
memberIndex->Print(indent);
|
||||||
|
|
||||||
|
if (object)
|
||||||
|
{
|
||||||
|
object->Print(indent + 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SizeExpression : Expression
|
||||||
|
{
|
||||||
|
std::string identifier;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ')
|
||||||
|
<< "Identifier: " << identifier << '\n';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,209 @@
|
|||||||
|
#ifndef DLANG_STATEMENTS_HPP
|
||||||
|
#define DLANG_STATEMENTS_HPP
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "expressions.hpp"
|
||||||
|
|
||||||
|
struct Statement
|
||||||
|
{
|
||||||
|
virtual ~Statement() = default;
|
||||||
|
virtual void Print(int indent = 0) const = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct VariableDeclaration : Statement
|
||||||
|
{
|
||||||
|
std::string name;
|
||||||
|
std::unique_ptr<Expression> initializer;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ')
|
||||||
|
<< "VariableDeclaration: " << name << '\n';
|
||||||
|
|
||||||
|
initializer->Print(indent + 2);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Assignment : Statement
|
||||||
|
{
|
||||||
|
std::unique_ptr<Expression> lhs;
|
||||||
|
std::unique_ptr<Expression> value;
|
||||||
|
std::string assignmentOperator;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ')
|
||||||
|
<< "Assignment" << '\n';
|
||||||
|
lhs->Print(indent + 2);
|
||||||
|
value->Print(indent + 2);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ExpressionStatement : Statement {
|
||||||
|
std::unique_ptr<Expression> expression;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override {
|
||||||
|
expression->Print(indent);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct WhileStatement : Statement
|
||||||
|
{
|
||||||
|
std::unique_ptr<Expression> condition;
|
||||||
|
std::vector<std::unique_ptr<Statement>> body;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ') << "WhileStatement\n";
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "Condition:\n";
|
||||||
|
condition->Print(indent + 4);
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "Body:\n";
|
||||||
|
for (const auto& stmt : body)
|
||||||
|
{
|
||||||
|
stmt->Print(indent + 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ForStatement : Statement
|
||||||
|
{
|
||||||
|
std::string var;
|
||||||
|
double from;
|
||||||
|
double to;
|
||||||
|
double step = 1;
|
||||||
|
std::vector<std::unique_ptr<Statement>> body;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ') << "ForStatement\n";
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "var: " << var << "\n";
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "from: " << from << "\n";
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "to: " << to << "\n";
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "step: " << step << "\n";
|
||||||
|
for (const auto& stmt : body)
|
||||||
|
{
|
||||||
|
stmt->Print(indent + 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ForeachStatement : Statement
|
||||||
|
{
|
||||||
|
std::string var;
|
||||||
|
std::string list;
|
||||||
|
std::vector<std::unique_ptr<Statement>> body;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ') << "ForeachStatement\n";
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "var: " << var << "\n";
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "list: " << list << "\n";
|
||||||
|
for (const auto& stmt : body)
|
||||||
|
{
|
||||||
|
stmt->Print(indent + 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ForeachTableStatement : Statement
|
||||||
|
{
|
||||||
|
std::string varKey;
|
||||||
|
std::string varValue;
|
||||||
|
std::string table;
|
||||||
|
std::vector<std::unique_ptr<Statement>> body;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ') << "ForeachTableStatement\n";
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "var key: " << varKey << "\n";
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "var value: " << varValue << "\n";
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "table: " << table << "\n";
|
||||||
|
for (const auto& stmt : body)
|
||||||
|
{
|
||||||
|
stmt->Print(indent + 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct IfStatement : Statement
|
||||||
|
{
|
||||||
|
std::unique_ptr<Expression> expression;
|
||||||
|
std::vector<std::unique_ptr<Statement>> body;
|
||||||
|
std::vector<std::unique_ptr<Statement>> elseBody;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ') << "IfStatement\n";
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "expression:\n";
|
||||||
|
expression->Print(indent + 4);
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "Body:\n";
|
||||||
|
for (const auto& stmt : body)
|
||||||
|
stmt->Print(indent + 4);
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "Else Body:\n";
|
||||||
|
for (const auto& stmt : elseBody)
|
||||||
|
stmt->Print(indent + 4);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct FunctionStatement : Statement
|
||||||
|
{
|
||||||
|
std::string name;
|
||||||
|
std::vector<std::string> parameters;
|
||||||
|
std::vector<std::unique_ptr<Statement>> body;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ') << "FunctionStatement\n";
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "name: " << name << "\n";
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "Paramters:\n";
|
||||||
|
for (const auto& param : parameters)
|
||||||
|
std::cout << std::string(indent + 4, ' ') << param << "\n";
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "Body:\n";
|
||||||
|
for (const auto& stmt : body)
|
||||||
|
stmt->Print(indent + 4);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct FunctionExpression : Expression
|
||||||
|
{
|
||||||
|
std::vector<std::string> parameters;
|
||||||
|
std::vector<std::unique_ptr<Statement>> body;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ') << "FunctionExpression\n";
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "Paramters:\n";
|
||||||
|
for (const auto& param : parameters)
|
||||||
|
std::cout << std::string(indent + 4, ' ') << param << "\n";
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "Body:\n";
|
||||||
|
for (const auto& stmt : body)
|
||||||
|
stmt->Print(indent + 4);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ReturnStatement : Statement
|
||||||
|
{
|
||||||
|
std::unique_ptr<Expression> expression;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ') << "ReturnStatement\n";
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "Expression:\n";
|
||||||
|
if(expression) expression->Print(indent + 4);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct IncludeStatement : Statement
|
||||||
|
{
|
||||||
|
std::string path;
|
||||||
|
|
||||||
|
void Print(int indent = 0) const override
|
||||||
|
{
|
||||||
|
std::cout << std::string(indent, ' ') << "IncludeStatement\n";
|
||||||
|
std::cout << std::string(indent + 2, ' ') << "Path: " << path << "\n";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
#ifndef MODULES_HPP
|
||||||
|
#define MODULES_HPP
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
|
#define PLATFORM_WINDOWS
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#include <windows.h>
|
||||||
|
#elif defined(__linux__)
|
||||||
|
#define PLATFORM_LINUX
|
||||||
|
#include <dlfcn.h>
|
||||||
|
#else
|
||||||
|
#error "Unsupported platform (Windows and Linux only)."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class ModuleManager {
|
||||||
|
public:
|
||||||
|
ModuleManager() = default;
|
||||||
|
|
||||||
|
~ModuleManager() {
|
||||||
|
UnloadAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
ModuleManager(const ModuleManager&) = delete;
|
||||||
|
ModuleManager& operator=(const ModuleManager&) = delete;
|
||||||
|
|
||||||
|
void* GetOrLoadInitFunc(const std::string& path, const std::string& initFuncName = "initialize") {
|
||||||
|
auto it = initFunctions.find(path);
|
||||||
|
if (it != initFunctions.end()) {
|
||||||
|
return it->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* funcPtr = nullptr;
|
||||||
|
|
||||||
|
#if defined(PLATFORM_WINDOWS)
|
||||||
|
HMODULE handle = LoadLibraryA((path + ".dll").c_str());
|
||||||
|
if (!handle) {
|
||||||
|
std::cerr << "[ModuleManager] Failed to load DLL (" << path << "): Code " << GetLastError() << std::endl;
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
funcPtr = reinterpret_cast<void*>(GetProcAddress(handle, initFuncName.c_str()));
|
||||||
|
if (!funcPtr) {
|
||||||
|
std::cerr << "[ModuleManager] Function '" << initFuncName << "' not found in: " << path << std::endl;
|
||||||
|
FreeLibrary(handle);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
#elif defined(PLATFORM_LINUX)
|
||||||
|
void* handle = dlopen((path + ".so").c_str(), RTLD_NOW);
|
||||||
|
if (!handle) {
|
||||||
|
std::cerr << "[ModuleManager] Failed to load SO (" << path << "): " << dlerror() << std::endl;
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
dlerror();
|
||||||
|
|
||||||
|
funcPtr = dlsym(handle, initFuncName.c_str());
|
||||||
|
const char* dlsym_error = dlerror();
|
||||||
|
if (dlsym_error) {
|
||||||
|
std::cerr << "[ModuleManager] Function '" << initFuncName << "' not found: " << dlsym_error << std::endl;
|
||||||
|
dlclose(handle);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
modules[path] = handle;
|
||||||
|
initFunctions[path] = funcPtr;
|
||||||
|
|
||||||
|
std::cout << "[ModuleManager] Module loaded: " << path << std::endl;
|
||||||
|
return funcPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool UnloadModule(const std::string& path) {
|
||||||
|
auto it = modules.find(path);
|
||||||
|
if (it == modules.end()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(PLATFORM_WINDOWS)
|
||||||
|
FreeLibrary(static_cast<HMODULE>(it->second));
|
||||||
|
#elif defined(PLATFORM_LINUX)
|
||||||
|
dlclose(it->second);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
modules.erase(it);
|
||||||
|
initFunctions.erase(path);
|
||||||
|
std::cout << "[ModuleManager] Module unloaded: " << path << std::endl;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UnloadAll() {
|
||||||
|
for (auto& [path, handle] : modules) {
|
||||||
|
#if defined(PLATFORM_WINDOWS)
|
||||||
|
FreeLibrary(static_cast<HMODULE>(handle));
|
||||||
|
#elif defined(PLATFORM_LINUX)
|
||||||
|
dlclose(handle);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
modules.clear();
|
||||||
|
initFunctions.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
#if defined(PLATFORM_WINDOWS)
|
||||||
|
std::unordered_map<std::string, HMODULE> modules;
|
||||||
|
#elif defined(PLATFORM_LINUX)
|
||||||
|
std::unordered_map<std::string, void*> modules;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
std::unordered_map<std::string, void*> initFunctions;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#ifndef DLANG_PROGRAM_HPP
|
||||||
|
#define DLANG_PROGRAM_HPP
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
#include "parser/statements.hpp"
|
||||||
|
|
||||||
|
struct Program
|
||||||
|
{
|
||||||
|
std::vector<std::unique_ptr<Statement>> statements;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,848 @@
|
|||||||
|
#include "../compiler.hpp"
|
||||||
|
#include <sstream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <filesystem>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
#include "../lexer.hpp"
|
||||||
|
#include "../parser.hpp"
|
||||||
|
|
||||||
|
void Compiler::Emit(Opcodes op)
|
||||||
|
{
|
||||||
|
_bytecode.push_back(static_cast<double>(op));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Compiler::Emit(const std::string& str)
|
||||||
|
{
|
||||||
|
auto it = std::find(_stringTable.begin(), _stringTable.end(), str);
|
||||||
|
if (it != _stringTable.end())
|
||||||
|
{
|
||||||
|
auto index = std::distance(_stringTable.begin(), it);
|
||||||
|
Emit(index);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_stringTable.push_back(str);
|
||||||
|
Emit(_stringTable.size() - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Compiler::Emit(double value)
|
||||||
|
{
|
||||||
|
_bytecode.push_back(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Compiler::Compile(Statement* stmt)
|
||||||
|
{
|
||||||
|
if (auto* varDecl = dynamic_cast<VariableDeclaration*>(stmt))
|
||||||
|
{
|
||||||
|
Compile(varDecl->initializer.get());
|
||||||
|
Emit(Opcodes::DEFINE_VAR);
|
||||||
|
Emit(varDecl->name);
|
||||||
|
}
|
||||||
|
else if (auto* assign = dynamic_cast<Assignment*>(stmt))
|
||||||
|
{
|
||||||
|
if (auto* memberAccess = dynamic_cast<MemberAccessExpression*>(assign->lhs.get()))
|
||||||
|
{
|
||||||
|
Compile(memberAccess->object.get());
|
||||||
|
Compile(assign->value.get());
|
||||||
|
|
||||||
|
Emit(Opcodes::SET_FIELD);
|
||||||
|
Emit(memberAccess->memberName);
|
||||||
|
Emit(Opcodes::POP);
|
||||||
|
}
|
||||||
|
else if (auto* indexMemberAccess = dynamic_cast<IndexAccessExpression*>(assign->lhs.get()))
|
||||||
|
{
|
||||||
|
Compile(indexMemberAccess->object.get());
|
||||||
|
Compile(indexMemberAccess->memberIndex.get());
|
||||||
|
Compile(assign->value.get());
|
||||||
|
|
||||||
|
Emit(Opcodes::SET_INDEX);
|
||||||
|
Emit(Opcodes::POP);
|
||||||
|
}
|
||||||
|
else if (auto* idExpr = dynamic_cast<IdentifierExpression*>(assign->lhs.get()))
|
||||||
|
{
|
||||||
|
if (assign->assignmentOperator == "+=" ||
|
||||||
|
assign->assignmentOperator == "-=" ||
|
||||||
|
assign->assignmentOperator == "*=" ||
|
||||||
|
assign->assignmentOperator == "/=")
|
||||||
|
{
|
||||||
|
Emit(Opcodes::PUSH_VAR);
|
||||||
|
Emit(idExpr->name);
|
||||||
|
Compile(assign->value.get());
|
||||||
|
|
||||||
|
if (assign->assignmentOperator == "+=")
|
||||||
|
Emit(Opcodes::ADD);
|
||||||
|
|
||||||
|
if (assign->assignmentOperator == "-=")
|
||||||
|
Emit(Opcodes::SUB);
|
||||||
|
|
||||||
|
if (assign->assignmentOperator == "*=")
|
||||||
|
Emit(Opcodes::MUL);
|
||||||
|
|
||||||
|
if (assign->assignmentOperator == "/=")
|
||||||
|
Emit(Opcodes::DIV);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Compile(assign->value.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
Emit(Opcodes::STORE_VAR);
|
||||||
|
Emit(idExpr->name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (auto* exprStmt = dynamic_cast<ExpressionStatement*>(stmt))
|
||||||
|
{
|
||||||
|
Compile(exprStmt->expression.get());
|
||||||
|
Emit(Opcodes::POP);
|
||||||
|
}
|
||||||
|
else if (auto* whileStmt = dynamic_cast<WhileStatement*>(stmt))
|
||||||
|
{
|
||||||
|
auto loopStart = _bytecode.size();
|
||||||
|
Compile(whileStmt->condition.get());
|
||||||
|
|
||||||
|
auto jzAddress = _bytecode.size();
|
||||||
|
Emit(Opcodes::JZ);
|
||||||
|
Emit(0); // Dummy, will be backpatched
|
||||||
|
|
||||||
|
for (const auto& bodyStmt : whileStmt->body)
|
||||||
|
Compile(bodyStmt.get());
|
||||||
|
|
||||||
|
Emit(Opcodes::JUMP);
|
||||||
|
Emit(loopStart);
|
||||||
|
|
||||||
|
_bytecode[jzAddress + 1] = static_cast<double>(_bytecode.size());
|
||||||
|
}
|
||||||
|
else if (auto* forStmt = dynamic_cast<ForStatement*>(stmt))
|
||||||
|
{
|
||||||
|
Emit(Opcodes::PUSH_INT);
|
||||||
|
Emit(forStmt->from);
|
||||||
|
|
||||||
|
Emit(Opcodes::STORE_VAR);
|
||||||
|
Emit(forStmt->var);
|
||||||
|
|
||||||
|
auto loopStart = _bytecode.size();
|
||||||
|
|
||||||
|
Emit(Opcodes::PUSH_VAR);
|
||||||
|
Emit(forStmt->var);
|
||||||
|
|
||||||
|
Emit(Opcodes::PUSH_INT);
|
||||||
|
Emit(forStmt->to);
|
||||||
|
|
||||||
|
Emit(Opcodes::LESS_THAN);
|
||||||
|
|
||||||
|
auto jzAddress = _bytecode.size();
|
||||||
|
Emit(Opcodes::JZ);
|
||||||
|
Emit(0); // Dummy, will be backpatched
|
||||||
|
|
||||||
|
for (const auto& bodyStmt : forStmt->body)
|
||||||
|
Compile(bodyStmt.get());
|
||||||
|
|
||||||
|
Emit(Opcodes::PUSH_VAR);
|
||||||
|
Emit(forStmt->var);
|
||||||
|
|
||||||
|
Emit(Opcodes::PUSH_INT);
|
||||||
|
Emit(forStmt->step);
|
||||||
|
|
||||||
|
Emit(Opcodes::ADD);
|
||||||
|
|
||||||
|
Emit(Opcodes::STORE_VAR);
|
||||||
|
Emit(forStmt->var);
|
||||||
|
|
||||||
|
Emit(Opcodes::JUMP);
|
||||||
|
Emit(loopStart);
|
||||||
|
|
||||||
|
_bytecode[jzAddress + 1] = static_cast<double>(_bytecode.size());
|
||||||
|
}
|
||||||
|
else if (auto* foreachStmt = dynamic_cast<ForeachStatement*>(stmt))
|
||||||
|
{
|
||||||
|
std::string idxVar = "__foreach_idx_" + foreachStmt->var;
|
||||||
|
|
||||||
|
Emit(Opcodes::PUSH_INT);
|
||||||
|
Emit(0);
|
||||||
|
|
||||||
|
Emit(Opcodes::STORE_VAR);
|
||||||
|
Emit(idxVar);
|
||||||
|
|
||||||
|
auto loopStart = _bytecode.size();
|
||||||
|
|
||||||
|
Emit(Opcodes::PUSH_VAR);
|
||||||
|
Emit(idxVar);
|
||||||
|
|
||||||
|
Emit(Opcodes::PUSH_VAR);
|
||||||
|
Emit(foreachStmt->list);
|
||||||
|
Emit(Opcodes::SIZE);
|
||||||
|
|
||||||
|
Emit(Opcodes::LESS_THAN);
|
||||||
|
|
||||||
|
auto jzAddress = _bytecode.size();
|
||||||
|
Emit(Opcodes::JZ);
|
||||||
|
Emit(0); // Backpatching this adress
|
||||||
|
|
||||||
|
Emit(Opcodes::PUSH_VAR);
|
||||||
|
Emit(foreachStmt->list);
|
||||||
|
Emit(Opcodes::PUSH_VAR);
|
||||||
|
Emit(idxVar);
|
||||||
|
Emit(Opcodes::GET_INDEX);
|
||||||
|
Emit(Opcodes::STORE_VAR);
|
||||||
|
Emit(foreachStmt->var);
|
||||||
|
|
||||||
|
for (const auto& bodyStmt : foreachStmt->body)
|
||||||
|
Compile(bodyStmt.get());
|
||||||
|
|
||||||
|
Emit(Opcodes::PUSH_VAR);
|
||||||
|
Emit(idxVar);
|
||||||
|
Emit(Opcodes::PUSH_INT);
|
||||||
|
Emit(1);
|
||||||
|
Emit(Opcodes::ADD);
|
||||||
|
Emit(Opcodes::STORE_VAR);
|
||||||
|
Emit(idxVar);
|
||||||
|
|
||||||
|
Emit(Opcodes::JUMP);
|
||||||
|
Emit(loopStart);
|
||||||
|
|
||||||
|
_bytecode[jzAddress + 1] = static_cast<double>(_bytecode.size());
|
||||||
|
}
|
||||||
|
else if (auto* foreachTableStmt = dynamic_cast<ForeachTableStatement*>(stmt))
|
||||||
|
{
|
||||||
|
std::string keysListVar = "__foreach_tbl_keys_" + foreachTableStmt->varKey + "_" + foreachTableStmt->varValue;
|
||||||
|
std::string idxVar = "__foreach_tbl_idx_" + foreachTableStmt->varKey + "_" + foreachTableStmt->varValue;
|
||||||
|
|
||||||
|
Emit(Opcodes::PUSH_VAR);
|
||||||
|
Emit(foreachTableStmt->table);
|
||||||
|
Emit(Opcodes::KEYS);
|
||||||
|
Emit(Opcodes::STORE_VAR);
|
||||||
|
Emit(keysListVar);
|
||||||
|
|
||||||
|
Emit(Opcodes::PUSH_INT);
|
||||||
|
Emit(0);
|
||||||
|
Emit(Opcodes::STORE_VAR);
|
||||||
|
Emit(idxVar);
|
||||||
|
|
||||||
|
auto loopStart = _bytecode.size();
|
||||||
|
|
||||||
|
Emit(Opcodes::PUSH_VAR);
|
||||||
|
Emit(idxVar);
|
||||||
|
|
||||||
|
Emit(Opcodes::PUSH_VAR);
|
||||||
|
Emit(keysListVar);
|
||||||
|
Emit(Opcodes::SIZE);
|
||||||
|
|
||||||
|
Emit(Opcodes::LESS_THAN);
|
||||||
|
|
||||||
|
auto jzAddress = _bytecode.size();
|
||||||
|
Emit(Opcodes::JZ);
|
||||||
|
Emit(0);
|
||||||
|
|
||||||
|
std::string currentKeyVar = "__foreach_curr_key_" + foreachTableStmt->varKey;
|
||||||
|
Emit(Opcodes::PUSH_VAR);
|
||||||
|
Emit(keysListVar);
|
||||||
|
Emit(Opcodes::PUSH_VAR);
|
||||||
|
Emit(idxVar);
|
||||||
|
Emit(Opcodes::GET_INDEX);
|
||||||
|
Emit(Opcodes::STORE_VAR);
|
||||||
|
Emit(currentKeyVar);
|
||||||
|
|
||||||
|
Emit(Opcodes::PUSH_VAR);
|
||||||
|
Emit(currentKeyVar);
|
||||||
|
Emit(Opcodes::STORE_VAR);
|
||||||
|
Emit(foreachTableStmt->varKey);
|
||||||
|
|
||||||
|
Emit(Opcodes::PUSH_VAR);
|
||||||
|
Emit(foreachTableStmt->table);
|
||||||
|
Emit(Opcodes::PUSH_VAR);
|
||||||
|
Emit(currentKeyVar);
|
||||||
|
Emit(Opcodes::GET_INDEX);
|
||||||
|
Emit(Opcodes::STORE_VAR);
|
||||||
|
Emit(foreachTableStmt->varValue);
|
||||||
|
|
||||||
|
for (const auto& bodyStmt : foreachTableStmt->body)
|
||||||
|
Compile(bodyStmt.get());
|
||||||
|
|
||||||
|
Emit(Opcodes::PUSH_VAR);
|
||||||
|
Emit(idxVar);
|
||||||
|
Emit(Opcodes::PUSH_INT);
|
||||||
|
Emit(1);
|
||||||
|
Emit(Opcodes::ADD);
|
||||||
|
Emit(Opcodes::STORE_VAR);
|
||||||
|
Emit(idxVar);
|
||||||
|
|
||||||
|
Emit(Opcodes::JUMP);
|
||||||
|
Emit(loopStart);
|
||||||
|
|
||||||
|
_bytecode[jzAddress + 1] = static_cast<double>(_bytecode.size());
|
||||||
|
}
|
||||||
|
else if (auto* ifStmt = dynamic_cast<IfStatement*>(stmt))
|
||||||
|
{
|
||||||
|
Compile(ifStmt->expression.get());
|
||||||
|
|
||||||
|
auto jzAddress = _bytecode.size();
|
||||||
|
Emit(Opcodes::JZ);
|
||||||
|
Emit(0); // Dummy, will be backpatched
|
||||||
|
|
||||||
|
for (const auto& bodyStmt : ifStmt->body)
|
||||||
|
Compile(bodyStmt.get());
|
||||||
|
|
||||||
|
if (!ifStmt->elseBody.empty())
|
||||||
|
{
|
||||||
|
auto jumpAddress = _bytecode.size();
|
||||||
|
Emit(Opcodes::JUMP);
|
||||||
|
Emit(0); // Dummy, will be backpatched
|
||||||
|
|
||||||
|
_bytecode[jzAddress + 1] = static_cast<double>(_bytecode.size());
|
||||||
|
|
||||||
|
for (const auto& bodyStmt : ifStmt->elseBody)
|
||||||
|
Compile(bodyStmt.get());
|
||||||
|
|
||||||
|
_bytecode[jumpAddress + 1] = static_cast<double>(_bytecode.size());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
_bytecode[jzAddress + 1] = static_cast<double>(_bytecode.size());
|
||||||
|
}
|
||||||
|
else if (auto* funcStmt = dynamic_cast<FunctionStatement*>(stmt))
|
||||||
|
{
|
||||||
|
Emit(Opcodes::FUNC_DEF);
|
||||||
|
Emit(funcStmt->name);
|
||||||
|
|
||||||
|
Emit(static_cast<double>(funcStmt->parameters.size()));
|
||||||
|
for (const auto& param : funcStmt->parameters)
|
||||||
|
Emit(param);
|
||||||
|
|
||||||
|
auto bodyStartPlaceholder = _bytecode.size();
|
||||||
|
Emit(0); // Dummy body start
|
||||||
|
|
||||||
|
auto bodyEndPlaceholder = _bytecode.size();
|
||||||
|
Emit(0); // Dummy body end
|
||||||
|
|
||||||
|
auto skipJumpAddress = _bytecode.size();
|
||||||
|
Emit(Opcodes::JUMP);
|
||||||
|
Emit(0); // Dummy skip target
|
||||||
|
|
||||||
|
auto realBodyStart = static_cast<double>(_bytecode.size());
|
||||||
|
_bytecode[bodyStartPlaceholder] = realBodyStart;
|
||||||
|
|
||||||
|
for (const auto& bodyStmt : funcStmt->body)
|
||||||
|
Compile(bodyStmt.get());
|
||||||
|
|
||||||
|
Emit(Opcodes::RET);
|
||||||
|
|
||||||
|
auto realBodyEnd = static_cast<double>(_bytecode.size());
|
||||||
|
_bytecode[bodyEndPlaceholder] = realBodyEnd;
|
||||||
|
_bytecode[skipJumpAddress + 1] = realBodyEnd;
|
||||||
|
}
|
||||||
|
else if (auto* retStmt = dynamic_cast<ReturnStatement*>(stmt))
|
||||||
|
{
|
||||||
|
if (retStmt->expression)
|
||||||
|
Compile(retStmt->expression.get());
|
||||||
|
|
||||||
|
Emit(Opcodes::RET);
|
||||||
|
}
|
||||||
|
else if (auto* incStmt = dynamic_cast<IncludeStatement*>(stmt))
|
||||||
|
{
|
||||||
|
auto path = incStmt->path;
|
||||||
|
|
||||||
|
if (std::find(_includes.begin(), _includes.end(), path) != _includes.end())
|
||||||
|
return;
|
||||||
|
|
||||||
|
_includes.push_back(path);
|
||||||
|
|
||||||
|
if (!std::filesystem::exists(path))
|
||||||
|
throw std::runtime_error("File '" + path + "' does not exist!");
|
||||||
|
|
||||||
|
std::ifstream file(path, std::ios::in | std::ios::binary | std::ios::ate);
|
||||||
|
if (!file.is_open())
|
||||||
|
throw std::runtime_error("Failed to open file '" + path + "'!");
|
||||||
|
|
||||||
|
std::streamsize size = file.tellg();
|
||||||
|
file.seekg(0, std::ios::beg);
|
||||||
|
|
||||||
|
std::string sourceCode;
|
||||||
|
sourceCode.resize(size);
|
||||||
|
|
||||||
|
if (!file.read(&sourceCode[0], size))
|
||||||
|
throw std::runtime_error("Failed to read file '" + path + "', possibly corrupt?");
|
||||||
|
|
||||||
|
Lexer lexer;
|
||||||
|
lexer.Parse(sourceCode);
|
||||||
|
lexer.ParseOrganizedTokens();
|
||||||
|
auto tokens = lexer.GetOrganizedTokens();
|
||||||
|
|
||||||
|
Parser parser(tokens);
|
||||||
|
auto includedProgram = parser.ParseProgram();
|
||||||
|
|
||||||
|
for (const auto& stmt : includedProgram.statements)
|
||||||
|
Compile(stmt.get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Compiler::Compile(Expression* expr)
|
||||||
|
{
|
||||||
|
if (auto* num = dynamic_cast<NumberExpression*>(expr))
|
||||||
|
{
|
||||||
|
Emit(Opcodes::PUSH_INT);
|
||||||
|
Emit(num->value);
|
||||||
|
}
|
||||||
|
else if (auto* id = dynamic_cast<IdentifierExpression*>(expr))
|
||||||
|
{
|
||||||
|
Emit(Opcodes::PUSH_VAR);
|
||||||
|
Emit(id->name);
|
||||||
|
}
|
||||||
|
else if (auto* bin = dynamic_cast<BinaryExpression*>(expr))
|
||||||
|
{
|
||||||
|
Compile(bin->left.get());
|
||||||
|
Compile(bin->right.get());
|
||||||
|
|
||||||
|
char op = bin->op.at(0);
|
||||||
|
switch (op)
|
||||||
|
{
|
||||||
|
case '+': Emit(Opcodes::ADD); return; break;
|
||||||
|
case '-': Emit(Opcodes::SUB); return; break;
|
||||||
|
case '*': Emit(Opcodes::MUL); return; break;
|
||||||
|
case '/': Emit(Opcodes::DIV); return; break;
|
||||||
|
case '>': Emit(Opcodes::GREATER_THAN); return; break;
|
||||||
|
case '<': Emit(Opcodes::LESS_THAN); return; break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bin->op == "==")
|
||||||
|
Emit(Opcodes::CMP);
|
||||||
|
else if (bin->op == ">=")
|
||||||
|
Emit(Opcodes::GTE);
|
||||||
|
else if (bin->op == "<=")
|
||||||
|
Emit(Opcodes::LTE);
|
||||||
|
else if (bin->op == "&&")
|
||||||
|
Emit(Opcodes::AND);
|
||||||
|
else if (bin->op == "||")
|
||||||
|
Emit(Opcodes::OR);
|
||||||
|
else if (bin->op == "!=")
|
||||||
|
Emit(Opcodes::NTE);
|
||||||
|
}
|
||||||
|
else if (auto* boolean = dynamic_cast<BooleanExpression*>(expr))
|
||||||
|
{
|
||||||
|
Emit(Opcodes::PUSH_BOOL);
|
||||||
|
Emit(boolean->value == true ? 1 : 0);
|
||||||
|
}
|
||||||
|
else if (auto* string = dynamic_cast<StringExpression*>(expr))
|
||||||
|
{
|
||||||
|
Emit(Opcodes::PUSH_STRING);
|
||||||
|
Emit(string->value);
|
||||||
|
}
|
||||||
|
else if (auto* call = dynamic_cast<CallExpression*>(expr))
|
||||||
|
{
|
||||||
|
for (const auto& arg : call->expressions)
|
||||||
|
{
|
||||||
|
Compile(arg.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (call->callee)
|
||||||
|
Compile(call->callee.get());
|
||||||
|
|
||||||
|
Emit(Opcodes::CALL);
|
||||||
|
Emit(static_cast<double>(call->expressions.size()));
|
||||||
|
}
|
||||||
|
else if (auto* table = dynamic_cast<TableLiteralExpression*>(expr))
|
||||||
|
{
|
||||||
|
Emit(Opcodes::NEW_TABLE);
|
||||||
|
|
||||||
|
for (const auto& [key, valExpr] : table->fields)
|
||||||
|
{
|
||||||
|
if (valExpr)
|
||||||
|
Compile(valExpr.get());
|
||||||
|
|
||||||
|
Emit(Opcodes::SET_FIELD);
|
||||||
|
Emit(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (auto* list = dynamic_cast<ListLiteralExpression*>(expr))
|
||||||
|
{
|
||||||
|
Emit(Opcodes::NEW_LIST);
|
||||||
|
|
||||||
|
for (const auto& valExpr : list->fields)
|
||||||
|
{
|
||||||
|
if (valExpr)
|
||||||
|
Compile(valExpr.get());
|
||||||
|
|
||||||
|
Emit(Opcodes::PUSH_LIST);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (auto* tableMember = dynamic_cast<MemberAccessExpression*>(expr))
|
||||||
|
{
|
||||||
|
if(tableMember->object) Compile(tableMember->object.get());
|
||||||
|
Emit(Opcodes::GET_FIELD);
|
||||||
|
Emit(tableMember->memberName);
|
||||||
|
}
|
||||||
|
else if (auto* listMember = dynamic_cast<IndexAccessExpression*>(expr))
|
||||||
|
{
|
||||||
|
if(listMember->object) Compile(listMember->object.get());
|
||||||
|
Compile(listMember->memberIndex.get());
|
||||||
|
Emit(Opcodes::GET_INDEX);
|
||||||
|
}
|
||||||
|
else if (auto* funcExpr = dynamic_cast<FunctionExpression*>(expr))
|
||||||
|
{
|
||||||
|
Emit(Opcodes::FUNC_DEF);
|
||||||
|
Emit(""); // Name
|
||||||
|
|
||||||
|
Emit(static_cast<double>(funcExpr->parameters.size()));
|
||||||
|
for (const auto& param : funcExpr->parameters)
|
||||||
|
Emit(param);
|
||||||
|
|
||||||
|
auto bodyStartPlaceholder = _bytecode.size();
|
||||||
|
Emit(0); // Dummy body start
|
||||||
|
|
||||||
|
auto bodyEndPlaceholder = _bytecode.size();
|
||||||
|
Emit(0); // Dummy body end
|
||||||
|
|
||||||
|
auto skipJumpAddress = _bytecode.size();
|
||||||
|
Emit(Opcodes::JUMP);
|
||||||
|
Emit(0); // Dummy jump target
|
||||||
|
|
||||||
|
auto realBodyStart = static_cast<double>(_bytecode.size());
|
||||||
|
_bytecode[bodyStartPlaceholder] = realBodyStart;
|
||||||
|
|
||||||
|
for (const auto& bodyStmt : funcExpr->body)
|
||||||
|
Compile(bodyStmt.get());
|
||||||
|
|
||||||
|
Emit(Opcodes::RET);
|
||||||
|
|
||||||
|
auto realBodyEnd = static_cast<double>(_bytecode.size());
|
||||||
|
_bytecode[bodyEndPlaceholder] = realBodyEnd;
|
||||||
|
_bytecode[skipJumpAddress + 1] = realBodyEnd;
|
||||||
|
}
|
||||||
|
else if (auto sizeStmt = dynamic_cast<SizeExpression*>(expr))
|
||||||
|
{
|
||||||
|
Emit(Opcodes::PUSH_VAR);
|
||||||
|
Emit(sizeStmt->identifier);
|
||||||
|
Emit(Opcodes::SIZE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Compiler::FinalCompile()
|
||||||
|
{
|
||||||
|
// build binary header
|
||||||
|
std::vector<double> header = { 0xFF, 0x8C, 0xFF }; // Magic bytes to tell dlang header here
|
||||||
|
|
||||||
|
header.push_back(static_cast<double>(_stringTable.size()));
|
||||||
|
for (const auto& string : _stringTable)
|
||||||
|
{
|
||||||
|
header.push_back(static_cast<double>(string.size()));
|
||||||
|
|
||||||
|
for (auto c : string)
|
||||||
|
header.push_back(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
_bytecode.insert(_bytecode.begin(), header.begin(), header.end());
|
||||||
|
}
|
||||||
|
|
||||||
|
Compiler::Compiler(Program* program) : _program(program) { }
|
||||||
|
|
||||||
|
void Compiler::Compile()
|
||||||
|
{
|
||||||
|
for (const auto& stmt : _program->statements)
|
||||||
|
Compile(stmt.get());
|
||||||
|
|
||||||
|
Emit(Opcodes::EOC);
|
||||||
|
|
||||||
|
FinalCompile();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::vector<double>& Compiler::GetBytecode() const
|
||||||
|
{
|
||||||
|
return _bytecode;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Compiler::Print()
|
||||||
|
{
|
||||||
|
std::stringstream disassembly;
|
||||||
|
size_t ip = 0;
|
||||||
|
|
||||||
|
// -------------------------------------------------------------
|
||||||
|
// 1. HEADER VALIDATIE (0xFF 0x8C 0xFF)
|
||||||
|
// -------------------------------------------------------------
|
||||||
|
if (_bytecode.size() < 3 ||
|
||||||
|
_bytecode[0] != 0xFF ||
|
||||||
|
_bytecode[1] != 0x8C ||
|
||||||
|
_bytecode[2] != 0xFF)
|
||||||
|
{
|
||||||
|
std::printf("Failed to load dlang header from bytecode!\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
disassembly << "=================================================\n";
|
||||||
|
disassembly << "=== HEADER ===\n";
|
||||||
|
disassembly << "0000: FF 8C FF HEADER (Magic Bytes)\n";
|
||||||
|
ip += 3;
|
||||||
|
|
||||||
|
// -------------------------------------------------------------
|
||||||
|
// 2. STRING TABLE UTLEZEN EN FORMATTEREN
|
||||||
|
// -------------------------------------------------------------
|
||||||
|
std::vector<std::string> localStringTable;
|
||||||
|
|
||||||
|
if (ip < _bytecode.size())
|
||||||
|
{
|
||||||
|
size_t stringTableSize = static_cast<size_t>(_bytecode[ip++]);
|
||||||
|
disassembly << "=== STRING TABLE (" << stringTableSize << " entries) ===\n";
|
||||||
|
|
||||||
|
for (size_t i = 0; i < stringTableSize; ++i)
|
||||||
|
{
|
||||||
|
if (ip >= _bytecode.size()) break;
|
||||||
|
|
||||||
|
size_t strStartIp = ip;
|
||||||
|
size_t length = static_cast<size_t>(_bytecode[ip++]);
|
||||||
|
|
||||||
|
std::string str = "";
|
||||||
|
std::stringstream strHexStream;
|
||||||
|
|
||||||
|
// Lengte-byte toevoegen
|
||||||
|
strHexStream << std::hex << std::uppercase << std::setw(2) << std::setfill('0') << static_cast<double>(length) << " ";
|
||||||
|
|
||||||
|
constexpr size_t MAX_HEX_BYTES_TO_SHOW = 12;
|
||||||
|
|
||||||
|
for (size_t j = 0; j < length && ip < _bytecode.size(); ++j)
|
||||||
|
{
|
||||||
|
double c = _bytecode[ip++];
|
||||||
|
str += static_cast<char>(c);
|
||||||
|
|
||||||
|
if (j < MAX_HEX_BYTES_TO_SHOW)
|
||||||
|
{
|
||||||
|
strHexStream << std::hex << std::uppercase << std::setw(2) << std::setfill('0') << c << " ";
|
||||||
|
}
|
||||||
|
else if (j == MAX_HEX_BYTES_TO_SHOW)
|
||||||
|
{
|
||||||
|
strHexStream << "... ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
localStringTable.push_back(str);
|
||||||
|
|
||||||
|
disassembly << std::hex << std::uppercase << std::setw(4) << std::setfill('0') << strStartIp << ": ";
|
||||||
|
|
||||||
|
std::string hexStr = strHexStream.str();
|
||||||
|
if (hexStr.length() > 40)
|
||||||
|
{
|
||||||
|
hexStr = hexStr.substr(0, 37) + "...";
|
||||||
|
}
|
||||||
|
|
||||||
|
disassembly << std::left << std::setw(40) << std::setfill(' ') << hexStr;
|
||||||
|
disassembly << "STRING[" << std::dec << i << "]: \"" << str << "\"\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
disassembly << "=== INSTRUCTIONS ===\n";
|
||||||
|
|
||||||
|
auto getString = [&localStringTable](double rawIndex) -> std::string {
|
||||||
|
size_t strIdx = static_cast<size_t>(rawIndex);
|
||||||
|
if (strIdx < localStringTable.size())
|
||||||
|
return localStringTable[strIdx];
|
||||||
|
return "<invalid string index " + std::to_string(strIdx) + ">";
|
||||||
|
};
|
||||||
|
|
||||||
|
// -------------------------------------------------------------
|
||||||
|
// 3. OPCODES DISASSEMBLEN
|
||||||
|
// -------------------------------------------------------------
|
||||||
|
while (ip < _bytecode.size())
|
||||||
|
{
|
||||||
|
size_t startIp = ip;
|
||||||
|
double rawOp = _bytecode[ip++];
|
||||||
|
Opcodes op = static_cast<Opcodes>(rawOp);
|
||||||
|
|
||||||
|
std::vector<double> instructionBytes;
|
||||||
|
instructionBytes.push_back(rawOp);
|
||||||
|
|
||||||
|
std::string instructionText = OpcodeToString(op);
|
||||||
|
|
||||||
|
switch (op)
|
||||||
|
{
|
||||||
|
// -------------------------------------------------------------
|
||||||
|
// GETALLEN / BOOLEANS
|
||||||
|
// -------------------------------------------------------------
|
||||||
|
case Opcodes::PUSH_INT:
|
||||||
|
{
|
||||||
|
if (ip < _bytecode.size())
|
||||||
|
{
|
||||||
|
double val = _bytecode[ip++];
|
||||||
|
instructionBytes.push_back(val);
|
||||||
|
instructionText += " " + std::to_string(val);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Opcodes::PUSH_BOOL:
|
||||||
|
{
|
||||||
|
if (ip < _bytecode.size())
|
||||||
|
{
|
||||||
|
double raw = _bytecode[ip++];
|
||||||
|
instructionBytes.push_back(raw);
|
||||||
|
bool val = (raw == 1.0);
|
||||||
|
instructionText += (val ? " true" : " false");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -------------------------------------------------------------
|
||||||
|
// STRINGS & VARIABLE NAMES (STRING TABLE LOOKUPS)
|
||||||
|
// -------------------------------------------------------------
|
||||||
|
case Opcodes::PUSH_STRING:
|
||||||
|
case Opcodes::PUSH_FUNC:
|
||||||
|
case Opcodes::PUSH_VAR:
|
||||||
|
case Opcodes::DEFINE_VAR:
|
||||||
|
case Opcodes::STORE_VAR:
|
||||||
|
case Opcodes::GET_FIELD:
|
||||||
|
case Opcodes::SET_FIELD:
|
||||||
|
{
|
||||||
|
if (ip < _bytecode.size())
|
||||||
|
{
|
||||||
|
double index = _bytecode[ip++];
|
||||||
|
instructionBytes.push_back(index);
|
||||||
|
instructionText += " \"" + getString(index) + "\"";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -------------------------------------------------------------
|
||||||
|
// CALLS, TABELLEN EN LIJSTEN
|
||||||
|
// -------------------------------------------------------------
|
||||||
|
case Opcodes::CALL:
|
||||||
|
{
|
||||||
|
if (ip < _bytecode.size())
|
||||||
|
{
|
||||||
|
double argCount = _bytecode[ip++];
|
||||||
|
instructionBytes.push_back(argCount);
|
||||||
|
instructionText += " (" + std::to_string(argCount) + " args)";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Opcodes::NEW_TABLE:
|
||||||
|
{
|
||||||
|
if (ip < _bytecode.size())
|
||||||
|
{
|
||||||
|
double fieldCount = _bytecode[ip++];
|
||||||
|
instructionBytes.push_back(fieldCount);
|
||||||
|
instructionText += " (" + std::to_string(fieldCount) + " fields)";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Opcodes::NEW_LIST:
|
||||||
|
{
|
||||||
|
if (ip < _bytecode.size())
|
||||||
|
{
|
||||||
|
double elemCount = _bytecode[ip++];
|
||||||
|
instructionBytes.push_back(elemCount);
|
||||||
|
instructionText += " (" + std::to_string(elemCount) + " elements)";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -------------------------------------------------------------
|
||||||
|
// JUMPS & CONTROL FLOW
|
||||||
|
// -------------------------------------------------------------
|
||||||
|
case Opcodes::JZ:
|
||||||
|
case Opcodes::JUMP:
|
||||||
|
{
|
||||||
|
if (ip < _bytecode.size())
|
||||||
|
{
|
||||||
|
double target = _bytecode[ip++];
|
||||||
|
instructionBytes.push_back(target);
|
||||||
|
instructionText += " @" + std::to_string(static_cast<size_t>(target));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -------------------------------------------------------------
|
||||||
|
// FUNCTION DEFINITION
|
||||||
|
// -------------------------------------------------------------
|
||||||
|
case Opcodes::FUNC_DEF:
|
||||||
|
{
|
||||||
|
if (ip < _bytecode.size())
|
||||||
|
{
|
||||||
|
double nameLen = _bytecode[ip++];
|
||||||
|
instructionBytes.push_back(nameLen);
|
||||||
|
|
||||||
|
std::string funcName = "";
|
||||||
|
for (double i = 0; i < nameLen && ip < _bytecode.size(); ++i)
|
||||||
|
{
|
||||||
|
double c = _bytecode[ip++];
|
||||||
|
instructionBytes.push_back(c);
|
||||||
|
funcName += static_cast<char>(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
instructionText += " " + funcName + "(";
|
||||||
|
|
||||||
|
if (ip < _bytecode.size())
|
||||||
|
{
|
||||||
|
double paramCount = _bytecode[ip++];
|
||||||
|
instructionBytes.push_back(paramCount);
|
||||||
|
|
||||||
|
for (double p = 0; p < paramCount; ++p)
|
||||||
|
{
|
||||||
|
if (ip < _bytecode.size())
|
||||||
|
{
|
||||||
|
double paramLen = _bytecode[ip++];
|
||||||
|
instructionBytes.push_back(paramLen);
|
||||||
|
|
||||||
|
std::string paramName = "";
|
||||||
|
for (double i = 0; i < paramLen && ip < _bytecode.size(); ++i)
|
||||||
|
{
|
||||||
|
double c = _bytecode[ip++];
|
||||||
|
instructionBytes.push_back(c);
|
||||||
|
paramName += static_cast<char>(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
instructionText += paramName;
|
||||||
|
if (p < paramCount - 1) instructionText += ", ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
instructionText += ")";
|
||||||
|
|
||||||
|
if (ip < _bytecode.size())
|
||||||
|
{
|
||||||
|
double bodyAddr = _bytecode[ip++];
|
||||||
|
instructionBytes.push_back(bodyAddr);
|
||||||
|
instructionText += " @" + std::to_string(static_cast<size_t>(bodyAddr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case Opcodes::EOC:
|
||||||
|
case Opcodes::ADD:
|
||||||
|
case Opcodes::SUB:
|
||||||
|
case Opcodes::MUL:
|
||||||
|
case Opcodes::DIV:
|
||||||
|
case Opcodes::GREATER_THAN:
|
||||||
|
case Opcodes::LESS_THAN:
|
||||||
|
case Opcodes::RET:
|
||||||
|
case Opcodes::POP:
|
||||||
|
case Opcodes::CMP:
|
||||||
|
case Opcodes::GTE:
|
||||||
|
case Opcodes::LTE:
|
||||||
|
case Opcodes::AND:
|
||||||
|
case Opcodes::OR:
|
||||||
|
case Opcodes::NTE:
|
||||||
|
case Opcodes::PUSH_LIST:
|
||||||
|
case Opcodes::GET_INDEX:
|
||||||
|
case Opcodes::SET_INDEX:
|
||||||
|
case Opcodes::SIZE:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -------------------------------------------------------------
|
||||||
|
// FORMATTING & OUTPUT FOR OPCODES
|
||||||
|
// -------------------------------------------------------------
|
||||||
|
disassembly << std::hex << std::uppercase << std::setw(4) << std::setfill('0') << startIp << ": ";
|
||||||
|
|
||||||
|
std::stringstream hexStream;
|
||||||
|
for (auto b : instructionBytes)
|
||||||
|
hexStream << std::hex << std::uppercase << std::setw(2) << std::setfill('0') << b << " ";
|
||||||
|
|
||||||
|
std::string hexStr = hexStream.str();
|
||||||
|
if (hexStr.length() > 40)
|
||||||
|
{
|
||||||
|
hexStr = hexStr.substr(0, 37) + "...";
|
||||||
|
}
|
||||||
|
|
||||||
|
disassembly << std::left << std::setw(40) << std::setfill(' ') << hexStr;
|
||||||
|
disassembly << instructionText << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
std::printf("%s", disassembly.str().c_str());
|
||||||
|
}
|
||||||
@@ -0,0 +1,255 @@
|
|||||||
|
#include "../lexer.hpp"
|
||||||
|
#include "../helpers.hpp"
|
||||||
|
#include "../language.hpp"
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
using namespace Dlang::Language;
|
||||||
|
|
||||||
|
void Lexer::Parse(const std::string& code)
|
||||||
|
{
|
||||||
|
int line = 1, column = 0;
|
||||||
|
std::string stringBuilder;
|
||||||
|
bool insideString = false;
|
||||||
|
bool insideComment = false;
|
||||||
|
|
||||||
|
auto flushBuilder = [&]()
|
||||||
|
{
|
||||||
|
if (!stringBuilder.empty())
|
||||||
|
{
|
||||||
|
if (!std::all_of(stringBuilder.begin(), stringBuilder.end(), ::isspace))
|
||||||
|
{
|
||||||
|
_tokens.push_back({ stringBuilder, line, column });
|
||||||
|
}
|
||||||
|
stringBuilder.clear();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
for (size_t i = 0; i < code.size(); ++i)
|
||||||
|
{
|
||||||
|
char c = code.at(i);
|
||||||
|
column++;
|
||||||
|
|
||||||
|
if (c == '\t') continue;
|
||||||
|
|
||||||
|
if (!insideString && (i + 1 < code.size()))
|
||||||
|
{
|
||||||
|
if ((c == '/' && code.at(i + 1) == '/') || (c == '-' && code.at(i + 1) == '-'))
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
insideComment = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c == '\n')
|
||||||
|
{
|
||||||
|
if (insideComment)
|
||||||
|
insideComment = false;
|
||||||
|
|
||||||
|
line++;
|
||||||
|
column = 1;
|
||||||
|
c = ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (insideComment)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (insideString)
|
||||||
|
{
|
||||||
|
stringBuilder += c;
|
||||||
|
if (c == '\'' || c == '"')
|
||||||
|
{
|
||||||
|
_tokens.push_back({ stringBuilder, line, column });
|
||||||
|
stringBuilder.clear();
|
||||||
|
insideString = false;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c == '\'' || c == '"')
|
||||||
|
{
|
||||||
|
flushBuilder();
|
||||||
|
insideString = true;
|
||||||
|
stringBuilder += c;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c == ' ' || c == '\r')
|
||||||
|
{
|
||||||
|
flushBuilder();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsSingleCharToken(c))
|
||||||
|
{
|
||||||
|
flushBuilder();
|
||||||
|
_tokens.push_back({ std::string(1, c), line, column });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
stringBuilder += c;
|
||||||
|
}
|
||||||
|
|
||||||
|
flushBuilder();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Lexer::ParseOrganizedTokens()
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < _tokens.size(); ++i)
|
||||||
|
{
|
||||||
|
static auto peek = [&](int off = 1)
|
||||||
|
{
|
||||||
|
if ((i + off) >= _tokens.size())
|
||||||
|
return PreToken::CreateEmpty();
|
||||||
|
|
||||||
|
return _tokens.at(i + off);
|
||||||
|
};
|
||||||
|
|
||||||
|
auto tokenData = _tokens.at(i);
|
||||||
|
auto token = tokenData.value;
|
||||||
|
auto line = tokenData.line;
|
||||||
|
auto column = tokenData.column;
|
||||||
|
|
||||||
|
char c = token.at(0);
|
||||||
|
|
||||||
|
if (IsSingleCharToken(c))
|
||||||
|
{
|
||||||
|
if (peek().value[0] == op_equals)
|
||||||
|
{
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
case op_equals: {
|
||||||
|
i++;
|
||||||
|
_organizedTokens.push_back({ std::string(op_eq), TokenType::SYNTAX, line, column });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
case op_above: {
|
||||||
|
i++;
|
||||||
|
_organizedTokens.push_back({ std::string(op_gte), TokenType::SYNTAX, line, column });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
case op_below: {
|
||||||
|
i++;
|
||||||
|
_organizedTokens.push_back({ std::string(op_lte), TokenType::SYNTAX, line, column });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
case op_not: {
|
||||||
|
i++;
|
||||||
|
_organizedTokens.push_back({ std::string(op_neq), TokenType::SYNTAX, line, column });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
case op_add: {
|
||||||
|
i++;
|
||||||
|
_organizedTokens.push_back({ std::string(op_add_assign), TokenType::SYNTAX, line, column });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
case op_sub: {
|
||||||
|
i++;
|
||||||
|
_organizedTokens.push_back({ std::string(op_sub_assign), TokenType::SYNTAX, line, column });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
case op_multi: {
|
||||||
|
i++;
|
||||||
|
_organizedTokens.push_back({ std::string(op_mul_assign), TokenType::SYNTAX, line, column });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
case op_div: {
|
||||||
|
i++;
|
||||||
|
_organizedTokens.push_back({ std::string(op_div_assign), TokenType::SYNTAX, line, column });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_organizedTokens.push_back({ token, TokenType::SYNTAX, line, column });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsStringNumber(token))
|
||||||
|
{
|
||||||
|
bool isNeg = false;
|
||||||
|
|
||||||
|
if (!_organizedTokens.empty() && _organizedTokens.back().value[0] == op_sub)
|
||||||
|
{
|
||||||
|
if (_organizedTokens.size() >= 2)
|
||||||
|
{
|
||||||
|
auto& prevToken = _organizedTokens[_organizedTokens.size() - 2];
|
||||||
|
|
||||||
|
bool isUnaryContext = (prevToken.type == TokenType::SYNTAX &&
|
||||||
|
(prevToken.value[0] == op_equals) ||
|
||||||
|
prevToken.value[0] == op_exprstart ||
|
||||||
|
prevToken.value[0] == op_separator ||
|
||||||
|
prevToken.value[0] == op_colon ||
|
||||||
|
prevToken.value[0] == op_arraystart ||
|
||||||
|
prevToken.value[0] == op_arraystart) ||
|
||||||
|
(prevToken.type == TokenType::KEYWORD);
|
||||||
|
|
||||||
|
if (isUnaryContext)
|
||||||
|
{
|
||||||
|
_organizedTokens.pop_back();
|
||||||
|
isNeg = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (_organizedTokens.size() == 1)
|
||||||
|
{
|
||||||
|
_organizedTokens.pop_back();
|
||||||
|
isNeg = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (peek().value[0] == op_dot && IsStringNumber(peek(2).value))
|
||||||
|
{
|
||||||
|
auto dotToken = _tokens.at(++i);
|
||||||
|
auto secondNum = _tokens.at(++i);
|
||||||
|
|
||||||
|
auto number = (isNeg ? "-" : "") + token + dotToken.value + secondNum.value;
|
||||||
|
_organizedTokens.push_back({ number, TokenType::NUMBER, line, column });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
_organizedTokens.push_back({ (isNeg ? "-" : "") + token, TokenType::NUMBER, line, column });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsBoolean(token))
|
||||||
|
{
|
||||||
|
_organizedTokens.push_back({ token, TokenType::BOOLEAN, line, column });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsKeyword(token))
|
||||||
|
{
|
||||||
|
_organizedTokens.push_back({ token, TokenType::KEYWORD, line, column });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (token == op_and || token == op_or)
|
||||||
|
{
|
||||||
|
_organizedTokens.push_back({ token, TokenType::SYNTAX, line, column });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((token.front() == '\'' || token.front() == '"') && (token.back() == '\'' || token.back() == '"'))
|
||||||
|
{
|
||||||
|
_organizedTokens.push_back({ token.substr(1, token.size() - 2), TokenType::STRING, line, column });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsIdentifier(token))
|
||||||
|
{
|
||||||
|
_organizedTokens.push_back({ token, TokenType::IDENTIFIER, line, column });
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
_organizedTokens.push_back({ token, TokenType::UNIDENTIFIED, line, column });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<PreToken> Lexer::GetTokens() const
|
||||||
|
{
|
||||||
|
return _tokens;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<Token> Lexer::GetOrganizedTokens() const
|
||||||
|
{
|
||||||
|
return _organizedTokens;
|
||||||
|
}
|
||||||
@@ -0,0 +1,644 @@
|
|||||||
|
#include "../parser.hpp"
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
std::string LocationText(const Token& t)
|
||||||
|
{
|
||||||
|
return "at line " + std::to_string(t.line) + " column " + std::to_string(t.column);
|
||||||
|
}
|
||||||
|
|
||||||
|
Token& Parser::Current()
|
||||||
|
{
|
||||||
|
if (_pos < _tokens.size())
|
||||||
|
return _tokens[_pos];
|
||||||
|
|
||||||
|
throw std::runtime_error("Unidentified token!");
|
||||||
|
}
|
||||||
|
|
||||||
|
Token& Parser::Consume()
|
||||||
|
{
|
||||||
|
if (_pos < _tokens.size())
|
||||||
|
return _tokens[_pos++];
|
||||||
|
|
||||||
|
throw std::runtime_error("Unidentified token!");
|
||||||
|
}
|
||||||
|
|
||||||
|
Token& Parser::Peek(size_t offset)
|
||||||
|
{
|
||||||
|
if (_pos + offset < _tokens.size())
|
||||||
|
return _tokens[_pos + offset];
|
||||||
|
|
||||||
|
throw std::runtime_error("Unidentified token!");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Parser::Match(TokenType type, const std::string& value)
|
||||||
|
{
|
||||||
|
const auto& current = Current();
|
||||||
|
|
||||||
|
if (current.type != type || current.value != value)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Consume();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Token& Parser::ShouldBe(TokenType type, const std::string& value)
|
||||||
|
{
|
||||||
|
const auto& current = Current();
|
||||||
|
|
||||||
|
if (current.type != type)
|
||||||
|
throw std::runtime_error("Unexpected type '" + std::string(TokenTypeToString(current.type)) + "' where '" + std::string(TokenTypeToString(type)) + "' should be " + LocationText(current));
|
||||||
|
|
||||||
|
if(!value.empty() && value != current.value)
|
||||||
|
throw std::runtime_error("Unexpected value '" + current.value + "' where '" + value + "' should be " + LocationText(current));
|
||||||
|
|
||||||
|
return Consume();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Parser::Match(TokenType type, char value)
|
||||||
|
{
|
||||||
|
return Match(type, std::string(1, value));
|
||||||
|
}
|
||||||
|
|
||||||
|
Token& Parser::ShouldBe(TokenType type, char value)
|
||||||
|
{
|
||||||
|
return ShouldBe(type, std::string(1, value));
|
||||||
|
}
|
||||||
|
|
||||||
|
Parser::Parser(const std::vector<Token>& tokens) : _tokens(tokens) { }
|
||||||
|
|
||||||
|
Program Parser::ParseProgram()
|
||||||
|
{
|
||||||
|
Program program;
|
||||||
|
|
||||||
|
while (_pos < _tokens.size())
|
||||||
|
program.statements.push_back(ParseStatement());
|
||||||
|
|
||||||
|
return program;
|
||||||
|
}
|
||||||
|
|
||||||
|
using namespace Dlang::Language;
|
||||||
|
#pragma region STATEMENTS
|
||||||
|
|
||||||
|
std::unique_ptr<Statement> Parser::ParseStatement()
|
||||||
|
{
|
||||||
|
if (Match(TokenType::KEYWORD, kw_var))
|
||||||
|
return ParseVariableDeclaration();
|
||||||
|
|
||||||
|
if (Match(TokenType::KEYWORD, kw_while))
|
||||||
|
return ParseWhileDeclaration();
|
||||||
|
|
||||||
|
if (Match(TokenType::KEYWORD, kw_for))
|
||||||
|
return ParseForDeclaration();
|
||||||
|
|
||||||
|
if (Match(TokenType::KEYWORD, kw_foreach))
|
||||||
|
return ParseForeachDeclaration();
|
||||||
|
|
||||||
|
if (Match(TokenType::KEYWORD, kw_if))
|
||||||
|
return ParseIfDeclaration();
|
||||||
|
|
||||||
|
if (Match(TokenType::KEYWORD, kw_func))
|
||||||
|
return ParseFunctionDeclaration();
|
||||||
|
|
||||||
|
if (Match(TokenType::KEYWORD, kw_return))
|
||||||
|
return ParseReturnStatement();
|
||||||
|
|
||||||
|
if (Match(TokenType::KEYWORD, kw_include))
|
||||||
|
return ParseIncludeStatement();
|
||||||
|
|
||||||
|
auto expr = ParseExpression();
|
||||||
|
|
||||||
|
if (Match(TokenType::SYNTAX, op_equals))
|
||||||
|
{
|
||||||
|
auto op = Peek(-1).value;
|
||||||
|
if (!dynamic_cast<IdentifierExpression*>(expr.get()) &&
|
||||||
|
!dynamic_cast<MemberAccessExpression*>(expr.get()) &&
|
||||||
|
!dynamic_cast<IndexAccessExpression*>(expr.get()))
|
||||||
|
{
|
||||||
|
throw std::runtime_error("Invalid left-hand side in assignment");
|
||||||
|
}
|
||||||
|
|
||||||
|
auto value = ParseExpression();
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_endl);
|
||||||
|
|
||||||
|
auto assignment = std::make_unique<Assignment>();
|
||||||
|
assignment->lhs = std::move(expr);
|
||||||
|
assignment->value = std::move(value);
|
||||||
|
assignment->assignmentOperator = op;
|
||||||
|
return assignment;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Match(TokenType::SYNTAX, op_add_assign) || Match(TokenType::SYNTAX, op_sub_assign) || Match(TokenType::SYNTAX, op_mul_assign) || Match(TokenType::SYNTAX, op_div_assign))
|
||||||
|
{
|
||||||
|
std::string op = Peek(-1).value;
|
||||||
|
|
||||||
|
if (!dynamic_cast<IdentifierExpression*>(expr.get()) &&
|
||||||
|
!dynamic_cast<MemberAccessExpression*>(expr.get()) &&
|
||||||
|
!dynamic_cast<IndexAccessExpression*>(expr.get()))
|
||||||
|
{
|
||||||
|
throw std::runtime_error("Invalid left-hand side in assignment");
|
||||||
|
}
|
||||||
|
|
||||||
|
auto value = ParseExpression();
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_endl);
|
||||||
|
|
||||||
|
auto assignment = std::make_unique<Assignment>();
|
||||||
|
assignment->lhs = std::move(expr);
|
||||||
|
assignment->value = std::move(value);
|
||||||
|
assignment->assignmentOperator = op;
|
||||||
|
return assignment;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_endl);
|
||||||
|
|
||||||
|
auto stmt = std::make_unique<ExpressionStatement>();
|
||||||
|
stmt->expression = std::move(expr);
|
||||||
|
return stmt;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Statement> Parser::ParseVariableDeclaration()
|
||||||
|
{
|
||||||
|
auto name = ShouldBe(TokenType::IDENTIFIER);
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_equals);
|
||||||
|
auto initializer = ParseExpression();
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_endl);
|
||||||
|
|
||||||
|
auto declaration = std::make_unique<VariableDeclaration>();
|
||||||
|
declaration->name = name.value;
|
||||||
|
declaration->initializer = std::move(initializer);
|
||||||
|
|
||||||
|
return declaration;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Statement> Parser::ParseAssignment()
|
||||||
|
{
|
||||||
|
auto lhs = ParseExpression();
|
||||||
|
|
||||||
|
if (!dynamic_cast<IdentifierExpression*>(lhs.get()) &&
|
||||||
|
!dynamic_cast<MemberAccessExpression*>(lhs.get()))
|
||||||
|
{
|
||||||
|
throw std::runtime_error("Invalid left-hand side in assignment");
|
||||||
|
}
|
||||||
|
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_equals);
|
||||||
|
auto value = ParseExpression();
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_endl);
|
||||||
|
|
||||||
|
auto assignment = std::make_unique<Assignment>();
|
||||||
|
assignment->lhs = std::move(lhs);
|
||||||
|
assignment->value = std::move(value);
|
||||||
|
|
||||||
|
return assignment;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Statement> Parser::ParseWhileDeclaration()
|
||||||
|
{
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_exprstart);
|
||||||
|
|
||||||
|
auto stmt = std::make_unique<WhileStatement>();
|
||||||
|
stmt->condition = ParseExpression();
|
||||||
|
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_exprend);
|
||||||
|
ShouldBe(TokenType::KEYWORD, kw_do);
|
||||||
|
|
||||||
|
while (!Match(TokenType::KEYWORD, kw_end))
|
||||||
|
stmt->body.push_back(ParseStatement());
|
||||||
|
|
||||||
|
return stmt;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Statement> Parser::ParseForDeclaration()
|
||||||
|
{
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_exprstart);
|
||||||
|
auto varName = ShouldBe(TokenType::IDENTIFIER);
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_separator);
|
||||||
|
auto from = ShouldBe(TokenType::NUMBER);
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_separator);
|
||||||
|
auto to = ShouldBe(TokenType::NUMBER);
|
||||||
|
|
||||||
|
auto stmt = std::make_unique<ForStatement>();
|
||||||
|
stmt->var = varName.value;
|
||||||
|
stmt->from = std::stod(from.value);
|
||||||
|
stmt->to = std::stod(to.value);
|
||||||
|
|
||||||
|
if (Match(TokenType::SYNTAX, op_separator))
|
||||||
|
{
|
||||||
|
auto step = ShouldBe(TokenType::NUMBER);
|
||||||
|
stmt->step = std::stod(step.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_exprend);
|
||||||
|
ShouldBe(TokenType::KEYWORD, kw_do);
|
||||||
|
|
||||||
|
while (!Match(TokenType::KEYWORD, kw_end))
|
||||||
|
stmt->body.push_back(ParseStatement());
|
||||||
|
|
||||||
|
return stmt;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Statement> Parser::ParseForeachDeclaration()
|
||||||
|
{
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_exprstart);
|
||||||
|
auto varName = ShouldBe(TokenType::IDENTIFIER);
|
||||||
|
if (Match(TokenType::KEYWORD, kw_in))
|
||||||
|
{
|
||||||
|
auto list = ShouldBe(TokenType::IDENTIFIER);
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_exprend);
|
||||||
|
ShouldBe(TokenType::KEYWORD, kw_do);
|
||||||
|
|
||||||
|
auto stmt = std::make_unique<ForeachStatement>();
|
||||||
|
stmt->var = varName.value;
|
||||||
|
stmt->list = list.value;
|
||||||
|
|
||||||
|
while (!Match(TokenType::KEYWORD, kw_end))
|
||||||
|
stmt->body.push_back(ParseStatement());
|
||||||
|
|
||||||
|
return stmt;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_separator);
|
||||||
|
auto value = ShouldBe(TokenType::IDENTIFIER);
|
||||||
|
ShouldBe(TokenType::KEYWORD, kw_in);
|
||||||
|
auto table = ShouldBe(TokenType::IDENTIFIER);
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_exprend);
|
||||||
|
ShouldBe(TokenType::KEYWORD, kw_do);
|
||||||
|
|
||||||
|
auto stmt = std::make_unique<ForeachTableStatement>();
|
||||||
|
stmt->varKey = varName.value;
|
||||||
|
stmt->varValue = value.value;
|
||||||
|
stmt->table = table.value;
|
||||||
|
|
||||||
|
while (!Match(TokenType::KEYWORD, kw_end))
|
||||||
|
stmt->body.push_back(ParseStatement());
|
||||||
|
|
||||||
|
return stmt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Statement> Parser::ParseIfDeclaration()
|
||||||
|
{
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_exprstart);
|
||||||
|
auto expr = ParseExpression();
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_exprend);
|
||||||
|
ShouldBe(TokenType::KEYWORD, kw_then);
|
||||||
|
|
||||||
|
auto stmt = std::make_unique<IfStatement>();
|
||||||
|
stmt->expression = std::move(expr);
|
||||||
|
|
||||||
|
Token t;
|
||||||
|
while (!Match(TokenType::KEYWORD, kw_else) && !Match(TokenType::KEYWORD, kw_end))
|
||||||
|
stmt->body.push_back(ParseStatement());
|
||||||
|
|
||||||
|
if (Peek(-1).type == TokenType::KEYWORD && Peek(-1).value == kw_else)
|
||||||
|
{
|
||||||
|
if (Match(TokenType::KEYWORD, kw_if))
|
||||||
|
stmt->elseBody.push_back(ParseIfDeclaration());
|
||||||
|
else
|
||||||
|
while (!Match(TokenType::KEYWORD, kw_end))
|
||||||
|
stmt->elseBody.push_back(ParseStatement());
|
||||||
|
}
|
||||||
|
|
||||||
|
return stmt;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Statement> Parser::ParseFunctionDeclaration()
|
||||||
|
{
|
||||||
|
auto funcName = ShouldBe(TokenType::IDENTIFIER);
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_exprstart);
|
||||||
|
std::vector<std::string> params;
|
||||||
|
if (!Match(TokenType::SYNTAX, op_exprend))
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
Token param = ShouldBe(TokenType::IDENTIFIER);
|
||||||
|
params.push_back(param.value);
|
||||||
|
} while (Match(TokenType::SYNTAX, op_separator));
|
||||||
|
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_exprend);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto stmt = std::make_unique<FunctionStatement>();
|
||||||
|
stmt->name = funcName.value;
|
||||||
|
stmt->parameters = params;
|
||||||
|
|
||||||
|
while (!Match(TokenType::KEYWORD, kw_end))
|
||||||
|
stmt->body.push_back(ParseStatement());
|
||||||
|
|
||||||
|
return stmt;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Statement> Parser::ParseReturnStatement()
|
||||||
|
{
|
||||||
|
auto stmt = std::make_unique<ReturnStatement>();
|
||||||
|
|
||||||
|
if (!Match(TokenType::SYNTAX, op_endl))
|
||||||
|
{
|
||||||
|
stmt->expression = ParseExpression();
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_endl);
|
||||||
|
}
|
||||||
|
|
||||||
|
return stmt;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Statement> Parser::ParseIncludeStatement()
|
||||||
|
{
|
||||||
|
auto stmt = std::make_unique<IncludeStatement>();
|
||||||
|
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_exprstart);
|
||||||
|
auto path = ShouldBe(TokenType::STRING).value;
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_exprend);
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_endl);
|
||||||
|
stmt->path = path;
|
||||||
|
|
||||||
|
return stmt;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
|
#pragma region EXPRESSIONS
|
||||||
|
|
||||||
|
std::unique_ptr<Expression> Parser::ParseFunctionCall(std::unique_ptr<Expression> callee)
|
||||||
|
{
|
||||||
|
auto stmt = std::make_unique<CallExpression>();
|
||||||
|
stmt->callee = std::move(callee);
|
||||||
|
|
||||||
|
if (!Match(TokenType::SYNTAX, op_exprend))
|
||||||
|
{
|
||||||
|
do {
|
||||||
|
stmt->expressions.push_back(ParseExpression());
|
||||||
|
} while (Match(TokenType::SYNTAX, op_separator));
|
||||||
|
|
||||||
|
if (!Match(TokenType::SYNTAX, op_exprend))
|
||||||
|
throw std::runtime_error("Expected ')' after arguments " + LocationText(Current()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return stmt;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Expression> Parser::ParseExpression()
|
||||||
|
{
|
||||||
|
return ParseLogicalAndOr();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Expression> Parser::ParsePrimary()
|
||||||
|
{
|
||||||
|
if (Match(TokenType::SYNTAX, op_exprstart))
|
||||||
|
{
|
||||||
|
auto expression = ParseExpression();
|
||||||
|
|
||||||
|
if (!Match(TokenType::SYNTAX, op_exprend))
|
||||||
|
throw std::runtime_error("Expected ')' " + LocationText(Current()));
|
||||||
|
|
||||||
|
return expression;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Match(TokenType::SYNTAX, op_arraystart))
|
||||||
|
return ParseTableLiteral();
|
||||||
|
|
||||||
|
if (Match(TokenType::SYNTAX, op_liststart))
|
||||||
|
return ParseListLiteral();
|
||||||
|
|
||||||
|
if (Match(TokenType::KEYWORD, kw_func))
|
||||||
|
return ParseFunctionExpression();
|
||||||
|
|
||||||
|
if (Match(TokenType::SYNTAX, op_size))
|
||||||
|
return ParseSizeExpression();
|
||||||
|
|
||||||
|
const auto& current = Current();
|
||||||
|
|
||||||
|
if (current.type == TokenType::NUMBER)
|
||||||
|
{
|
||||||
|
auto token = ShouldBe(TokenType::NUMBER);
|
||||||
|
|
||||||
|
auto expression = std::make_unique<NumberExpression>();
|
||||||
|
expression->value = std::stod(token.value);
|
||||||
|
|
||||||
|
return expression;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (current.type == TokenType::BOOLEAN)
|
||||||
|
{
|
||||||
|
auto token = ShouldBe(TokenType::BOOLEAN);
|
||||||
|
|
||||||
|
auto expression = std::make_unique<BooleanExpression>();
|
||||||
|
expression->value = (token.value == kw_true ? true : false);
|
||||||
|
|
||||||
|
return expression;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (current.type == TokenType::STRING)
|
||||||
|
{
|
||||||
|
auto token = ShouldBe(TokenType::STRING);
|
||||||
|
|
||||||
|
auto expression = std::make_unique<StringExpression>();
|
||||||
|
expression->value = token.value;
|
||||||
|
|
||||||
|
return expression;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (current.type == TokenType::IDENTIFIER)
|
||||||
|
{
|
||||||
|
auto token = ShouldBe(TokenType::IDENTIFIER);
|
||||||
|
|
||||||
|
auto idExpr = std::make_unique<IdentifierExpression>();
|
||||||
|
idExpr->name = token.value;
|
||||||
|
|
||||||
|
std::unique_ptr<Expression> left;
|
||||||
|
|
||||||
|
if (Match(TokenType::SYNTAX, op_exprstart))
|
||||||
|
left = ParseFunctionCall(std::move(idExpr));
|
||||||
|
else
|
||||||
|
left = std::move(idExpr);
|
||||||
|
|
||||||
|
while (Match(TokenType::SYNTAX, op_dot) || Match(TokenType::SYNTAX, op_liststart))
|
||||||
|
{
|
||||||
|
if (Peek(-1).value[0] == op_dot)
|
||||||
|
{
|
||||||
|
auto memberExpr = std::make_unique<MemberAccessExpression>();
|
||||||
|
memberExpr->object = std::move(left);
|
||||||
|
memberExpr->memberName = ShouldBe(TokenType::IDENTIFIER).value;
|
||||||
|
left = std::move(memberExpr);
|
||||||
|
|
||||||
|
if (Match(TokenType::SYNTAX, op_exprstart))
|
||||||
|
{
|
||||||
|
left = ParseFunctionCall(std::move(left));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto indexExpr = ParseExpression();
|
||||||
|
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_listend);
|
||||||
|
|
||||||
|
auto indexAccess = std::make_unique<IndexAccessExpression>();
|
||||||
|
indexAccess->object = std::move(left);
|
||||||
|
indexAccess->memberIndex = std::move(indexExpr);
|
||||||
|
|
||||||
|
left = std::move(indexAccess);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return left;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw std::runtime_error("Expected expression " + LocationText(current));
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Expression> Parser::ParseMultiplicative()
|
||||||
|
{
|
||||||
|
auto left = ParsePrimary();
|
||||||
|
|
||||||
|
while (Current().type == TokenType::SYNTAX &&
|
||||||
|
(Current().value[0] == op_multi || Current().value[0] == op_div))
|
||||||
|
{
|
||||||
|
auto op = Consume();
|
||||||
|
auto right = ParsePrimary();
|
||||||
|
|
||||||
|
auto expression = std::make_unique<BinaryExpression>();
|
||||||
|
expression->left = std::move(left);
|
||||||
|
expression->op = op.value;
|
||||||
|
expression->right = std::move(right);
|
||||||
|
|
||||||
|
left = std::move(expression);
|
||||||
|
}
|
||||||
|
|
||||||
|
return left;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Expression> Parser::ParseAdditive()
|
||||||
|
{
|
||||||
|
auto left = ParseMultiplicative();
|
||||||
|
|
||||||
|
while (Current().type == TokenType::SYNTAX &&
|
||||||
|
(Current().value[0] == op_add || Current().value[0] == op_sub))
|
||||||
|
{
|
||||||
|
auto op = Consume();
|
||||||
|
|
||||||
|
auto right = ParseMultiplicative();
|
||||||
|
|
||||||
|
auto expression = std::make_unique<BinaryExpression>();
|
||||||
|
|
||||||
|
expression->left = std::move(left);
|
||||||
|
expression->op = op.value;
|
||||||
|
expression->right = std::move(right);
|
||||||
|
|
||||||
|
left = std::move(expression);
|
||||||
|
}
|
||||||
|
|
||||||
|
return left;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Expression> Parser::ParseComparison()
|
||||||
|
{
|
||||||
|
auto left = ParseAdditive();
|
||||||
|
|
||||||
|
while (
|
||||||
|
Match(TokenType::SYNTAX, op_above) ||
|
||||||
|
Match(TokenType::SYNTAX, op_below) ||
|
||||||
|
Match(TokenType::SYNTAX, op_eq) ||
|
||||||
|
Match(TokenType::SYNTAX, op_gte) ||
|
||||||
|
Match(TokenType::SYNTAX, op_lte) ||
|
||||||
|
Match(TokenType::SYNTAX, op_neq)
|
||||||
|
) {
|
||||||
|
auto op = Peek(-1);
|
||||||
|
auto right = ParseAdditive();
|
||||||
|
|
||||||
|
auto expr = std::make_unique<BinaryExpression>();
|
||||||
|
expr->left = std::move(left);
|
||||||
|
expr->op = op.value;
|
||||||
|
expr->right = std::move(right);
|
||||||
|
|
||||||
|
left = std::move(expr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return left;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Expression> Parser::ParseTableLiteral()
|
||||||
|
{
|
||||||
|
auto expr = std::make_unique<TableLiteralExpression>();
|
||||||
|
|
||||||
|
while (!Match(TokenType::SYNTAX, op_arrayend))
|
||||||
|
{
|
||||||
|
std::string key = ShouldBe(TokenType::IDENTIFIER).value;
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_colon);
|
||||||
|
|
||||||
|
auto valueExpr = ParseExpression();
|
||||||
|
expr->fields.push_back({ key, std::move(valueExpr) });
|
||||||
|
|
||||||
|
Match(TokenType::SYNTAX, op_separator);
|
||||||
|
}
|
||||||
|
|
||||||
|
return expr;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Expression> Parser::ParseListLiteral()
|
||||||
|
{
|
||||||
|
auto expr = std::make_unique<ListLiteralExpression>();
|
||||||
|
|
||||||
|
while (!Match(TokenType::SYNTAX, op_listend))
|
||||||
|
{
|
||||||
|
auto valueExpr = ParseExpression();
|
||||||
|
expr->fields.push_back(std::move(valueExpr));
|
||||||
|
|
||||||
|
Match(TokenType::SYNTAX, op_separator);
|
||||||
|
}
|
||||||
|
|
||||||
|
return expr;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Expression> Parser::ParseLogicalAndOr()
|
||||||
|
{
|
||||||
|
auto left = ParseComparison();
|
||||||
|
|
||||||
|
while (Match(TokenType::SYNTAX, op_and) || Match(TokenType::SYNTAX, op_or))
|
||||||
|
{
|
||||||
|
auto op = Peek(-1);
|
||||||
|
auto right = ParseComparison();
|
||||||
|
|
||||||
|
auto expr = std::make_unique<BinaryExpression>();
|
||||||
|
expr->left = std::move(left);
|
||||||
|
expr->op = op.value;
|
||||||
|
expr->right = std::move(right);
|
||||||
|
|
||||||
|
left = std::move(expr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return left;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Expression> Parser::ParseFunctionExpression()
|
||||||
|
{
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_exprstart);
|
||||||
|
std::vector<std::string> params;
|
||||||
|
if (!Match(TokenType::SYNTAX, op_exprend))
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
Token param = ShouldBe(TokenType::IDENTIFIER);
|
||||||
|
params.push_back(param.value);
|
||||||
|
} while (Match(TokenType::SYNTAX, op_separator));
|
||||||
|
|
||||||
|
ShouldBe(TokenType::SYNTAX, op_exprend);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto expr = std::make_unique<FunctionExpression>();
|
||||||
|
expr->parameters = params;
|
||||||
|
|
||||||
|
while (!Match(TokenType::KEYWORD, kw_end))
|
||||||
|
expr->body.push_back(ParseStatement());
|
||||||
|
|
||||||
|
return expr;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<Expression> Parser::ParseSizeExpression()
|
||||||
|
{
|
||||||
|
auto target = ShouldBe(TokenType::IDENTIFIER).value;
|
||||||
|
|
||||||
|
auto stmt = std::make_unique<SizeExpression>();
|
||||||
|
stmt->identifier = target;
|
||||||
|
|
||||||
|
return stmt;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma endregion
|
||||||
@@ -0,0 +1,882 @@
|
|||||||
|
#include "../vm.hpp"
|
||||||
|
#include <fstream>
|
||||||
|
#include <filesystem>
|
||||||
|
#include <algorithm>
|
||||||
|
#include "../helpers.hpp"
|
||||||
|
|
||||||
|
std::string DlangVM::GetString(const ByteCodeArray& bytecode, size_t& ip)
|
||||||
|
{
|
||||||
|
auto idx = bytecode[ip++];
|
||||||
|
return strings[idx];
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string DlangVM::GetRealString(const ByteCodeArray& bytecode, size_t& ip)
|
||||||
|
{
|
||||||
|
double length = bytecode[ip++];
|
||||||
|
std::string str = "";
|
||||||
|
for (double i = 0; i < length; ++i)
|
||||||
|
str += static_cast<char>(bytecode[ip++]);
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DlangVM::Execute(ByteCodeArray bytecode)
|
||||||
|
{
|
||||||
|
size_t ip = 0;
|
||||||
|
auto bytecodeSize = bytecode.size();
|
||||||
|
|
||||||
|
#if DEBUG_MODE == 1
|
||||||
|
printf("==================== VM ====================\n");
|
||||||
|
auto start = std::chrono::high_resolution_clock::now();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
while (ip < bytecodeSize)
|
||||||
|
{
|
||||||
|
auto op = static_cast<Opcodes>(bytecode[ip++]);
|
||||||
|
switch (op)
|
||||||
|
{
|
||||||
|
#pragma region VM CONTROL OPCODES
|
||||||
|
case Opcodes::EOC: break; break;
|
||||||
|
case Opcodes::POP: Pop(); break;
|
||||||
|
|
||||||
|
case Opcodes::PUSH_INT: {
|
||||||
|
auto val = bytecode[ip++];
|
||||||
|
PushNumber(val);
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::PUSH_BOOL: {
|
||||||
|
auto val = bytecode[ip++];
|
||||||
|
PushBoolean(val == 1);
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::PUSH_STRING: {
|
||||||
|
auto val = GetString(bytecode, ip);
|
||||||
|
PushString(val);
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::PUSH_VAR: {
|
||||||
|
auto val = GetString(bytecode, ip);
|
||||||
|
PushVar(val);
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::PUSH_FUNC: {
|
||||||
|
auto func = GetString(bytecode, ip);
|
||||||
|
stack.push(
|
||||||
|
globals.Get(func)
|
||||||
|
);
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::DEFINE_VAR:
|
||||||
|
case Opcodes::STORE_VAR: {
|
||||||
|
auto name = GetString(bytecode, ip);
|
||||||
|
auto val = Pop();
|
||||||
|
|
||||||
|
SetVariable(name, val);
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::NEW_TABLE: PushTable(std::make_shared<DlangTable>()); break;
|
||||||
|
|
||||||
|
case Opcodes::SET_FIELD: {
|
||||||
|
std::string key = GetString(bytecode, ip);
|
||||||
|
SetField(key);
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::GET_FIELD: {
|
||||||
|
std::string key = GetString(bytecode, ip);
|
||||||
|
stack.push(
|
||||||
|
GetField(key)
|
||||||
|
);
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::KEYS: stack.push(GetTableKeys()); break;
|
||||||
|
|
||||||
|
case Opcodes::NEW_LIST: PushList(std::make_shared<DlangList>()); break;
|
||||||
|
case Opcodes::PUSH_LIST: PushListIndex(); break;
|
||||||
|
case Opcodes::SET_INDEX: SetListIndex(); break;
|
||||||
|
case Opcodes::GET_INDEX: stack.push(GetListIndex()); break;
|
||||||
|
|
||||||
|
case Opcodes::SIZE: PushNumber(GetSize()); break;
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
|
#pragma region VM MATH OPCODES
|
||||||
|
case Opcodes::ADD: {
|
||||||
|
auto b = stack.pop();
|
||||||
|
auto a = stack.pop();
|
||||||
|
|
||||||
|
if ((a.type != StackValueType::Int || b.type != StackValueType::Int) &&
|
||||||
|
(a.type != StackValueType::String && b.type != StackValueType::String))
|
||||||
|
throw std::runtime_error("ADD Operation error, not all variables are integer or strings!");
|
||||||
|
|
||||||
|
bool fullInt = (a.type == StackValueType::Int && b.type == StackValueType::Int);
|
||||||
|
|
||||||
|
if (fullInt)
|
||||||
|
stack.push(StackValue(StackValueType::Int,
|
||||||
|
std::get<double>(a.data) +
|
||||||
|
std::get<double>(b.data)
|
||||||
|
));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::string content;
|
||||||
|
if (a.type == StackValueType::Int)
|
||||||
|
content += DoubleToString(std::get<double>(a.data));
|
||||||
|
else
|
||||||
|
content += std::get<std::string>(a.data);
|
||||||
|
|
||||||
|
if (b.type == StackValueType::Int)
|
||||||
|
content += DoubleToString(std::get<double>(b.data));
|
||||||
|
else
|
||||||
|
content += std::get<std::string>(b.data);
|
||||||
|
|
||||||
|
stack.push(StackValue(StackValueType::String, content));
|
||||||
|
}
|
||||||
|
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::SUB: {
|
||||||
|
auto b = stack.pop();
|
||||||
|
auto a = stack.pop();
|
||||||
|
|
||||||
|
if (a.type != StackValueType::Int || b.type != StackValueType::Int)
|
||||||
|
throw std::runtime_error("SUB Operation error, not all variables are integer!");
|
||||||
|
|
||||||
|
stack.push(StackValue(StackValueType::Int,
|
||||||
|
std::get<double>(a.data) -
|
||||||
|
std::get<double>(b.data)
|
||||||
|
));
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::MUL: {
|
||||||
|
auto b = stack.pop();
|
||||||
|
auto a = stack.pop();
|
||||||
|
|
||||||
|
if (a.type != StackValueType::Int || b.type != StackValueType::Int)
|
||||||
|
throw std::runtime_error("ADD Operation error, not all variables are integer!");
|
||||||
|
|
||||||
|
stack.push(StackValue(StackValueType::Int,
|
||||||
|
std::get<double>(a.data) *
|
||||||
|
std::get<double>(b.data)
|
||||||
|
));
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::DIV: {
|
||||||
|
auto b = stack.pop();
|
||||||
|
auto a = stack.pop();
|
||||||
|
|
||||||
|
if (a.type != StackValueType::Int || b.type != StackValueType::Int)
|
||||||
|
throw std::runtime_error("ADD Operation error, not all variables are integer!");
|
||||||
|
|
||||||
|
stack.push(StackValue(StackValueType::Int,
|
||||||
|
std::get<double>(a.data) /
|
||||||
|
std::get<double>(b.data)
|
||||||
|
));
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::GREATER_THAN: {
|
||||||
|
auto b = stack.pop();
|
||||||
|
auto a = stack.pop();
|
||||||
|
|
||||||
|
if (a.type != StackValueType::Int || b.type != StackValueType::Int)
|
||||||
|
throw std::runtime_error("GREATHER_THAN Operation error, not all variables are integer!");
|
||||||
|
|
||||||
|
stack.push(StackValue(StackValueType::Bool,
|
||||||
|
std::get<double>(a.data) >
|
||||||
|
std::get<double>(b.data)
|
||||||
|
));
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::LESS_THAN: {
|
||||||
|
auto b = stack.pop();
|
||||||
|
auto a = stack.pop();
|
||||||
|
|
||||||
|
if (a.type != StackValueType::Int || b.type != StackValueType::Int)
|
||||||
|
throw std::runtime_error("LESS_THAN Operation error, not all variables are integer!");
|
||||||
|
|
||||||
|
stack.push(StackValue(StackValueType::Bool,
|
||||||
|
std::get<double>(a.data) <
|
||||||
|
std::get<double>(b.data)
|
||||||
|
));
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::CMP: {
|
||||||
|
auto b = stack.pop();
|
||||||
|
auto a = stack.pop();
|
||||||
|
|
||||||
|
if (a.type != StackValueType::Int || b.type != StackValueType::Int)
|
||||||
|
throw std::runtime_error("LESS_THAN Operation error, not all variables are integer!");
|
||||||
|
|
||||||
|
stack.push(StackValue(StackValueType::Bool,
|
||||||
|
std::get<double>(a.data) ==
|
||||||
|
std::get<double>(b.data)
|
||||||
|
));
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::GTE: {
|
||||||
|
auto b = stack.pop();
|
||||||
|
auto a = stack.pop();
|
||||||
|
|
||||||
|
StackValue result;
|
||||||
|
result.type = StackValueType::Bool;
|
||||||
|
|
||||||
|
if (a.type == StackValueType::Int && b.type == StackValueType::Int) {
|
||||||
|
result.data = (std::get<double>(a.data) >= std::get<double>(b.data));
|
||||||
|
}
|
||||||
|
|
||||||
|
stack.push(result);
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::LTE: {
|
||||||
|
auto b = stack.pop();
|
||||||
|
auto a = stack.pop();
|
||||||
|
|
||||||
|
StackValue result;
|
||||||
|
result.type = StackValueType::Bool;
|
||||||
|
|
||||||
|
if (a.type == StackValueType::Int && b.type == StackValueType::Int) {
|
||||||
|
result.data = (std::get<double>(a.data) <= std::get<double>(b.data));
|
||||||
|
}
|
||||||
|
|
||||||
|
stack.push(result);
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::AND: {
|
||||||
|
auto b = stack.pop();
|
||||||
|
auto a = stack.pop();
|
||||||
|
|
||||||
|
StackValue result;
|
||||||
|
result.type = StackValueType::Bool;
|
||||||
|
|
||||||
|
if (a.type == StackValueType::Bool && b.type == StackValueType::Bool) {
|
||||||
|
bool lVal = std::get<bool>(a.data);
|
||||||
|
bool rVal = std::get<bool>(b.data);
|
||||||
|
result.data = (lVal && rVal);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw std::runtime_error("Logical AND (&&) requires boolean operands!");
|
||||||
|
}
|
||||||
|
|
||||||
|
stack.push(result);
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::OR: {
|
||||||
|
auto b = stack.pop();
|
||||||
|
auto a = stack.pop();
|
||||||
|
|
||||||
|
StackValue result;
|
||||||
|
result.type = StackValueType::Bool;
|
||||||
|
|
||||||
|
if (a.type == StackValueType::Bool && b.type == StackValueType::Bool) {
|
||||||
|
bool lVal = std::get<bool>(a.data);
|
||||||
|
bool rVal = std::get<bool>(b.data);
|
||||||
|
result.data = (lVal || rVal);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw std::runtime_error("Logical OR (||) requires boolean operands!");
|
||||||
|
}
|
||||||
|
|
||||||
|
stack.push(result);
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::NTE: {
|
||||||
|
auto b = stack.pop();
|
||||||
|
auto a = stack.pop();
|
||||||
|
|
||||||
|
StackValue result;
|
||||||
|
result.type = StackValueType::Bool;
|
||||||
|
|
||||||
|
if (a.type == StackValueType::Int && b.type == StackValueType::Int) {
|
||||||
|
result.data = (std::get<double>(a.data) != std::get<double>(b.data));
|
||||||
|
}
|
||||||
|
|
||||||
|
stack.push(result);
|
||||||
|
} break;
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
|
#pragma region LOGIC OPCODES
|
||||||
|
case Opcodes::CALL: {
|
||||||
|
auto argCount = bytecode[ip++];
|
||||||
|
|
||||||
|
auto func = stack.pop();
|
||||||
|
if (func.type != StackValueType::Function)
|
||||||
|
throw std::runtime_error("Ohno, missing a function on the stack for call!");
|
||||||
|
|
||||||
|
auto function = std::get<std::shared_ptr<DlangFunction>>(func.data);
|
||||||
|
|
||||||
|
if (function->isNative)
|
||||||
|
function->nativeFunction(this);
|
||||||
|
else {
|
||||||
|
CallFrame newFrame;
|
||||||
|
newFrame.returnIp = ip;
|
||||||
|
newFrame.previousBytecode = bytecode;
|
||||||
|
|
||||||
|
for (double i = (argCount - 1); i >= 0; --i)
|
||||||
|
newFrame.locals.Set(function->parameters[i], stack.pop());
|
||||||
|
|
||||||
|
_callStack.push(newFrame);
|
||||||
|
|
||||||
|
bytecode = function->bytecodeChunk;
|
||||||
|
ip = 0;
|
||||||
|
}
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::RET: {
|
||||||
|
if (_callStack.top() <= 0)
|
||||||
|
return; // End because return was called in global file
|
||||||
|
|
||||||
|
StackValue returnValue;
|
||||||
|
bool assigned = false;
|
||||||
|
if (stack.top() > 0)
|
||||||
|
{
|
||||||
|
returnValue = stack.pop();
|
||||||
|
assigned = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
CallFrame oldFrame = _callStack.pop();
|
||||||
|
|
||||||
|
ip = oldFrame.returnIp;
|
||||||
|
bytecode = oldFrame.previousBytecode;
|
||||||
|
|
||||||
|
if (assigned)
|
||||||
|
stack.push(returnValue);
|
||||||
|
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::FUNC_DEF: {
|
||||||
|
auto name = GetString(bytecode, ip);
|
||||||
|
auto paramCount = bytecode[ip++];
|
||||||
|
|
||||||
|
std::vector<std::string> parameters;
|
||||||
|
for (double i = 0; i < paramCount; ++i)
|
||||||
|
parameters.push_back(GetString(bytecode, ip));
|
||||||
|
|
||||||
|
double bodyStart = bytecode[ip++];
|
||||||
|
double bodyEnd = bytecode[ip++];
|
||||||
|
|
||||||
|
std::vector<double> funcChunk(
|
||||||
|
bytecode.begin() + static_cast<size_t>(bodyStart),
|
||||||
|
bytecode.begin() + static_cast<size_t>(bodyEnd)
|
||||||
|
);
|
||||||
|
|
||||||
|
auto funcObj = std::make_shared<DlangFunction>();
|
||||||
|
funcObj->isNative = false;
|
||||||
|
funcObj->parameters = parameters;
|
||||||
|
funcObj->bytecodeChunk = std::move(funcChunk);
|
||||||
|
|
||||||
|
StackValue v;
|
||||||
|
v.type = StackValueType::Function;
|
||||||
|
v.data = funcObj;
|
||||||
|
|
||||||
|
if (!name.empty())
|
||||||
|
globals.Set(name, v);
|
||||||
|
else
|
||||||
|
stack.push(v);
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::JZ: {
|
||||||
|
double targetAddress = bytecode[ip++];
|
||||||
|
auto val = stack.pop();
|
||||||
|
bool isFalse = false;
|
||||||
|
|
||||||
|
std::visit([&isFalse](auto&& arg) {
|
||||||
|
using T = std::decay_t<decltype(arg)>;
|
||||||
|
if constexpr (std::is_same_v<T, bool>) {
|
||||||
|
isFalse = !arg;
|
||||||
|
}
|
||||||
|
else if constexpr (std::is_same_v<T, double>) {
|
||||||
|
isFalse = (arg == 0);
|
||||||
|
}
|
||||||
|
else throw std::runtime_error("Invalid type for is zero check!");
|
||||||
|
}, val.data);
|
||||||
|
|
||||||
|
if (isFalse)
|
||||||
|
ip = targetAddress;
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case Opcodes::JUMP: {
|
||||||
|
double targetAddress = bytecode[ip++];
|
||||||
|
ip = targetAddress;
|
||||||
|
} break;
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
|
default:
|
||||||
|
printf("Invalid opcode 0x%llX!\n", op);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if DEBUG_MODE == 1
|
||||||
|
auto end = std::chrono::high_resolution_clock::now();
|
||||||
|
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
|
||||||
|
auto durationMicroSeconds = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();
|
||||||
|
|
||||||
|
printf("=================== END ====================\n");
|
||||||
|
printf("VM took %lld ms (%lld microseconds)\n", duration, durationMicroSeconds);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
StackValue DlangVM::Pop()
|
||||||
|
{
|
||||||
|
return stack.pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DlangVM::Pop(double amount)
|
||||||
|
{
|
||||||
|
amount = static_cast<int>(amount);
|
||||||
|
stack.pop(amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DlangVM::PushNumber(double number)
|
||||||
|
{
|
||||||
|
stack.push(
|
||||||
|
StackValue(
|
||||||
|
StackValueType::Int, number
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DlangVM::PushBoolean(bool value)
|
||||||
|
{
|
||||||
|
stack.push(
|
||||||
|
StackValue(
|
||||||
|
StackValueType::Bool, value
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DlangVM::PushString(const std::string& str)
|
||||||
|
{
|
||||||
|
stack.push(
|
||||||
|
StackValue(
|
||||||
|
StackValueType::String, str
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DlangVM::PushVar(const std::string& var)
|
||||||
|
{
|
||||||
|
stack.push(
|
||||||
|
GetVariable(var)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DlangVM::PushCFunction(CFunction func)
|
||||||
|
{
|
||||||
|
StackValue s;
|
||||||
|
s.type = StackValueType::Function;
|
||||||
|
s.data = std::move(DlangFunction::CreateNative(func));
|
||||||
|
stack.push(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DlangVM::CallFunc(double argCount)
|
||||||
|
{
|
||||||
|
auto func = stack.pop();
|
||||||
|
if (func.type != StackValueType::Function)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
auto function = std::get<std::shared_ptr<DlangFunction>>(func.data);
|
||||||
|
if (function->isNative)
|
||||||
|
function->nativeFunction(this);
|
||||||
|
else {
|
||||||
|
|
||||||
|
CallFrame newFrame;
|
||||||
|
|
||||||
|
std::vector<StackValue> providedArgs(argCount);
|
||||||
|
for (int i = argCount - 1; i >= 0; --i) {
|
||||||
|
providedArgs[i] = stack.pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t i = 0; i < function->parameters.size(); ++i) {
|
||||||
|
std::string paramName = function->parameters[i];
|
||||||
|
|
||||||
|
if (i < argCount) {
|
||||||
|
newFrame.locals.Set(paramName, providedArgs[i]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
newFrame.locals.Set(paramName, StackValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_callStack.push(newFrame);
|
||||||
|
|
||||||
|
Execute(function->bytecodeChunk);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DlangVM::PushTable(std::shared_ptr<DlangTable> table)
|
||||||
|
{
|
||||||
|
stack.push(
|
||||||
|
StackValue(
|
||||||
|
StackValueType::Table,
|
||||||
|
table
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DlangVM::SetField(const std::string& key)
|
||||||
|
{
|
||||||
|
auto val = Pop();
|
||||||
|
auto stackTable = Pop();
|
||||||
|
|
||||||
|
if (stackTable.type == StackValueType::Table)
|
||||||
|
{
|
||||||
|
auto table = std::get<std::shared_ptr<DlangTable>>(stackTable.data);
|
||||||
|
table->fields[key] = val;
|
||||||
|
PushTable(table);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StackValue DlangVM::GetField(const std::string& key, bool popTable)
|
||||||
|
{
|
||||||
|
auto stackTable = Pop();
|
||||||
|
|
||||||
|
if (stackTable.type == StackValueType::Table)
|
||||||
|
{
|
||||||
|
auto table = std::get<std::shared_ptr<DlangTable>>(stackTable.data);
|
||||||
|
|
||||||
|
if (!popTable)
|
||||||
|
PushTable(table);
|
||||||
|
|
||||||
|
auto it = table->fields.find(key);
|
||||||
|
if (it == table->fields.end())
|
||||||
|
{
|
||||||
|
printf("[VM Error]: Field '%s' is not found!\n", key.c_str());
|
||||||
|
return StackValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
return it->second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StackValue DlangVM::GetTableKeys()
|
||||||
|
{
|
||||||
|
auto stackTable = Pop();
|
||||||
|
|
||||||
|
if (stackTable.type == StackValueType::Table)
|
||||||
|
{
|
||||||
|
auto table = std::get<std::shared_ptr<DlangTable>>(stackTable.data);
|
||||||
|
auto keyList = std::make_shared<DlangList>();
|
||||||
|
|
||||||
|
for (const auto& [key, _] : table->fields)
|
||||||
|
keyList->values.push_back(
|
||||||
|
StackValue(
|
||||||
|
StackValueType::String,
|
||||||
|
key
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return StackValue(StackValueType::List, std::move(keyList));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
printf("Failed to keys from non table type %s!\n", StackValueTypeToString(stackTable.type).c_str());
|
||||||
|
return StackValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DlangVM::PushList(std::shared_ptr<DlangList> list)
|
||||||
|
{
|
||||||
|
stack.push(
|
||||||
|
StackValue(
|
||||||
|
StackValueType::List,
|
||||||
|
list
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
double DlangVM::PushListIndex()
|
||||||
|
{
|
||||||
|
auto val = Pop();
|
||||||
|
auto stackList = Pop();
|
||||||
|
|
||||||
|
if (stackList.type == StackValueType::List)
|
||||||
|
{
|
||||||
|
auto list = std::get<std::shared_ptr<DlangList>>(stackList.data);
|
||||||
|
list->Push(val);
|
||||||
|
PushList(list);
|
||||||
|
return list->values.size() - 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
printf("Failed to push list index to type '%s'!\n", StackValueTypeToString(stackList.type).c_str());
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DlangVM::SetListIndex()
|
||||||
|
{
|
||||||
|
auto val = Pop();
|
||||||
|
auto stackIndex = Pop();
|
||||||
|
auto stackList = Pop();
|
||||||
|
|
||||||
|
if (stackIndex.type != StackValueType::Int)
|
||||||
|
{
|
||||||
|
printf("Failed to set non number type index %s!\n", StackValueTypeToString(stackIndex.type).c_str());
|
||||||
|
stack.push(StackValue());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stackList.type == StackValueType::List)
|
||||||
|
{
|
||||||
|
auto list = std::get<std::shared_ptr<DlangList>>(stackList.data);
|
||||||
|
auto index = static_cast<int>(std::get<double>(stackIndex.data));
|
||||||
|
list->values[index] = val;
|
||||||
|
stack.push(stackList);
|
||||||
|
}
|
||||||
|
else if (stackList.type == StackValueType::String)
|
||||||
|
{
|
||||||
|
auto& str = std::get<std::string>(stackList.data);
|
||||||
|
auto index = static_cast<int>(std::get<double>(stackIndex.data));
|
||||||
|
|
||||||
|
if (index > 0 && index < str.size())
|
||||||
|
{
|
||||||
|
if (std::holds_alternative<std::string>(val.data)) {
|
||||||
|
str[index] = std::get<std::string>(val.data)[0];
|
||||||
|
}
|
||||||
|
else if (std::holds_alternative<double>(val.data)) {
|
||||||
|
str[index] = static_cast<char>(std::get<double>(val.data));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stack.push(stackList);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
printf("Failed to set index on non list/string type %s!\n", StackValueTypeToString(stackList.type).c_str());
|
||||||
|
stack.push(StackValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StackValue DlangVM::GetListIndex()
|
||||||
|
{
|
||||||
|
auto stackIndex = Pop();
|
||||||
|
auto stackObj = Pop();
|
||||||
|
|
||||||
|
if (stackIndex.type != StackValueType::Int && stackIndex.type != StackValueType::String)
|
||||||
|
{
|
||||||
|
printf("Failed to set non number/string type index %s!\n", StackValueTypeToString(stackIndex.type).c_str());
|
||||||
|
return StackValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stackObj.type == StackValueType::List && stackIndex.type == StackValueType::Int)
|
||||||
|
{
|
||||||
|
auto list = std::get<std::shared_ptr<DlangList>>(stackObj.data);
|
||||||
|
auto index = std::get<double>(stackIndex.data);
|
||||||
|
return list->values[index];
|
||||||
|
} else if (stackObj.type == StackValueType::String && stackIndex.type == StackValueType::Int)
|
||||||
|
{
|
||||||
|
auto str = std::get<std::string>(stackObj.data);
|
||||||
|
auto index = std::get<double>(stackIndex.data);
|
||||||
|
return StackValue(
|
||||||
|
StackValueType::String,
|
||||||
|
str.at(index) + ""
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if (stackObj.type == StackValueType::Table && stackIndex.type == StackValueType::String)
|
||||||
|
{
|
||||||
|
auto table = std::get<std::shared_ptr<DlangTable>>(stackObj.data);
|
||||||
|
auto key = std::get<std::string>(stackIndex.data);
|
||||||
|
|
||||||
|
auto it = table->fields.find(key);
|
||||||
|
if (it != table->fields.end())
|
||||||
|
return it->second;
|
||||||
|
|
||||||
|
|
||||||
|
return StackValue();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
printf("Invalid type to index %s!\n", StackValueTypeToString(stackObj.type).c_str());
|
||||||
|
return StackValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
double DlangVM::GetSize()
|
||||||
|
{
|
||||||
|
auto stackObj = Pop();
|
||||||
|
|
||||||
|
if (stackObj.type == StackValueType::Table)
|
||||||
|
{
|
||||||
|
auto table = std::get<std::shared_ptr<DlangTable>>(stackObj.data);
|
||||||
|
return table->fields.size();
|
||||||
|
}
|
||||||
|
else if (stackObj.type == StackValueType::List)
|
||||||
|
{
|
||||||
|
auto list = std::get<std::shared_ptr<DlangList>>(stackObj.data);
|
||||||
|
return list->values.size();
|
||||||
|
}
|
||||||
|
else if (stackObj.type == StackValueType::String)
|
||||||
|
{
|
||||||
|
auto str = std::get<std::string>(stackObj.data);
|
||||||
|
return str.size();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
printf("Cant get size of type %s!\n", StackValueTypeToString(stackObj.type).c_str());
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DlangVM::DlangVM()
|
||||||
|
{
|
||||||
|
auto ver = getLatestVersion("downloads.dlang.eu", "/latest.txt");
|
||||||
|
if (ver != VERSION && VERSION != "{DEVBUILD}")
|
||||||
|
printf("[WARNING]: YOU ARE RUNNING AN OUTDATED VERSION OF DLANG!\n");
|
||||||
|
|
||||||
|
if (!pluginManager)
|
||||||
|
pluginManager = new ModuleManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DlangVM::RunString(const std::string& code, std::vector<double>* extract)
|
||||||
|
{
|
||||||
|
Lexer lexer;
|
||||||
|
lexer.Parse(code);
|
||||||
|
lexer.ParseOrganizedTokens();
|
||||||
|
auto parsedTokens = lexer.GetOrganizedTokens();
|
||||||
|
|
||||||
|
#if DEBUG_MODE == 1
|
||||||
|
for (const auto& token : parsedTokens)
|
||||||
|
printf("[%s]:\t\t%s\n", TokenTypeToString(token.type), token.value.c_str());
|
||||||
|
|
||||||
|
printf("=================================================\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Parser parser(parsedTokens);
|
||||||
|
auto program = parser.ParseProgram();
|
||||||
|
|
||||||
|
#if DEBUG_MODE == 1
|
||||||
|
for (const auto& statement : program.statements)
|
||||||
|
statement->Print();
|
||||||
|
|
||||||
|
printf("=================================================\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Compiler compiler(&program);
|
||||||
|
compiler.Compile();
|
||||||
|
|
||||||
|
#if DEBUG_MODE == 1
|
||||||
|
compiler.Print();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (extract)
|
||||||
|
*extract = compiler.GetBytecode();
|
||||||
|
else
|
||||||
|
RunBytecode(compiler.GetBytecode());
|
||||||
|
}
|
||||||
|
|
||||||
|
void DlangVM::RunFile(const std::string& fileName, std::vector<double>* extract)
|
||||||
|
{
|
||||||
|
if (!std::filesystem::exists(fileName))
|
||||||
|
throw std::runtime_error("File '" + fileName + "' does not exist!");
|
||||||
|
|
||||||
|
std::ifstream file(fileName, std::ios::in | std::ios::binary | std::ios::ate);
|
||||||
|
if (!file.is_open())
|
||||||
|
throw std::runtime_error("Failed to open file '" + fileName + "'!");
|
||||||
|
|
||||||
|
std::streamsize size = file.tellg();
|
||||||
|
file.seekg(0, std::ios::beg);
|
||||||
|
|
||||||
|
std::string content;
|
||||||
|
content.resize(size);
|
||||||
|
|
||||||
|
if (!file.read(&content[0], size))
|
||||||
|
throw std::runtime_error("Failed to read file '" + fileName + "', possibly corrupt?");
|
||||||
|
|
||||||
|
RunString(content, extract);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DlangVM::RunBinaryFile(const std::string& fileName)
|
||||||
|
{
|
||||||
|
if (!std::filesystem::exists(fileName))
|
||||||
|
throw std::runtime_error("File '" + fileName + "' does not exist!");
|
||||||
|
|
||||||
|
std::ifstream file(fileName, std::ios::binary | std::ios::ate);
|
||||||
|
if (!file.is_open())
|
||||||
|
throw std::runtime_error("Failed to open file '" + fileName + "'!");
|
||||||
|
|
||||||
|
std::streamsize size = file.tellg();
|
||||||
|
file.seekg(0, std::ios::beg);
|
||||||
|
|
||||||
|
std::vector<double> bytecode(size / sizeof(double));
|
||||||
|
if (file.read(reinterpret_cast<char*>(bytecode.data()), size)) {
|
||||||
|
RunBytecode(bytecode);
|
||||||
|
}
|
||||||
|
else throw std::runtime_error("Failed to read binary dlang file!");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<double> DlangVM::ParseHeader(const std::vector<double>& bytecode)
|
||||||
|
{
|
||||||
|
if (bytecode.size() < 3)
|
||||||
|
throw std::runtime_error("Bytecode too short!");
|
||||||
|
|
||||||
|
size_t ip = 0;
|
||||||
|
|
||||||
|
if (bytecode[ip++] != 0xFF ||
|
||||||
|
bytecode[ip++] != 0x8C ||
|
||||||
|
bytecode[ip++] != 0xFF)
|
||||||
|
throw std::runtime_error("Failed to load dlang header from bytecode!");
|
||||||
|
|
||||||
|
size_t stringTableSize = static_cast<size_t>(bytecode[ip++]);
|
||||||
|
|
||||||
|
for (size_t i = 0; i < stringTableSize; ++i)
|
||||||
|
strings.push(GetRealString(bytecode, ip));
|
||||||
|
|
||||||
|
std::vector<double> instructions(bytecode.begin() + ip, bytecode.end());
|
||||||
|
|
||||||
|
return instructions;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DlangVM::RunBytecode(const std::vector<double>& bytecode)
|
||||||
|
{
|
||||||
|
auto instructions = ParseHeader(bytecode);
|
||||||
|
Execute(instructions);
|
||||||
|
}
|
||||||
|
|
||||||
|
StackValue DlangVM::GetVariable(const std::string& name)
|
||||||
|
{
|
||||||
|
if (_callStack.top() > 0)
|
||||||
|
{
|
||||||
|
auto& currentFrame = _callStack.peek();
|
||||||
|
auto local = currentFrame.locals.Get(name);
|
||||||
|
if (local.type != StackValueType::NIL)
|
||||||
|
return local;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto glob = globals.Get(name);
|
||||||
|
if (glob.type != StackValueType::NIL)
|
||||||
|
return glob;
|
||||||
|
|
||||||
|
return StackValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DlangVM::SetVariable(const std::string& name, StackValue value)
|
||||||
|
{
|
||||||
|
bool updated = false;
|
||||||
|
|
||||||
|
if (_callStack.top() > 0)
|
||||||
|
{
|
||||||
|
auto& currentFrame = _callStack.peek();
|
||||||
|
auto local = currentFrame.locals.Get(name);
|
||||||
|
if (local.type != StackValueType::NIL)
|
||||||
|
{
|
||||||
|
currentFrame.locals.Set(name, value);
|
||||||
|
updated = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!updated)
|
||||||
|
{
|
||||||
|
auto glob = globals.Get(name);
|
||||||
|
if (glob.type != StackValueType::NIL)
|
||||||
|
{
|
||||||
|
globals.Set(name, value);
|
||||||
|
updated = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!updated)
|
||||||
|
{
|
||||||
|
if (_callStack.top() > 0)
|
||||||
|
{
|
||||||
|
_callStack.peek().locals.Set(name, value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
globals.Set(name, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
#ifndef DLANG_TYPES_INCLUDE_HPP
|
||||||
|
#define DLANG_TYPES_INCLUDE_HPP
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <variant>
|
||||||
|
#include <unordered_map>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
class DlangTable;
|
||||||
|
class DlangList;
|
||||||
|
struct DlangFunction;
|
||||||
|
|
||||||
|
using VMDataTypes = std::variant<double, bool, std::string, std::shared_ptr<DlangTable>, std::shared_ptr<DlangFunction>, std::shared_ptr<DlangList>>;
|
||||||
|
using CFunction = void(*)(class DlangVM* vm);
|
||||||
|
|
||||||
|
#define TOKEN_TYPES \
|
||||||
|
X(UNIDENTIFIED) \
|
||||||
|
X(KEYWORD) \
|
||||||
|
X(SYNTAX) \
|
||||||
|
X(IDENTIFIER) \
|
||||||
|
X(NUMBER) \
|
||||||
|
X(BOOLEAN) \
|
||||||
|
X(STRING) \
|
||||||
|
X(MATH_IDENT)
|
||||||
|
|
||||||
|
#define OPCODE_TYPES \
|
||||||
|
X(EOC, 0x100) \
|
||||||
|
X(PUSH_INT, 0x101) \
|
||||||
|
X(PUSH_BOOL, 0x102) \
|
||||||
|
X(PUSH_STRING, 0x103) \
|
||||||
|
X(PUSH_VAR, 0x104) \
|
||||||
|
X(DEFINE_VAR, 0x105) \
|
||||||
|
X(STORE_VAR, 0x106) \
|
||||||
|
X(ADD, 0x107) \
|
||||||
|
X(SUB, 0x108) \
|
||||||
|
X(MUL, 0x109) \
|
||||||
|
X(DIV, 0x10A) \
|
||||||
|
X(CALL, 0x10B) \
|
||||||
|
X(JZ, 0x10C) \
|
||||||
|
X(JUMP, 0x10D) \
|
||||||
|
X(GREATER_THAN, 0x10E) \
|
||||||
|
X(LESS_THAN, 0x10F) \
|
||||||
|
X(FUNC_DEF, 0x11A) \
|
||||||
|
X(RET, 0x11B) \
|
||||||
|
X(NEW_TABLE, 0x11C) \
|
||||||
|
X(GET_FIELD, 0x11D) \
|
||||||
|
X(SET_FIELD, 0x11E) \
|
||||||
|
X(POP, 0x11F) \
|
||||||
|
X(CMP, 0x12A) \
|
||||||
|
X(GTE, 0x12B) \
|
||||||
|
X(LTE, 0x12C) \
|
||||||
|
X(AND, 0x12D) \
|
||||||
|
X(OR, 0x12E) \
|
||||||
|
X(PUSH_FUNC, 0x12F) \
|
||||||
|
X(NTE, 0x13A) \
|
||||||
|
X(NEW_LIST, 0x13B) \
|
||||||
|
X(PUSH_LIST, 0x13C) \
|
||||||
|
X(GET_INDEX, 0x13D) \
|
||||||
|
X(SET_INDEX, 0x13E) \
|
||||||
|
X(SIZE, 0x13F) \
|
||||||
|
X(KEYS, 0x14A)
|
||||||
|
|
||||||
|
#include "token.hpp"
|
||||||
|
#include "opcodes.hpp"
|
||||||
|
#include "stack_value.hpp"
|
||||||
|
#include "stack.hpp"
|
||||||
|
#include "list.hpp"
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
#ifndef DLANG_TYPES_LIST_HPP
|
||||||
|
#define DLANG_TYPES_LIST_HPP
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
template<typename type>
|
||||||
|
class List
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
type* _list = nullptr;
|
||||||
|
size_t _size = 0;
|
||||||
|
size_t _capacity = 0;
|
||||||
|
|
||||||
|
void grow()
|
||||||
|
{
|
||||||
|
size_t newCapacity = (_capacity == 0) ? 50 : _capacity + 50;
|
||||||
|
type* newList = new type[newCapacity];
|
||||||
|
|
||||||
|
for (size_t i = 0; i < _size; ++i)
|
||||||
|
newList[i] = _list[i];
|
||||||
|
|
||||||
|
delete[] _list;
|
||||||
|
|
||||||
|
_list = newList;
|
||||||
|
_capacity = newCapacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
List() = default;
|
||||||
|
|
||||||
|
List(const List& other)
|
||||||
|
{
|
||||||
|
_size = other._size;
|
||||||
|
_capacity = other._capacity;
|
||||||
|
if (_capacity > 0)
|
||||||
|
{
|
||||||
|
_list = new type[_capacity];
|
||||||
|
for (size_t i = 0; i < _size; ++i)
|
||||||
|
_list[i] = other._list[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List& operator=(const List& other)
|
||||||
|
{
|
||||||
|
if (this == &other)
|
||||||
|
return *this;
|
||||||
|
|
||||||
|
delete[] _list;
|
||||||
|
_list = nullptr;
|
||||||
|
_size = other._size;
|
||||||
|
_capacity = other._capacity;
|
||||||
|
|
||||||
|
if (_capacity > 0)
|
||||||
|
{
|
||||||
|
_list = new type[_capacity];
|
||||||
|
for (size_t i = 0; i < _size; ++i)
|
||||||
|
_list[i] = other._list[i];
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
~List()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
delete[] _list;
|
||||||
|
}
|
||||||
|
catch (...) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
int push(type val)
|
||||||
|
{
|
||||||
|
if (_size >= _capacity)
|
||||||
|
grow();
|
||||||
|
|
||||||
|
_list[_size] = val;
|
||||||
|
return static_cast<int>(_size++);
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t size() const { return _size; }
|
||||||
|
size_t capacity() const { return _capacity; }
|
||||||
|
|
||||||
|
type& operator[](size_t index)
|
||||||
|
{
|
||||||
|
return _list[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Contains(type t) const
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < _size; ++i)
|
||||||
|
if (_list[i] == t)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetOrSet(type value)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < _size; ++i)
|
||||||
|
if (_list[i] == value)
|
||||||
|
return i;
|
||||||
|
|
||||||
|
return push(value);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename type>
|
||||||
|
class NamedList
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
struct DataType
|
||||||
|
{
|
||||||
|
type data;
|
||||||
|
std::string name;
|
||||||
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
|
List<DataType> _list;
|
||||||
|
|
||||||
|
public:
|
||||||
|
void Set(const std::string& name, type t)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < _list.size(); i++)
|
||||||
|
{
|
||||||
|
if (_list[i].name == name)
|
||||||
|
{
|
||||||
|
_list[i].data = t;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DataType dt;
|
||||||
|
dt.name = name;
|
||||||
|
dt.data = t;
|
||||||
|
_list.push(dt);
|
||||||
|
}
|
||||||
|
|
||||||
|
type Get(const std::string& name)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < _list.size(); i++)
|
||||||
|
{
|
||||||
|
if (_list[i].name == name)
|
||||||
|
return _list[i].data;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
type Get(int index)
|
||||||
|
{
|
||||||
|
if (index >= _list.size())
|
||||||
|
return {};
|
||||||
|
|
||||||
|
return _list[index].data;
|
||||||
|
}
|
||||||
|
|
||||||
|
int top()
|
||||||
|
{
|
||||||
|
return _list.size();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
#ifndef DLANG_TYPES_OPCODES_HPP
|
||||||
|
#define DLANG_TYPES_OPCODES_HPP
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <variant>
|
||||||
|
#include <unordered_map>
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
enum class Opcodes : int64_t {
|
||||||
|
#define X(name, val) name = val,
|
||||||
|
OPCODE_TYPES
|
||||||
|
#undef X
|
||||||
|
};
|
||||||
|
|
||||||
|
constexpr const char* OpcodeToString(Opcodes type)
|
||||||
|
{
|
||||||
|
switch (type) {
|
||||||
|
#define X(name, val) case Opcodes::name: return #name;
|
||||||
|
OPCODE_TYPES
|
||||||
|
#undef X
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
#ifndef DLANG_TYPES_STACK_HPP
|
||||||
|
#define DLANG_TYPES_STACK_HPP
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <variant>
|
||||||
|
#include "list.hpp"
|
||||||
|
|
||||||
|
template<typename type, int size>
|
||||||
|
class Stack
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
int _top = 0;
|
||||||
|
type _stack[size];
|
||||||
|
|
||||||
|
public:
|
||||||
|
void push(type t)
|
||||||
|
{
|
||||||
|
if (_top >= size)
|
||||||
|
throw std::runtime_error("Stack tried to go over the stack limit!");
|
||||||
|
|
||||||
|
_stack[_top++] = t;
|
||||||
|
}
|
||||||
|
|
||||||
|
type pop()
|
||||||
|
{
|
||||||
|
if (_top <= 0)
|
||||||
|
return type();
|
||||||
|
|
||||||
|
return _stack[--_top];
|
||||||
|
}
|
||||||
|
|
||||||
|
void pop(int amount)
|
||||||
|
{
|
||||||
|
if ((_top - amount) < 0)
|
||||||
|
throw std::runtime_error("Stack underflow, attempted to pop more items than available on the stack!");
|
||||||
|
|
||||||
|
_top -= amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
type& peek()
|
||||||
|
{
|
||||||
|
if (_top <= 0)
|
||||||
|
{
|
||||||
|
static type empty = {};
|
||||||
|
return empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _stack[_top - 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
int top() { return _top; }
|
||||||
|
int max() const { return size; }
|
||||||
|
|
||||||
|
type operator[](int index)
|
||||||
|
{
|
||||||
|
return _stack[index];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CallFrame
|
||||||
|
{
|
||||||
|
size_t returnIp;
|
||||||
|
std::vector<double> previousBytecode;
|
||||||
|
NamedList<StackValue> locals;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
#ifndef DLANG_TYPES_STACK_VALUE_HPP
|
||||||
|
#define DLANG_TYPES_STACK_VALUE_HPP
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <variant>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
|
enum class StackValueType
|
||||||
|
{
|
||||||
|
NIL,
|
||||||
|
Int,
|
||||||
|
Bool,
|
||||||
|
String,
|
||||||
|
Table,
|
||||||
|
Function,
|
||||||
|
List
|
||||||
|
};
|
||||||
|
|
||||||
|
static std::string StackValueTypeToString(StackValueType type)
|
||||||
|
{
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case StackValueType::NIL: return "NIL"; break;
|
||||||
|
case StackValueType::Int: return "Int"; break;
|
||||||
|
case StackValueType::Bool: return "Bool"; break;
|
||||||
|
case StackValueType::String: return "String"; break;
|
||||||
|
case StackValueType::Table: return "Table"; break;
|
||||||
|
case StackValueType::Function: return "Function"; break;
|
||||||
|
case StackValueType::List: return "List"; break;
|
||||||
|
default: return "Unknown"; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct StackValue
|
||||||
|
{
|
||||||
|
StackValueType type;
|
||||||
|
VMDataTypes data;
|
||||||
|
|
||||||
|
StackValue() { this->type = StackValueType::NIL; };
|
||||||
|
StackValue(StackValueType _type, VMDataTypes _data)
|
||||||
|
{
|
||||||
|
this->type = _type;
|
||||||
|
this->data = std::move(_data);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct DlangFunction
|
||||||
|
{
|
||||||
|
double bodyAddress;
|
||||||
|
std::vector<std::string> parameters;
|
||||||
|
std::vector<double> bytecodeChunk;
|
||||||
|
|
||||||
|
bool isNative;
|
||||||
|
CFunction nativeFunction;
|
||||||
|
|
||||||
|
static std::shared_ptr<DlangFunction> CreateNative(CFunction function)
|
||||||
|
{
|
||||||
|
auto func = std::make_shared<DlangFunction>();
|
||||||
|
func->isNative = true;
|
||||||
|
func->nativeFunction = function;
|
||||||
|
return func;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::shared_ptr<DlangFunction> CreateInternal(const std::string& name, double bodyAddy, std::vector<std::string> params)
|
||||||
|
{
|
||||||
|
auto func = std::make_shared<DlangFunction>();
|
||||||
|
func->bodyAddress = bodyAddy;
|
||||||
|
func->parameters = params;
|
||||||
|
func->isNative = false;
|
||||||
|
return func;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class DlangTable
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
std::unordered_map<std::string, StackValue> fields;
|
||||||
|
|
||||||
|
void Set(const std::string& key, StackValue val)
|
||||||
|
{
|
||||||
|
fields[key] = val;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Get(const std::string& key, StackValue& outVal)
|
||||||
|
{
|
||||||
|
auto it = fields.find(key);
|
||||||
|
if (it != fields.end())
|
||||||
|
{
|
||||||
|
outVal = it->second;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class DlangList
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
std::vector<StackValue> values;
|
||||||
|
|
||||||
|
void Push(StackValue val)
|
||||||
|
{
|
||||||
|
values.push_back(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
StackValue Get(int index)
|
||||||
|
{
|
||||||
|
if (index > values.size())
|
||||||
|
return StackValue(); // push nil
|
||||||
|
|
||||||
|
return values.at(index);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
#ifndef DLANG_TYPES_TOKEN_HPP
|
||||||
|
#define DLANG_TYPES_TOKEN_HPP
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <variant>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
|
enum class TokenType : int {
|
||||||
|
#define X(name) name,
|
||||||
|
TOKEN_TYPES
|
||||||
|
#undef X
|
||||||
|
};
|
||||||
|
|
||||||
|
constexpr const char* TokenTypeToString(TokenType type)
|
||||||
|
{
|
||||||
|
switch (type) {
|
||||||
|
#define X(name) case TokenType::name: return #name;
|
||||||
|
TOKEN_TYPES
|
||||||
|
#undef X
|
||||||
|
}
|
||||||
|
return "unknown";
|
||||||
|
}
|
||||||
|
|
||||||
|
struct PreToken
|
||||||
|
{
|
||||||
|
std::string value;
|
||||||
|
int line;
|
||||||
|
int column;
|
||||||
|
|
||||||
|
static PreToken CreateEmpty()
|
||||||
|
{
|
||||||
|
PreToken t;
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Token
|
||||||
|
{
|
||||||
|
std::string value;
|
||||||
|
TokenType type;
|
||||||
|
|
||||||
|
int line;
|
||||||
|
int column;
|
||||||
|
|
||||||
|
void Print()
|
||||||
|
{
|
||||||
|
printf("[%d:%d] %s: %s\n", line, column, TokenTypeToString(type), value.c_str());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
#ifndef DLANG_VM_HPP
|
||||||
|
#define DLANG_VM_HPP
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
|
#include "lexer.hpp"
|
||||||
|
#include "parser.hpp"
|
||||||
|
#include "compiler.hpp"
|
||||||
|
#include "plugins.hpp"
|
||||||
|
|
||||||
|
inline ModuleManager* pluginManager = nullptr;
|
||||||
|
|
||||||
|
#define DEBUG_MODE 1
|
||||||
|
#define VERSION "{DEVBUILD}"
|
||||||
|
|
||||||
|
using ByteCodeArray = std::vector<double>;
|
||||||
|
|
||||||
|
class DlangVM
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Stack<StackValue, 25> stack;
|
||||||
|
NamedList<StackValue> globals;
|
||||||
|
List<std::string> strings;
|
||||||
|
List<std::string> loadedPlugins;
|
||||||
|
private:
|
||||||
|
Stack<CallFrame, 25> _callStack;
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::string GetString(const ByteCodeArray& bytecode, size_t& ip);
|
||||||
|
std::string GetRealString(const ByteCodeArray& bytecode, size_t& ip);
|
||||||
|
void Execute(std::vector<double> bytecode);
|
||||||
|
|
||||||
|
public:
|
||||||
|
StackValue Pop();
|
||||||
|
void Pop(double amount);
|
||||||
|
|
||||||
|
void PushNumber(double number);
|
||||||
|
void PushBoolean(bool value);
|
||||||
|
void PushString(const std::string& str);
|
||||||
|
void PushVar(const std::string& var);
|
||||||
|
|
||||||
|
void PushCFunction(CFunction func);
|
||||||
|
bool CallFunc(double argCount);
|
||||||
|
|
||||||
|
void PushTable(std::shared_ptr<DlangTable> table);
|
||||||
|
void SetField(const std::string& key);
|
||||||
|
StackValue GetField(const std::string& key, bool popTable = true);
|
||||||
|
StackValue GetTableKeys();
|
||||||
|
|
||||||
|
void PushList(std::shared_ptr<DlangList> list);
|
||||||
|
double PushListIndex();
|
||||||
|
void SetListIndex();
|
||||||
|
StackValue GetListIndex();
|
||||||
|
|
||||||
|
double GetSize(); // Function to get size of List, Table and String
|
||||||
|
|
||||||
|
public:
|
||||||
|
DlangVM();
|
||||||
|
|
||||||
|
void RunString(const std::string& code, ByteCodeArray* extract = nullptr);
|
||||||
|
void RunFile(const std::string& fileName, ByteCodeArray* extract = nullptr);
|
||||||
|
void RunBinaryFile(const std::string& fileName);
|
||||||
|
ByteCodeArray ParseHeader(const ByteCodeArray& bytecode);
|
||||||
|
void RunBytecode(const ByteCodeArray& bytecode);
|
||||||
|
|
||||||
|
public:
|
||||||
|
StackValue GetVariable(const std::string& name);
|
||||||
|
void SetVariable(const std::string& name, StackValue value);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,231 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <unordered_map>
|
||||||
|
#include <thread>
|
||||||
|
#include <mutex>
|
||||||
|
#include <queue>
|
||||||
|
#include <variant>
|
||||||
|
#include <sqlite3.h>
|
||||||
|
#include <dlang.hpp>
|
||||||
|
|
||||||
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
|
#define EXPORT __declspec(dllexport)
|
||||||
|
#else
|
||||||
|
#define EXPORT __attribute__((visibility("default")))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
using SqlValue = std::variant<std::nullptr_t, double, std::string>;
|
||||||
|
using SqlRow = std::unordered_map<std::string, SqlValue>;
|
||||||
|
using SqlQueryResult = std::vector<SqlRow>;
|
||||||
|
|
||||||
|
struct DbResult {
|
||||||
|
bool success;
|
||||||
|
std::string errorMessage;
|
||||||
|
SqlQueryResult rows;
|
||||||
|
int rowsAffected;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct AsyncTask {
|
||||||
|
StackValue callbackVal;
|
||||||
|
DbResult result;
|
||||||
|
};
|
||||||
|
|
||||||
|
static sqlite3* g_db = nullptr;
|
||||||
|
static std::queue<AsyncTask> g_completedTasks;
|
||||||
|
static std::mutex g_queueMutex;
|
||||||
|
|
||||||
|
static DbResult ExecuteQueryInternal(sqlite3* db, const std::string& query) {
|
||||||
|
DbResult res{ true, "", {}, 0 };
|
||||||
|
sqlite3_stmt* stmt = nullptr;
|
||||||
|
|
||||||
|
if (sqlite3_prepare_v2(db, query.c_str(), -1, &stmt, nullptr) != SQLITE_OK) {
|
||||||
|
res.success = false;
|
||||||
|
res.errorMessage = sqlite3_errmsg(db);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
int colCount = sqlite3_column_count(stmt);
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
int stepRes = sqlite3_step(stmt);
|
||||||
|
if (stepRes == SQLITE_ROW) {
|
||||||
|
SqlRow row;
|
||||||
|
for (int i = 0; i < colCount; ++i) {
|
||||||
|
const char* colName = sqlite3_column_name(stmt, i);
|
||||||
|
int type = sqlite3_column_type(stmt, i);
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case SQLITE_INTEGER:
|
||||||
|
row[colName] = static_cast<double>(sqlite3_column_int64(stmt, i));
|
||||||
|
break;
|
||||||
|
case SQLITE_FLOAT:
|
||||||
|
row[colName] = sqlite3_column_double(stmt, i);
|
||||||
|
break;
|
||||||
|
case SQLITE_TEXT:
|
||||||
|
row[colName] = std::string(reinterpret_cast<const char*>(sqlite3_column_text(stmt, i)));
|
||||||
|
break;
|
||||||
|
case SQLITE_NULL:
|
||||||
|
default:
|
||||||
|
row[colName] = nullptr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
res.rows.push_back(row);
|
||||||
|
}
|
||||||
|
else if (stepRes == SQLITE_DONE) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
res.success = false;
|
||||||
|
res.errorMessage = sqlite3_errmsg(db);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
res.rowsAffected = sqlite3_changes(db);
|
||||||
|
sqlite3_finalize(stmt);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void PushDbResultToVM(DlangVM* vm, const DbResult& res) {
|
||||||
|
dlang_newtable(vm);
|
||||||
|
|
||||||
|
dlang_pushboolean(vm, res.success);
|
||||||
|
dlang_setfield(vm, "success");
|
||||||
|
|
||||||
|
if (!res.success) {
|
||||||
|
dlang_pushstring(vm, res.errorMessage.c_str());
|
||||||
|
dlang_setfield(vm, "error");
|
||||||
|
}
|
||||||
|
|
||||||
|
dlang_pushnumber(vm, res.rowsAffected);
|
||||||
|
dlang_setfield(vm, "rowsAffected");
|
||||||
|
|
||||||
|
dlang_newlist(vm);
|
||||||
|
|
||||||
|
for (const auto& row : res.rows) {
|
||||||
|
dlang_newtable(vm);
|
||||||
|
|
||||||
|
for (const auto& [colName, val] : row) {
|
||||||
|
if (std::holds_alternative<double>(val)) {
|
||||||
|
dlang_pushnumber(vm, std::get<double>(val));
|
||||||
|
}
|
||||||
|
else if (std::holds_alternative<std::string>(val)) {
|
||||||
|
dlang_pushstring(vm, std::get<std::string>(val).c_str());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dlang_pushnil(vm);
|
||||||
|
}
|
||||||
|
dlang_setfield(vm, colName.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
dlang_push(vm, dlang_pop(vm));
|
||||||
|
dlang_pushindex(vm);
|
||||||
|
}
|
||||||
|
|
||||||
|
dlang_setfield(vm, "rows");
|
||||||
|
}
|
||||||
|
|
||||||
|
void NativeSqliteOpen(DlangVM* vm) {
|
||||||
|
if (!dlang_isstring(vm)) {
|
||||||
|
dlang_pushboolean(vm, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string dbPath = dlang_tostring(vm);
|
||||||
|
if (g_db) {
|
||||||
|
sqlite3_close(g_db);
|
||||||
|
g_db = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
int rc = sqlite3_open(dbPath.c_str(), &g_db);
|
||||||
|
if (rc == SQLITE_OK) {
|
||||||
|
sqlite3_exec(g_db, "PRAGMA journal_mode = WAL;", nullptr, nullptr, nullptr);
|
||||||
|
sqlite3_exec(g_db, "PRAGMA synchronous = NORMAL;", nullptr, nullptr, nullptr);
|
||||||
|
dlang_pushboolean(vm, true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dlang_pushboolean(vm, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void NativeSqliteQuery(DlangVM* vm) {
|
||||||
|
if (!g_db || !dlang_isstring(vm)) {
|
||||||
|
DbResult err{ false, "Geen DB of ongeldige query", {}, 0 };
|
||||||
|
PushDbResultToVM(vm, err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string query = dlang_tostring(vm);
|
||||||
|
DbResult res = ExecuteQueryInternal(g_db, query);
|
||||||
|
PushDbResultToVM(vm, res);
|
||||||
|
}
|
||||||
|
|
||||||
|
void NativeSqliteQueryAsync(DlangVM* vm) {
|
||||||
|
if (!g_db) return;
|
||||||
|
|
||||||
|
if (!dlang_isstring(vm)) return;
|
||||||
|
std::string query = dlang_tostring(vm);
|
||||||
|
|
||||||
|
if (!dlang_isfunction(vm)) return;
|
||||||
|
StackValue callbackVal = dlang_totoken(vm);
|
||||||
|
|
||||||
|
std::thread([query, callbackVal]() {
|
||||||
|
DbResult res = ExecuteQueryInternal(g_db, query);
|
||||||
|
|
||||||
|
std::lock_guard<std::mutex> lock(g_queueMutex);
|
||||||
|
g_completedTasks.push({ callbackVal, res });
|
||||||
|
}).detach();
|
||||||
|
}
|
||||||
|
|
||||||
|
void NativeSqlitePoll(DlangVM* vm) {
|
||||||
|
std::queue<AsyncTask> localTasks;
|
||||||
|
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(g_queueMutex);
|
||||||
|
localTasks.swap(g_completedTasks);
|
||||||
|
}
|
||||||
|
|
||||||
|
while (!localTasks.empty()) {
|
||||||
|
auto task = localTasks.front();
|
||||||
|
localTasks.pop();
|
||||||
|
|
||||||
|
PushDbResultToVM(vm, task.result);
|
||||||
|
dlang_push(vm, task.callbackVal);
|
||||||
|
dlang_call(vm, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void NativeSqliteClose(DlangVM* vm) {
|
||||||
|
if (g_db) {
|
||||||
|
sqlite3_close(g_db);
|
||||||
|
g_db = nullptr;
|
||||||
|
}
|
||||||
|
dlang_pushboolean(vm, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
EXPORT void initialize(DlangVM* vm) {
|
||||||
|
dlang_newtable(vm);
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeSqliteOpen);
|
||||||
|
dlang_setfield(vm, "open");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeSqliteQuery);
|
||||||
|
dlang_setfield(vm, "query");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeSqliteQueryAsync);
|
||||||
|
dlang_setfield(vm, "query_async");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeSqlitePoll);
|
||||||
|
dlang_setfield(vm, "poll");
|
||||||
|
|
||||||
|
dlang_pushcfunction(vm, NativeSqliteClose);
|
||||||
|
dlang_setfield(vm, "close");
|
||||||
|
|
||||||
|
dlang_setglobal(vm, "sqlite");
|
||||||
|
|
||||||
|
std::cout << ">>> SQLite Module Initialized (Queue-based Async) <<<" << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"requests":[{"kind":"cache","version":2},{"kind":"codemodel","version":2},{"kind":"toolchains","version":1},{"kind":"cmakeFiles","version":1}]}
|
||||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,139 @@
|
|||||||
|
{
|
||||||
|
"configurations" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"abstractTargets" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"directoryIndex" : 1,
|
||||||
|
"id" : "Git::Git::@e307556b105425ba5dcf",
|
||||||
|
"jsonFile" : "target-Git__Git-Release-30094bcb7cf7b16179c7.json",
|
||||||
|
"name" : "Git::Git",
|
||||||
|
"projectIndex" : 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"directories" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"build" : ".",
|
||||||
|
"childIndexes" :
|
||||||
|
[
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"hasInstallRule" : true,
|
||||||
|
"jsonFile" : "directory-.-Release-f040eec181a89de70dbe.json",
|
||||||
|
"minimumCMakeVersion" :
|
||||||
|
{
|
||||||
|
"string" : "3.10"
|
||||||
|
},
|
||||||
|
"projectIndex" : 0,
|
||||||
|
"source" : "."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"abstractTargetIndexes" :
|
||||||
|
[
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"build" : "dlang.sqlite",
|
||||||
|
"childIndexes" :
|
||||||
|
[
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"hasInstallRule" : true,
|
||||||
|
"jsonFile" : "directory-dlang.sqlite-Release-6a15040640e6a0e5bf6f.json",
|
||||||
|
"minimumCMakeVersion" :
|
||||||
|
{
|
||||||
|
"string" : "3.10"
|
||||||
|
},
|
||||||
|
"parentIndex" : 0,
|
||||||
|
"projectIndex" : 0,
|
||||||
|
"source" : "dlang.sqlite",
|
||||||
|
"targetIndexes" :
|
||||||
|
[
|
||||||
|
1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"build" : "_deps/sqlite3-build",
|
||||||
|
"hasInstallRule" : true,
|
||||||
|
"jsonFile" : "directory-_deps.sqlite3-build-Release-db95f9c74aad4cebdd93.json",
|
||||||
|
"minimumCMakeVersion" :
|
||||||
|
{
|
||||||
|
"string" : "3.17"
|
||||||
|
},
|
||||||
|
"parentIndex" : 1,
|
||||||
|
"projectIndex" : 1,
|
||||||
|
"source" : "out/build/x64-release/_deps/sqlite3-src",
|
||||||
|
"targetIndexes" :
|
||||||
|
[
|
||||||
|
0
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name" : "Release",
|
||||||
|
"projects" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"abstractTargetIndexes" :
|
||||||
|
[
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"childIndexes" :
|
||||||
|
[
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"directoryIndexes" :
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"name" : "dlang.sqlite",
|
||||||
|
"targetIndexes" :
|
||||||
|
[
|
||||||
|
1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"directoryIndexes" :
|
||||||
|
[
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"name" : "sqlite3",
|
||||||
|
"parentIndex" : 0,
|
||||||
|
"targetIndexes" :
|
||||||
|
[
|
||||||
|
0
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"targets" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"directoryIndex" : 2,
|
||||||
|
"id" : "SQLite3::@910835d65fa0014a1409",
|
||||||
|
"jsonFile" : "target-SQLite3-Release-3c711d95b0462a71d335.json",
|
||||||
|
"name" : "SQLite3",
|
||||||
|
"projectIndex" : 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"directoryIndex" : 1,
|
||||||
|
"id" : "dlang.sqlite::@e307556b105425ba5dcf",
|
||||||
|
"jsonFile" : "target-dlang.sqlite-Release-ff966cf963c210f8c9ca.json",
|
||||||
|
"name" : "dlang.sqlite",
|
||||||
|
"projectIndex" : 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"kind" : "codemodel",
|
||||||
|
"paths" :
|
||||||
|
{
|
||||||
|
"build" : "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release",
|
||||||
|
"source" : "C:/Users/Damian/Desktop/dlang-sqlite"
|
||||||
|
},
|
||||||
|
"version" :
|
||||||
|
{
|
||||||
|
"major" : 2,
|
||||||
|
"minor" : 10
|
||||||
|
}
|
||||||
|
}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"backtraceGraph" :
|
||||||
|
{
|
||||||
|
"commands" : [],
|
||||||
|
"files" : [],
|
||||||
|
"nodes" : []
|
||||||
|
},
|
||||||
|
"codemodelVersion" :
|
||||||
|
{
|
||||||
|
"major" : 2,
|
||||||
|
"minor" : 10
|
||||||
|
},
|
||||||
|
"installers" : [],
|
||||||
|
"paths" :
|
||||||
|
{
|
||||||
|
"build" : ".",
|
||||||
|
"source" : "."
|
||||||
|
}
|
||||||
|
}
|
||||||
+102
@@ -0,0 +1,102 @@
|
|||||||
|
{
|
||||||
|
"backtraceGraph" :
|
||||||
|
{
|
||||||
|
"commands" :
|
||||||
|
[
|
||||||
|
"install"
|
||||||
|
],
|
||||||
|
"files" :
|
||||||
|
[
|
||||||
|
"out/build/x64-release/_deps/sqlite3-src/CMakeLists.txt"
|
||||||
|
],
|
||||||
|
"nodes" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"file" : 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 0,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 163,
|
||||||
|
"parent" : 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 0,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 171,
|
||||||
|
"parent" : 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 0,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 183,
|
||||||
|
"parent" : 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"codemodelVersion" :
|
||||||
|
{
|
||||||
|
"major" : 2,
|
||||||
|
"minor" : 10
|
||||||
|
},
|
||||||
|
"installers" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"backtrace" : 1,
|
||||||
|
"component" : "Unspecified",
|
||||||
|
"destination" : "lib",
|
||||||
|
"paths" :
|
||||||
|
[
|
||||||
|
"_deps/sqlite3-build/sqlite3.lib"
|
||||||
|
],
|
||||||
|
"targetId" : "SQLite3::@910835d65fa0014a1409",
|
||||||
|
"targetIndex" : 0,
|
||||||
|
"type" : "target"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 1,
|
||||||
|
"component" : "Unspecified",
|
||||||
|
"destination" : "include",
|
||||||
|
"paths" :
|
||||||
|
[
|
||||||
|
"out/build/x64-release/_deps/sqlite3_ext-src/sqlite3.h",
|
||||||
|
"out/build/x64-release/_deps/sqlite3_ext-src/sqlite3ext.h"
|
||||||
|
],
|
||||||
|
"type" : "file"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 2,
|
||||||
|
"component" : "Unspecified",
|
||||||
|
"destination" : "lib/cmake/sqlite3",
|
||||||
|
"exportName" : "sqlite3-targets",
|
||||||
|
"exportTargets" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id" : "SQLite3::@910835d65fa0014a1409",
|
||||||
|
"index" : 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"paths" :
|
||||||
|
[
|
||||||
|
"_deps/sqlite3-build/CMakeFiles/Export/0f80ad8c5b36acbf13c387a14f25b4b2/sqlite3-targets.cmake"
|
||||||
|
],
|
||||||
|
"type" : "export"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 3,
|
||||||
|
"component" : "Unspecified",
|
||||||
|
"destination" : "lib/cmake/sqlite3",
|
||||||
|
"paths" :
|
||||||
|
[
|
||||||
|
"out/build/x64-release/_deps/sqlite3-build/sqlite3-config-version.cmake",
|
||||||
|
"out/build/x64-release/_deps/sqlite3-src/sqlite3-config.cmake"
|
||||||
|
],
|
||||||
|
"type" : "file"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"paths" :
|
||||||
|
{
|
||||||
|
"build" : "_deps/sqlite3-build",
|
||||||
|
"source" : "out/build/x64-release/_deps/sqlite3-src"
|
||||||
|
}
|
||||||
|
}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"backtraceGraph" :
|
||||||
|
{
|
||||||
|
"commands" : [],
|
||||||
|
"files" : [],
|
||||||
|
"nodes" : []
|
||||||
|
},
|
||||||
|
"codemodelVersion" :
|
||||||
|
{
|
||||||
|
"major" : 2,
|
||||||
|
"minor" : 10
|
||||||
|
},
|
||||||
|
"installers" : [],
|
||||||
|
"paths" :
|
||||||
|
{
|
||||||
|
"build" : "dlang.sqlite",
|
||||||
|
"source" : "dlang.sqlite"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,132 @@
|
|||||||
|
{
|
||||||
|
"cmake" :
|
||||||
|
{
|
||||||
|
"generator" :
|
||||||
|
{
|
||||||
|
"multiConfig" : false,
|
||||||
|
"name" : "Ninja"
|
||||||
|
},
|
||||||
|
"paths" :
|
||||||
|
{
|
||||||
|
"cmake" : "C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe",
|
||||||
|
"cpack" : "C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cpack.exe",
|
||||||
|
"ctest" : "C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/ctest.exe",
|
||||||
|
"root" : "C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-4.3"
|
||||||
|
},
|
||||||
|
"version" :
|
||||||
|
{
|
||||||
|
"isDirty" : false,
|
||||||
|
"major" : 4,
|
||||||
|
"minor" : 3,
|
||||||
|
"patch" : 1,
|
||||||
|
"string" : "4.3.1-msvc1",
|
||||||
|
"suffix" : "msvc1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"objects" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"jsonFile" : "codemodel-v2-a170ed627a83f3a7a3e6.json",
|
||||||
|
"kind" : "codemodel",
|
||||||
|
"version" :
|
||||||
|
{
|
||||||
|
"major" : 2,
|
||||||
|
"minor" : 10
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"jsonFile" : "cache-v2-5907cfa12cbcfe2a5fc4.json",
|
||||||
|
"kind" : "cache",
|
||||||
|
"version" :
|
||||||
|
{
|
||||||
|
"major" : 2,
|
||||||
|
"minor" : 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"jsonFile" : "cmakeFiles-v1-987cf33bf68a5a988675.json",
|
||||||
|
"kind" : "cmakeFiles",
|
||||||
|
"version" :
|
||||||
|
{
|
||||||
|
"major" : 1,
|
||||||
|
"minor" : 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"jsonFile" : "toolchains-v1-61393e8699d2f460cea7.json",
|
||||||
|
"kind" : "toolchains",
|
||||||
|
"version" :
|
||||||
|
{
|
||||||
|
"major" : 1,
|
||||||
|
"minor" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"reply" :
|
||||||
|
{
|
||||||
|
"client-vscode" :
|
||||||
|
{
|
||||||
|
"query.json" :
|
||||||
|
{
|
||||||
|
"requests" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"kind" : "cache",
|
||||||
|
"version" : 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind" : "codemodel",
|
||||||
|
"version" : 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind" : "toolchains",
|
||||||
|
"version" : 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind" : "cmakeFiles",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"jsonFile" : "cache-v2-5907cfa12cbcfe2a5fc4.json",
|
||||||
|
"kind" : "cache",
|
||||||
|
"version" :
|
||||||
|
{
|
||||||
|
"major" : 2,
|
||||||
|
"minor" : 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"jsonFile" : "codemodel-v2-a170ed627a83f3a7a3e6.json",
|
||||||
|
"kind" : "codemodel",
|
||||||
|
"version" :
|
||||||
|
{
|
||||||
|
"major" : 2,
|
||||||
|
"minor" : 10
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"jsonFile" : "toolchains-v1-61393e8699d2f460cea7.json",
|
||||||
|
"kind" : "toolchains",
|
||||||
|
"version" :
|
||||||
|
{
|
||||||
|
"major" : 1,
|
||||||
|
"minor" : 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"jsonFile" : "cmakeFiles-v1-987cf33bf68a5a988675.json",
|
||||||
|
"kind" : "cmakeFiles",
|
||||||
|
"version" :
|
||||||
|
{
|
||||||
|
"major" : 1,
|
||||||
|
"minor" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+103
@@ -0,0 +1,103 @@
|
|||||||
|
{
|
||||||
|
"abstract" : true,
|
||||||
|
"artifacts" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"path" : "C:/Program Files/Git/cmd/git.exe"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"backtrace" : 9,
|
||||||
|
"backtraceGraph" :
|
||||||
|
{
|
||||||
|
"commands" :
|
||||||
|
[
|
||||||
|
"add_executable",
|
||||||
|
"find_package",
|
||||||
|
"__FetchContent_populateSubbuild",
|
||||||
|
"__FetchContent_doPopulation",
|
||||||
|
"cmake_language",
|
||||||
|
"__FetchContent_Populate",
|
||||||
|
"FetchContent_MakeAvailable"
|
||||||
|
],
|
||||||
|
"files" :
|
||||||
|
[
|
||||||
|
"C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-4.3/Modules/FindGit.cmake",
|
||||||
|
"C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-4.3/Modules/FetchContent.cmake",
|
||||||
|
"C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-4.3/Modules/FetchContent.cmake:2158:EVAL",
|
||||||
|
"dlang.sqlite/CMakeLists.txt"
|
||||||
|
],
|
||||||
|
"nodes" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"file" : 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 6,
|
||||||
|
"file" : 3,
|
||||||
|
"line" : 26,
|
||||||
|
"parent" : 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 5,
|
||||||
|
"file" : 1,
|
||||||
|
"line" : 2399,
|
||||||
|
"parent" : 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 4,
|
||||||
|
"file" : 1,
|
||||||
|
"line" : 2158,
|
||||||
|
"parent" : 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file" : 2,
|
||||||
|
"parent" : 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 3,
|
||||||
|
"file" : 2,
|
||||||
|
"line" : 2,
|
||||||
|
"parent" : 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 2,
|
||||||
|
"file" : 1,
|
||||||
|
"line" : 1622,
|
||||||
|
"parent" : 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 1,
|
||||||
|
"file" : 1,
|
||||||
|
"line" : 1887,
|
||||||
|
"parent" : 6
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file" : 0,
|
||||||
|
"parent" : 7
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 0,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 179,
|
||||||
|
"parent" : 8
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"codemodelVersion" :
|
||||||
|
{
|
||||||
|
"major" : 2,
|
||||||
|
"minor" : 10
|
||||||
|
},
|
||||||
|
"id" : "Git::Git::@e307556b105425ba5dcf",
|
||||||
|
"imported" : true,
|
||||||
|
"local" : true,
|
||||||
|
"name" : "Git::Git",
|
||||||
|
"nameOnDisk" : "git.exe",
|
||||||
|
"paths" :
|
||||||
|
{
|
||||||
|
"build" : "dlang.sqlite",
|
||||||
|
"source" : "dlang.sqlite"
|
||||||
|
},
|
||||||
|
"sources" : [],
|
||||||
|
"type" : "EXECUTABLE"
|
||||||
|
}
|
||||||
+295
@@ -0,0 +1,295 @@
|
|||||||
|
{
|
||||||
|
"archive" :
|
||||||
|
{
|
||||||
|
"commandFragments" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"fragment" : "/machine:x64",
|
||||||
|
"role" : "flags"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"artifacts" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"path" : "_deps/sqlite3-build/sqlite3.lib"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"backtrace" : 1,
|
||||||
|
"backtraceGraph" :
|
||||||
|
{
|
||||||
|
"commands" :
|
||||||
|
[
|
||||||
|
"add_library",
|
||||||
|
"install",
|
||||||
|
"target_compile_definitions",
|
||||||
|
"check_and_define",
|
||||||
|
"include_directories",
|
||||||
|
"target_include_directories",
|
||||||
|
"target_sources"
|
||||||
|
],
|
||||||
|
"files" :
|
||||||
|
[
|
||||||
|
"out/build/x64-release/_deps/sqlite3-src/CMakeLists.txt",
|
||||||
|
"dlang.sqlite/CMakeLists.txt"
|
||||||
|
],
|
||||||
|
"nodes" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"file" : 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 0,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 42,
|
||||||
|
"parent" : 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 1,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 163,
|
||||||
|
"parent" : 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 3,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 88,
|
||||||
|
"parent" : 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 2,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 78,
|
||||||
|
"parent" : 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 2,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 78,
|
||||||
|
"parent" : 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 3,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 85,
|
||||||
|
"parent" : 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 2,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 78,
|
||||||
|
"parent" : 6
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 2,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 78,
|
||||||
|
"parent" : 6
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 2,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 78,
|
||||||
|
"parent" : 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 2,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 78,
|
||||||
|
"parent" : 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 2,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 78,
|
||||||
|
"parent" : 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 2,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 148,
|
||||||
|
"parent" : 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 2,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 134,
|
||||||
|
"parent" : 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file" : 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 4,
|
||||||
|
"file" : 1,
|
||||||
|
"line" : 6,
|
||||||
|
"parent" : 14
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 5,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 58,
|
||||||
|
"parent" : 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 6,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 105,
|
||||||
|
"parent" : 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"codemodelVersion" :
|
||||||
|
{
|
||||||
|
"major" : 2,
|
||||||
|
"minor" : 10
|
||||||
|
},
|
||||||
|
"compileGroups" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"compileCommandFragments" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"fragment" : "/DWIN32 /D_WINDOWS /W3 /MD /O2 /Ob2 /DNDEBUG"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"defines" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"backtrace" : 4,
|
||||||
|
"define" : "HAVE_INT16_T=1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 5,
|
||||||
|
"define" : "HAVE_INT8_T=1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 7,
|
||||||
|
"define" : "HAVE_INTTYPES_H=1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 8,
|
||||||
|
"define" : "HAVE_STDINT_H=1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 9,
|
||||||
|
"define" : "HAVE_UINT16_T=1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 10,
|
||||||
|
"define" : "HAVE_UINT32_T=1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 11,
|
||||||
|
"define" : "HAVE_UINT8_T=1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 12,
|
||||||
|
"define" : "SQLITE_DQS=0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 12,
|
||||||
|
"define" : "SQLITE_ENABLE_DBPAGE_VTAB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 12,
|
||||||
|
"define" : "SQLITE_ENABLE_DBSTAT_VTAB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 12,
|
||||||
|
"define" : "SQLITE_ENABLE_EXPLAIN_COMMENTS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 13,
|
||||||
|
"define" : "SQLITE_ENABLE_FTS4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 13,
|
||||||
|
"define" : "SQLITE_ENABLE_FTS5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 13,
|
||||||
|
"define" : "SQLITE_ENABLE_GEOPOLY"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 13,
|
||||||
|
"define" : "SQLITE_ENABLE_MATH_FUNCTIONS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 13,
|
||||||
|
"define" : "SQLITE_ENABLE_RTREE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 12,
|
||||||
|
"define" : "SQLITE_ENABLE_STMTVTAB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 13,
|
||||||
|
"define" : "SQLITE_OMIT_DEPRECATED"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 13,
|
||||||
|
"define" : "SQLITE_THREADSAFE=0"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"includes" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"backtrace" : 15,
|
||||||
|
"path" : "C:/Users/Damian/Desktop/dlang-sqlite/dlang.sqlite/dlang"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 16,
|
||||||
|
"path" : "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-src"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"language" : "C",
|
||||||
|
"sourceIndexes" :
|
||||||
|
[
|
||||||
|
0
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"id" : "SQLite3::@910835d65fa0014a1409",
|
||||||
|
"install" :
|
||||||
|
{
|
||||||
|
"destinations" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"backtrace" : 2,
|
||||||
|
"path" : "lib"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"prefix" :
|
||||||
|
{
|
||||||
|
"path" : "C:/Users/Damian/Desktop/dlang-sqlite/out/install/x64-release"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"name" : "SQLite3",
|
||||||
|
"nameOnDisk" : "sqlite3.lib",
|
||||||
|
"paths" :
|
||||||
|
{
|
||||||
|
"build" : "_deps/sqlite3-build",
|
||||||
|
"source" : "out/build/x64-release/_deps/sqlite3-src"
|
||||||
|
},
|
||||||
|
"sourceGroups" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name" : "Source Files",
|
||||||
|
"sourceIndexes" :
|
||||||
|
[
|
||||||
|
0
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"sources" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"backtrace" : 17,
|
||||||
|
"compileGroupIndex" : 0,
|
||||||
|
"path" : "out/build/x64-release/_deps/sqlite3_ext-src/sqlite3.c",
|
||||||
|
"sourceGroupIndex" : 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"type" : "STATIC_LIBRARY"
|
||||||
|
}
|
||||||
+206
@@ -0,0 +1,206 @@
|
|||||||
|
{
|
||||||
|
"artifacts" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"path" : "dlang.sqlite/dlang.sqlite.dll"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "dlang.sqlite/dlang.sqlite.lib"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "dlang.sqlite/dlang.sqlite.pdb"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"backtrace" : 1,
|
||||||
|
"backtraceGraph" :
|
||||||
|
{
|
||||||
|
"commands" :
|
||||||
|
[
|
||||||
|
"add_library",
|
||||||
|
"target_link_libraries",
|
||||||
|
"include_directories",
|
||||||
|
"set_property"
|
||||||
|
],
|
||||||
|
"files" :
|
||||||
|
[
|
||||||
|
"dlang.sqlite/CMakeLists.txt"
|
||||||
|
],
|
||||||
|
"nodes" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"file" : 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 0,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 7,
|
||||||
|
"parent" : 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 1,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 28,
|
||||||
|
"parent" : 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 2,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 6,
|
||||||
|
"parent" : 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command" : 3,
|
||||||
|
"file" : 0,
|
||||||
|
"line" : 16,
|
||||||
|
"parent" : 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"codemodelVersion" :
|
||||||
|
{
|
||||||
|
"major" : 2,
|
||||||
|
"minor" : 10
|
||||||
|
},
|
||||||
|
"compileDependencies" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"backtrace" : 2,
|
||||||
|
"id" : "SQLite3::@910835d65fa0014a1409"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"compileGroups" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"compileCommandFragments" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"fragment" : "/DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /O2 /Ob2 /DNDEBUG -std:c++20"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"defines" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"define" : "dlang_sqlite_EXPORTS"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"includes" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"backtrace" : 3,
|
||||||
|
"path" : "C:/Users/Damian/Desktop/dlang-sqlite/dlang.sqlite/dlang"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 2,
|
||||||
|
"path" : "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-src"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"language" : "CXX",
|
||||||
|
"languageStandard" :
|
||||||
|
{
|
||||||
|
"backtraces" :
|
||||||
|
[
|
||||||
|
4
|
||||||
|
],
|
||||||
|
"standard" : "20"
|
||||||
|
},
|
||||||
|
"sourceIndexes" :
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
4
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dependencies" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"backtrace" : 2,
|
||||||
|
"id" : "SQLite3::@910835d65fa0014a1409"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"id" : "dlang.sqlite::@e307556b105425ba5dcf",
|
||||||
|
"link" :
|
||||||
|
{
|
||||||
|
"commandFragments" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"fragment" : "/machine:x64 /INCREMENTAL:NO",
|
||||||
|
"role" : "flags"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 2,
|
||||||
|
"fragment" : "_deps\\sqlite3-build\\sqlite3.lib",
|
||||||
|
"role" : "libraries"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fragment" : "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib",
|
||||||
|
"role" : "libraries"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"language" : "CXX"
|
||||||
|
},
|
||||||
|
"linkLibraries" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"backtrace" : 2,
|
||||||
|
"id" : "SQLite3::@910835d65fa0014a1409"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name" : "dlang.sqlite",
|
||||||
|
"nameOnDisk" : "dlang.sqlite.dll",
|
||||||
|
"paths" :
|
||||||
|
{
|
||||||
|
"build" : "dlang.sqlite",
|
||||||
|
"source" : "dlang.sqlite"
|
||||||
|
},
|
||||||
|
"sourceGroups" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name" : "Source Files",
|
||||||
|
"sourceIndexes" :
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
4
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"sources" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"backtrace" : 1,
|
||||||
|
"compileGroupIndex" : 0,
|
||||||
|
"path" : "dlang.sqlite/entry.cpp",
|
||||||
|
"sourceGroupIndex" : 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 1,
|
||||||
|
"compileGroupIndex" : 0,
|
||||||
|
"path" : "dlang.sqlite/dlang/src/compiler.cpp",
|
||||||
|
"sourceGroupIndex" : 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 1,
|
||||||
|
"compileGroupIndex" : 0,
|
||||||
|
"path" : "dlang.sqlite/dlang/src/lexer.cpp",
|
||||||
|
"sourceGroupIndex" : 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 1,
|
||||||
|
"compileGroupIndex" : 0,
|
||||||
|
"path" : "dlang.sqlite/dlang/src/parser.cpp",
|
||||||
|
"sourceGroupIndex" : 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"backtrace" : 1,
|
||||||
|
"compileGroupIndex" : 0,
|
||||||
|
"path" : "dlang.sqlite/dlang/src/vm.cpp",
|
||||||
|
"sourceGroupIndex" : 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"type" : "SHARED_LIBRARY"
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
{
|
||||||
|
"kind" : "toolchains",
|
||||||
|
"toolchains" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"compiler" :
|
||||||
|
{
|
||||||
|
"id" : "MSVC",
|
||||||
|
"implicit" :
|
||||||
|
{
|
||||||
|
"includeDirectories" : [],
|
||||||
|
"linkDirectories" : [],
|
||||||
|
"linkFrameworkDirectories" : [],
|
||||||
|
"linkLibraries" : []
|
||||||
|
},
|
||||||
|
"path" : "C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.51.36231/bin/Hostx64/x64/cl.exe",
|
||||||
|
"version" : "19.51.36260.0"
|
||||||
|
},
|
||||||
|
"language" : "C",
|
||||||
|
"sourceFileExtensions" :
|
||||||
|
[
|
||||||
|
"c",
|
||||||
|
"m"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"compiler" :
|
||||||
|
{
|
||||||
|
"id" : "MSVC",
|
||||||
|
"implicit" :
|
||||||
|
{
|
||||||
|
"includeDirectories" : [],
|
||||||
|
"linkDirectories" : [],
|
||||||
|
"linkFrameworkDirectories" : [],
|
||||||
|
"linkLibraries" : []
|
||||||
|
},
|
||||||
|
"path" : "C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.51.36231/bin/Hostx64/x64/cl.exe",
|
||||||
|
"version" : "19.51.36260.0"
|
||||||
|
},
|
||||||
|
"language" : "CXX",
|
||||||
|
"sourceFileExtensions" :
|
||||||
|
[
|
||||||
|
"C",
|
||||||
|
"M",
|
||||||
|
"c++",
|
||||||
|
"cc",
|
||||||
|
"cpp",
|
||||||
|
"cxx",
|
||||||
|
"mm",
|
||||||
|
"mpp",
|
||||||
|
"CPP",
|
||||||
|
"ixx",
|
||||||
|
"cppm",
|
||||||
|
"ccm",
|
||||||
|
"cxxm",
|
||||||
|
"c++m"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"compiler" :
|
||||||
|
{
|
||||||
|
"implicit" : {},
|
||||||
|
"path" : "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64/rc.exe"
|
||||||
|
},
|
||||||
|
"language" : "RC",
|
||||||
|
"sourceFileExtensions" :
|
||||||
|
[
|
||||||
|
"rc",
|
||||||
|
"RC"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version" :
|
||||||
|
{
|
||||||
|
"major" : 1,
|
||||||
|
"minor" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,10 @@
|
|||||||
|
# ninja log v7
|
||||||
|
15 2409 8134996219404007 dlang.sqlite/CMakeFiles/dlang.sqlite.dir/dlang/src/lexer.cpp.obj 64f4c0c62ba90654
|
||||||
|
16 2695 8134996219414042 dlang.sqlite/CMakeFiles/dlang.sqlite.dir/dlang/src/parser.cpp.obj 28f3c2b80295083
|
||||||
|
14 3802 8134996219393998 dlang.sqlite/CMakeFiles/dlang.sqlite.dir/dlang/src/compiler.cpp.obj d497a4ae0aea1c03
|
||||||
|
18 4107 8134996219434007 dlang.sqlite/CMakeFiles/dlang.sqlite.dir/dlang/src/vm.cpp.obj 292cc6d810c99167
|
||||||
|
13 6325 8134996219383996 dlang.sqlite/CMakeFiles/dlang.sqlite.dir/entry.cpp.obj d45fc2ddcbd8b120
|
||||||
|
11 13365 8134996219363999 _deps/sqlite3-build/CMakeFiles/SQLite3.dir/__/sqlite3_ext-src/sqlite3.c.obj fd1ba37adff8c319
|
||||||
|
13365 13406 8134996352908579 _deps/sqlite3-build/sqlite3.lib 41cc1e1d66b9c8e8
|
||||||
|
13407 13539 8134996354458634 dlang.sqlite/dlang.sqlite.dll 78aa591785dcffa8
|
||||||
|
13407 13539 8134996354458634 dlang.sqlite/dlang.sqlite.lib 78aa591785dcffa8
|
||||||
@@ -0,0 +1,585 @@
|
|||||||
|
# This is the CMakeCache file.
|
||||||
|
# For build in directory: c:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release
|
||||||
|
# It was generated by CMake: C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe
|
||||||
|
# You can edit this file to change values found and used by cmake.
|
||||||
|
# If you do not want to change any of the values, simply exit the editor.
|
||||||
|
# If you do want to change a value, simply edit, save, and exit the editor.
|
||||||
|
# The syntax for the file is as follows:
|
||||||
|
# KEY:TYPE=VALUE
|
||||||
|
# KEY is the name of a variable in the cache.
|
||||||
|
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
|
||||||
|
# VALUE is the current value for the KEY.
|
||||||
|
|
||||||
|
########################
|
||||||
|
# EXTERNAL cache entries
|
||||||
|
########################
|
||||||
|
|
||||||
|
//Path to a program.
|
||||||
|
CMAKE_AR:FILEPATH=C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.51.36231/bin/Hostx64/x64/lib.exe
|
||||||
|
|
||||||
|
//Choose the type of build, options are: None Debug Release RelWithDebInfo
|
||||||
|
// MinSizeRel ...
|
||||||
|
CMAKE_BUILD_TYPE:STRING=Release
|
||||||
|
|
||||||
|
//CXX compiler
|
||||||
|
CMAKE_CXX_COMPILER:STRING=C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.51.36231/bin/Hostx64/x64/cl.exe
|
||||||
|
|
||||||
|
//Flags used by the CXX compiler during all build types.
|
||||||
|
CMAKE_CXX_FLAGS:STRING=/DWIN32 /D_WINDOWS /W3 /GR /EHsc
|
||||||
|
|
||||||
|
//Flags used by the CXX compiler during DEBUG builds.
|
||||||
|
CMAKE_CXX_FLAGS_DEBUG:STRING=/MDd /Ob0 /Od /RTC1
|
||||||
|
|
||||||
|
//Flags used by the CXX compiler during MINSIZEREL builds.
|
||||||
|
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /DNDEBUG
|
||||||
|
|
||||||
|
//Flags used by the CXX compiler during RELEASE builds.
|
||||||
|
CMAKE_CXX_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /DNDEBUG
|
||||||
|
|
||||||
|
//Flags used by the CXX compiler during RELWITHDEBINFO builds.
|
||||||
|
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=/MD /O2 /Ob1 /DNDEBUG
|
||||||
|
|
||||||
|
//Libraries linked by default with all C++ applications.
|
||||||
|
CMAKE_CXX_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
|
||||||
|
|
||||||
|
//C compiler
|
||||||
|
CMAKE_C_COMPILER:STRING=C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.51.36231/bin/Hostx64/x64/cl.exe
|
||||||
|
|
||||||
|
//Flags used by the C compiler during all build types.
|
||||||
|
CMAKE_C_FLAGS:STRING=/DWIN32 /D_WINDOWS /W3
|
||||||
|
|
||||||
|
//Flags used by the C compiler during DEBUG builds.
|
||||||
|
CMAKE_C_FLAGS_DEBUG:STRING=/MDd /Ob0 /Od /RTC1
|
||||||
|
|
||||||
|
//Flags used by the C compiler during MINSIZEREL builds.
|
||||||
|
CMAKE_C_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /DNDEBUG
|
||||||
|
|
||||||
|
//Flags used by the C compiler during RELEASE builds.
|
||||||
|
CMAKE_C_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /DNDEBUG
|
||||||
|
|
||||||
|
//Flags used by the C compiler during RELWITHDEBINFO builds.
|
||||||
|
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=/MD /O2 /Ob1 /DNDEBUG
|
||||||
|
|
||||||
|
//Libraries linked by default with all C applications.
|
||||||
|
CMAKE_C_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
|
||||||
|
|
||||||
|
//Flags used by the linker during all build types.
|
||||||
|
CMAKE_EXE_LINKER_FLAGS:STRING=/machine:x64
|
||||||
|
|
||||||
|
//Flags used by the linker during DEBUG builds.
|
||||||
|
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL
|
||||||
|
|
||||||
|
//Flags used by the linker during MINSIZEREL builds.
|
||||||
|
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
|
||||||
|
|
||||||
|
//Flags used by the linker during RELEASE builds.
|
||||||
|
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
|
||||||
|
|
||||||
|
//Flags used by the linker during RELWITHDEBINFO builds.
|
||||||
|
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL
|
||||||
|
|
||||||
|
//Enable/Disable output of build database during the build.
|
||||||
|
CMAKE_EXPORT_BUILD_DATABASE:BOOL=
|
||||||
|
|
||||||
|
//No help, variable specified on the command line.
|
||||||
|
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE
|
||||||
|
|
||||||
|
//Value Computed by CMake.
|
||||||
|
CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/CMakeFiles/pkgRedirects
|
||||||
|
|
||||||
|
//User executables (bin)
|
||||||
|
CMAKE_INSTALL_BINDIR:PATH=bin
|
||||||
|
|
||||||
|
//Read-only architecture-independent data (DATAROOTDIR)
|
||||||
|
CMAKE_INSTALL_DATADIR:PATH=
|
||||||
|
|
||||||
|
//Read-only architecture-independent data root (share)
|
||||||
|
CMAKE_INSTALL_DATAROOTDIR:PATH=share
|
||||||
|
|
||||||
|
//Documentation root (DATAROOTDIR/doc/PROJECT_NAME)
|
||||||
|
CMAKE_INSTALL_DOCDIR:PATH=
|
||||||
|
|
||||||
|
//C header files (include)
|
||||||
|
CMAKE_INSTALL_INCLUDEDIR:PATH=include
|
||||||
|
|
||||||
|
//Info documentation (DATAROOTDIR/info)
|
||||||
|
CMAKE_INSTALL_INFODIR:PATH=
|
||||||
|
|
||||||
|
//Object code libraries (lib)
|
||||||
|
CMAKE_INSTALL_LIBDIR:PATH=lib
|
||||||
|
|
||||||
|
//Program executables (libexec)
|
||||||
|
CMAKE_INSTALL_LIBEXECDIR:PATH=libexec
|
||||||
|
|
||||||
|
//Locale-dependent data (DATAROOTDIR/locale)
|
||||||
|
CMAKE_INSTALL_LOCALEDIR:PATH=
|
||||||
|
|
||||||
|
//Modifiable single-machine data (var)
|
||||||
|
CMAKE_INSTALL_LOCALSTATEDIR:PATH=var
|
||||||
|
|
||||||
|
//Man documentation (DATAROOTDIR/man)
|
||||||
|
CMAKE_INSTALL_MANDIR:PATH=
|
||||||
|
|
||||||
|
//C header files for non-gcc (/usr/include)
|
||||||
|
CMAKE_INSTALL_OLDINCLUDEDIR:PATH=/usr/include
|
||||||
|
|
||||||
|
//Install path prefix, prepended onto install directories.
|
||||||
|
CMAKE_INSTALL_PREFIX:PATH=C:/Users/Damian/Desktop/dlang-sqlite/out/install/x64-release
|
||||||
|
|
||||||
|
//Run-time variable data (LOCALSTATEDIR/run)
|
||||||
|
CMAKE_INSTALL_RUNSTATEDIR:PATH=
|
||||||
|
|
||||||
|
//System admin executables (sbin)
|
||||||
|
CMAKE_INSTALL_SBINDIR:PATH=sbin
|
||||||
|
|
||||||
|
//Modifiable architecture-independent data (com)
|
||||||
|
CMAKE_INSTALL_SHAREDSTATEDIR:PATH=com
|
||||||
|
|
||||||
|
//Read-only single-machine data (etc)
|
||||||
|
CMAKE_INSTALL_SYSCONFDIR:PATH=etc
|
||||||
|
|
||||||
|
//Path to a program.
|
||||||
|
CMAKE_LINKER:FILEPATH=C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.51.36231/bin/Hostx64/x64/link.exe
|
||||||
|
|
||||||
|
//make program
|
||||||
|
CMAKE_MAKE_PROGRAM:FILEPATH=C:/PROGRA~1/MICROS~1/18/COMMUN~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe
|
||||||
|
|
||||||
|
//Flags used by the linker during the creation of modules during
|
||||||
|
// all build types.
|
||||||
|
CMAKE_MODULE_LINKER_FLAGS:STRING=/machine:x64
|
||||||
|
|
||||||
|
//Flags used by the linker during the creation of modules during
|
||||||
|
// DEBUG builds.
|
||||||
|
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL
|
||||||
|
|
||||||
|
//Flags used by the linker during the creation of modules during
|
||||||
|
// MINSIZEREL builds.
|
||||||
|
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
|
||||||
|
|
||||||
|
//Flags used by the linker during the creation of modules during
|
||||||
|
// RELEASE builds.
|
||||||
|
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
|
||||||
|
|
||||||
|
//Flags used by the linker during the creation of modules during
|
||||||
|
// RELWITHDEBINFO builds.
|
||||||
|
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL
|
||||||
|
|
||||||
|
//Path to a program.
|
||||||
|
CMAKE_MT:FILEPATH=C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64/mt.exe
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
CMAKE_PROJECT_COMPAT_VERSION:STATIC=
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
CMAKE_PROJECT_DESCRIPTION:STATIC=
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
CMAKE_PROJECT_HOMEPAGE_URL:STATIC=
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
CMAKE_PROJECT_NAME:STATIC=dlang.sqlite
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
CMAKE_PROJECT_SPDX_LICENSE:STATIC=
|
||||||
|
|
||||||
|
//No help, variable specified on the command line.
|
||||||
|
CMAKE_PROJECT_TOP_LEVEL_INCLUDES:UNINITIALIZED=C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/cmake/Microsoft/SegmentHeap.cmake
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
CMAKE_PROJECT_VERSION:STATIC=3.49.1
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
CMAKE_PROJECT_VERSION_MAJOR:STATIC=3
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
CMAKE_PROJECT_VERSION_MINOR:STATIC=49
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
CMAKE_PROJECT_VERSION_PATCH:STATIC=1
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
CMAKE_PROJECT_VERSION_TWEAK:STATIC=
|
||||||
|
|
||||||
|
//RC compiler
|
||||||
|
CMAKE_RC_COMPILER:FILEPATH=C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64/rc.exe
|
||||||
|
|
||||||
|
//Flags for Windows Resource Compiler during all build types.
|
||||||
|
CMAKE_RC_FLAGS:STRING=-DWIN32
|
||||||
|
|
||||||
|
//Flags for Windows Resource Compiler during DEBUG builds.
|
||||||
|
CMAKE_RC_FLAGS_DEBUG:STRING=-D_DEBUG
|
||||||
|
|
||||||
|
//Flags for Windows Resource Compiler during MINSIZEREL builds.
|
||||||
|
CMAKE_RC_FLAGS_MINSIZEREL:STRING=
|
||||||
|
|
||||||
|
//Flags for Windows Resource Compiler during RELEASE builds.
|
||||||
|
CMAKE_RC_FLAGS_RELEASE:STRING=
|
||||||
|
|
||||||
|
//Flags for Windows Resource Compiler during RELWITHDEBINFO builds.
|
||||||
|
CMAKE_RC_FLAGS_RELWITHDEBINFO:STRING=
|
||||||
|
|
||||||
|
//Flags used by the linker during the creation of shared libraries
|
||||||
|
// during all build types.
|
||||||
|
CMAKE_SHARED_LINKER_FLAGS:STRING=/machine:x64
|
||||||
|
|
||||||
|
//Flags used by the linker during the creation of shared libraries
|
||||||
|
// during DEBUG builds.
|
||||||
|
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL
|
||||||
|
|
||||||
|
//Flags used by the linker during the creation of shared libraries
|
||||||
|
// during MINSIZEREL builds.
|
||||||
|
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
|
||||||
|
|
||||||
|
//Flags used by the linker during the creation of shared libraries
|
||||||
|
// during RELEASE builds.
|
||||||
|
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
|
||||||
|
|
||||||
|
//Flags used by the linker during the creation of shared libraries
|
||||||
|
// during RELWITHDEBINFO builds.
|
||||||
|
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL
|
||||||
|
|
||||||
|
//If set, runtime paths are not added when installing shared libraries,
|
||||||
|
// but are added when building.
|
||||||
|
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
|
||||||
|
|
||||||
|
//If set, runtime paths are not added when using shared libraries.
|
||||||
|
CMAKE_SKIP_RPATH:BOOL=NO
|
||||||
|
|
||||||
|
//Flags used by the archiver during the creation of static libraries
|
||||||
|
// during all build types.
|
||||||
|
CMAKE_STATIC_LINKER_FLAGS:STRING=/machine:x64
|
||||||
|
|
||||||
|
//Flags used by the archiver during the creation of static libraries
|
||||||
|
// during DEBUG builds.
|
||||||
|
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
|
||||||
|
|
||||||
|
//Flags used by the archiver during the creation of static libraries
|
||||||
|
// during MINSIZEREL builds.
|
||||||
|
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
|
||||||
|
|
||||||
|
//Flags used by the archiver during the creation of static libraries
|
||||||
|
// during RELEASE builds.
|
||||||
|
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
|
||||||
|
|
||||||
|
//Flags used by the archiver during the creation of static libraries
|
||||||
|
// during RELWITHDEBINFO builds.
|
||||||
|
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
|
||||||
|
|
||||||
|
//If this value is on, makefiles will be generated without the
|
||||||
|
// .SILENT directive, and all commands will be echoed to the console
|
||||||
|
// during the make. This is useful for debugging only. With Visual
|
||||||
|
// Studio IDE projects all commands are done without /nologo.
|
||||||
|
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
|
||||||
|
|
||||||
|
//Directory under which to collect all populated content
|
||||||
|
FETCHCONTENT_BASE_DIR:PATH=C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps
|
||||||
|
|
||||||
|
//Disables all attempts to download or update content and assumes
|
||||||
|
// source dirs already exist
|
||||||
|
FETCHCONTENT_FULLY_DISCONNECTED:BOOL=OFF
|
||||||
|
|
||||||
|
//Enables QUIET option for all content population
|
||||||
|
FETCHCONTENT_QUIET:BOOL=ON
|
||||||
|
|
||||||
|
//When not empty, overrides where to find pre-populated content
|
||||||
|
// for sqlite3
|
||||||
|
FETCHCONTENT_SOURCE_DIR_SQLITE3:PATH=
|
||||||
|
|
||||||
|
//When not empty, overrides where to find pre-populated content
|
||||||
|
// for sqlite3_ext
|
||||||
|
FETCHCONTENT_SOURCE_DIR_SQLITE3_EXT:PATH=
|
||||||
|
|
||||||
|
//Enables UPDATE_DISCONNECTED behavior for all content population
|
||||||
|
FETCHCONTENT_UPDATES_DISCONNECTED:BOOL=OFF
|
||||||
|
|
||||||
|
//Enables UPDATE_DISCONNECTED behavior just for population of sqlite3
|
||||||
|
FETCHCONTENT_UPDATES_DISCONNECTED_SQLITE3:BOOL=OFF
|
||||||
|
|
||||||
|
//Enables UPDATE_DISCONNECTED behavior just for population of sqlite3_ext
|
||||||
|
FETCHCONTENT_UPDATES_DISCONNECTED_SQLITE3_EXT:BOOL=OFF
|
||||||
|
|
||||||
|
//Git command line client
|
||||||
|
GIT_EXECUTABLE:FILEPATH=C:/Program Files/Git/cmd/git.exe
|
||||||
|
|
||||||
|
//Path to the segment heap manifest to embed into executable
|
||||||
|
VS_SEGMENT_HEAP_MANIFEST_FILE:FILEPATH=C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.51.36231/include/manifest/segmentheap.manifest
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
dlang.sqlite_BINARY_DIR:STATIC=C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
dlang.sqlite_IS_TOP_LEVEL:STATIC=ON
|
||||||
|
|
||||||
|
//Dependencies for the target
|
||||||
|
dlang.sqlite_LIB_DEPENDS:STATIC=general;SQLite::SQLite3;
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
dlang.sqlite_SOURCE_DIR:STATIC=C:/Users/Damian/Desktop/dlang-sqlite
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
sqlite3_BINARY_DIR:STATIC=C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-build
|
||||||
|
|
||||||
|
//Build shared libraries
|
||||||
|
sqlite3_BUILD_SHARED_LIBS:BOOL=OFF
|
||||||
|
|
||||||
|
//Support loadable extensions
|
||||||
|
sqlite3_ENABLE_DYNAMIC_EXTENSIONS:BOOL=ON
|
||||||
|
|
||||||
|
//Include FTS3 support
|
||||||
|
sqlite3_ENABLE_FTS3:BOOL=OFF
|
||||||
|
|
||||||
|
//Include FTS4 support
|
||||||
|
sqlite3_ENABLE_FTS4:BOOL=ON
|
||||||
|
|
||||||
|
//Include FTS5 support
|
||||||
|
sqlite3_ENABLE_FTS5:BOOL=ON
|
||||||
|
|
||||||
|
//SQL math functions
|
||||||
|
sqlite3_ENABLE_MATH:BOOL=ON
|
||||||
|
|
||||||
|
//Include rtree support
|
||||||
|
sqlite3_ENABLE_RTREE:BOOL=ON
|
||||||
|
|
||||||
|
//Enable the session extension
|
||||||
|
sqlite3_ENABLE_SESSION:BOOL=OFF
|
||||||
|
|
||||||
|
//Build a thread-safe library
|
||||||
|
sqlite3_ENABLE_THREADSAFE:BOOL=OFF
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
sqlite3_IS_TOP_LEVEL:STATIC=OFF
|
||||||
|
|
||||||
|
//Omit deprecated stuff
|
||||||
|
sqlite3_OMIT_DEPRECATED:BOOL=ON
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
sqlite3_SOURCE_DIR:STATIC=C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-src
|
||||||
|
|
||||||
|
|
||||||
|
########################
|
||||||
|
# INTERNAL cache entries
|
||||||
|
########################
|
||||||
|
|
||||||
|
//ADVANCED property for variable: CMAKE_AR
|
||||||
|
CMAKE_AR-ADVANCED:INTERNAL=1
|
||||||
|
//This is the directory where this CMakeCache.txt was created
|
||||||
|
CMAKE_CACHEFILE_DIR:INTERNAL=c:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release
|
||||||
|
//Major version of cmake used to create the current loaded cache
|
||||||
|
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=4
|
||||||
|
//Minor version of cmake used to create the current loaded cache
|
||||||
|
CMAKE_CACHE_MINOR_VERSION:INTERNAL=3
|
||||||
|
//Patch version of cmake used to create the current loaded cache
|
||||||
|
CMAKE_CACHE_PATCH_VERSION:INTERNAL=1
|
||||||
|
//Path to CMake executable.
|
||||||
|
CMAKE_COMMAND:INTERNAL=C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe
|
||||||
|
//Path to cpack program executable.
|
||||||
|
CMAKE_CPACK_COMMAND:INTERNAL=C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cpack.exe
|
||||||
|
//Path to ctest program executable.
|
||||||
|
CMAKE_CTEST_COMMAND:INTERNAL=C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/ctest.exe
|
||||||
|
//ADVANCED property for variable: CMAKE_CXX_COMPILER
|
||||||
|
CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_CXX_FLAGS
|
||||||
|
CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG
|
||||||
|
CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL
|
||||||
|
CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE
|
||||||
|
CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||||
|
CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_CXX_STANDARD_LIBRARIES
|
||||||
|
CMAKE_CXX_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_C_COMPILER
|
||||||
|
CMAKE_C_COMPILER-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_C_FLAGS
|
||||||
|
CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG
|
||||||
|
CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL
|
||||||
|
CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE
|
||||||
|
CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||||
|
CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_C_STANDARD_LIBRARIES
|
||||||
|
CMAKE_C_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1
|
||||||
|
//Executable file format
|
||||||
|
CMAKE_EXECUTABLE_FORMAT:INTERNAL=Unknown
|
||||||
|
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
|
||||||
|
CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
|
||||||
|
CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
|
||||||
|
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
|
||||||
|
CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
|
||||||
|
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_EXPORT_BUILD_DATABASE
|
||||||
|
CMAKE_EXPORT_BUILD_DATABASE-ADVANCED:INTERNAL=1
|
||||||
|
//Name of external makefile project generator.
|
||||||
|
CMAKE_EXTRA_GENERATOR:INTERNAL=
|
||||||
|
//Name of generator.
|
||||||
|
CMAKE_GENERATOR:INTERNAL=Ninja
|
||||||
|
//Generator instance identifier.
|
||||||
|
CMAKE_GENERATOR_INSTANCE:INTERNAL=
|
||||||
|
//Name of generator platform.
|
||||||
|
CMAKE_GENERATOR_PLATFORM:INTERNAL=
|
||||||
|
//Name of generator toolset.
|
||||||
|
CMAKE_GENERATOR_TOOLSET:INTERNAL=
|
||||||
|
//Source directory with the top level CMakeLists.txt file for this
|
||||||
|
// project
|
||||||
|
CMAKE_HOME_DIRECTORY:INTERNAL=C:/Users/Damian/Desktop/dlang-sqlite
|
||||||
|
//ADVANCED property for variable: CMAKE_INSTALL_BINDIR
|
||||||
|
CMAKE_INSTALL_BINDIR-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_INSTALL_DATADIR
|
||||||
|
CMAKE_INSTALL_DATADIR-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_INSTALL_DATAROOTDIR
|
||||||
|
CMAKE_INSTALL_DATAROOTDIR-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_INSTALL_DOCDIR
|
||||||
|
CMAKE_INSTALL_DOCDIR-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_INSTALL_INCLUDEDIR
|
||||||
|
CMAKE_INSTALL_INCLUDEDIR-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_INSTALL_INFODIR
|
||||||
|
CMAKE_INSTALL_INFODIR-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_INSTALL_LIBDIR
|
||||||
|
CMAKE_INSTALL_LIBDIR-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_INSTALL_LIBEXECDIR
|
||||||
|
CMAKE_INSTALL_LIBEXECDIR-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_INSTALL_LOCALEDIR
|
||||||
|
CMAKE_INSTALL_LOCALEDIR-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_INSTALL_LOCALSTATEDIR
|
||||||
|
CMAKE_INSTALL_LOCALSTATEDIR-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_INSTALL_MANDIR
|
||||||
|
CMAKE_INSTALL_MANDIR-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_INSTALL_OLDINCLUDEDIR
|
||||||
|
CMAKE_INSTALL_OLDINCLUDEDIR-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_INSTALL_RUNSTATEDIR
|
||||||
|
CMAKE_INSTALL_RUNSTATEDIR-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_INSTALL_SBINDIR
|
||||||
|
CMAKE_INSTALL_SBINDIR-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_INSTALL_SHAREDSTATEDIR
|
||||||
|
CMAKE_INSTALL_SHAREDSTATEDIR-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_INSTALL_SYSCONFDIR
|
||||||
|
CMAKE_INSTALL_SYSCONFDIR-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_LINKER
|
||||||
|
CMAKE_LINKER-ADVANCED:INTERNAL=1
|
||||||
|
//Name of CMakeLists files to read
|
||||||
|
CMAKE_LIST_FILE_NAME:INTERNAL=CMakeLists.txt
|
||||||
|
//ADVANCED property for variable: CMAKE_MAKE_PROGRAM
|
||||||
|
CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS
|
||||||
|
CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
|
||||||
|
CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
|
||||||
|
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
|
||||||
|
CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
|
||||||
|
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_MT
|
||||||
|
CMAKE_MT-ADVANCED:INTERNAL=1
|
||||||
|
//number of local generators
|
||||||
|
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=3
|
||||||
|
//Platform information initialized
|
||||||
|
CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1
|
||||||
|
//noop for ranlib
|
||||||
|
CMAKE_RANLIB:INTERNAL=:
|
||||||
|
//ADVANCED property for variable: CMAKE_RC_COMPILER
|
||||||
|
CMAKE_RC_COMPILER-ADVANCED:INTERNAL=1
|
||||||
|
CMAKE_RC_COMPILER_WORKS:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_RC_FLAGS
|
||||||
|
CMAKE_RC_FLAGS-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_RC_FLAGS_DEBUG
|
||||||
|
CMAKE_RC_FLAGS_DEBUG-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_RC_FLAGS_MINSIZEREL
|
||||||
|
CMAKE_RC_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_RC_FLAGS_RELEASE
|
||||||
|
CMAKE_RC_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_RC_FLAGS_RELWITHDEBINFO
|
||||||
|
CMAKE_RC_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
||||||
|
//Path to CMake installation.
|
||||||
|
CMAKE_ROOT:INTERNAL=C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-4.3
|
||||||
|
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
|
||||||
|
CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
|
||||||
|
CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
|
||||||
|
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
|
||||||
|
CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
|
||||||
|
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
|
||||||
|
CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_SKIP_RPATH
|
||||||
|
CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS
|
||||||
|
CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG
|
||||||
|
CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL
|
||||||
|
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE
|
||||||
|
CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO
|
||||||
|
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
|
||||||
|
CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
|
||||||
|
//Have includes dlfcn.h
|
||||||
|
DLFCN_H:INTERNAL=
|
||||||
|
//Have function fdatasync
|
||||||
|
FDATASYNC:INTERNAL=
|
||||||
|
//Have function fullfsync
|
||||||
|
FULLFSYNC:INTERNAL=
|
||||||
|
//ADVANCED property for variable: GIT_EXECUTABLE
|
||||||
|
GIT_EXECUTABLE-ADVANCED:INTERNAL=1
|
||||||
|
//Have function gmtime_r
|
||||||
|
GMTIME_R:INTERNAL=
|
||||||
|
//Result of TRY_COMPILE
|
||||||
|
HAVE_INT16_T:INTERNAL=TRUE
|
||||||
|
//Result of TRY_COMPILE
|
||||||
|
HAVE_INT8_T:INTERNAL=TRUE
|
||||||
|
//Have include stddef.h
|
||||||
|
HAVE_STDDEF_H:INTERNAL=1
|
||||||
|
//Have include stdint.h
|
||||||
|
HAVE_STDINT_H:INTERNAL=1
|
||||||
|
//Have include sys/types.h
|
||||||
|
HAVE_SYS_TYPES_H:INTERNAL=1
|
||||||
|
//Result of TRY_COMPILE
|
||||||
|
HAVE_UINT16_T:INTERNAL=TRUE
|
||||||
|
//Result of TRY_COMPILE
|
||||||
|
HAVE_UINT32_T:INTERNAL=TRUE
|
||||||
|
//Result of TRY_COMPILE
|
||||||
|
HAVE_UINT8_T:INTERNAL=TRUE
|
||||||
|
//CHECK_TYPE_SIZE: sizeof(int16_t)
|
||||||
|
INT16_T:INTERNAL=2
|
||||||
|
//CHECK_TYPE_SIZE: sizeof(int8_t)
|
||||||
|
INT8_T:INTERNAL=1
|
||||||
|
//Have include inttypes.h
|
||||||
|
INTTYPES_H:INTERNAL=1
|
||||||
|
//Have function localtime_r
|
||||||
|
LOCALTIME_R:INTERNAL=
|
||||||
|
//Have function nanosleep
|
||||||
|
NANOSLEEP:INTERNAL=
|
||||||
|
//Have function posix_fallocate
|
||||||
|
POSIX_FALLOCATE:INTERNAL=
|
||||||
|
//Have include stdint.h
|
||||||
|
STDINT_H:INTERNAL=1
|
||||||
|
//Have function strerror_r
|
||||||
|
STRERROR_R:INTERNAL=
|
||||||
|
//CHECK_TYPE_SIZE: sizeof(uint16_t)
|
||||||
|
UINT16_T:INTERNAL=2
|
||||||
|
//CHECK_TYPE_SIZE: sizeof(uint32_t)
|
||||||
|
UINT32_T:INTERNAL=4
|
||||||
|
//CHECK_TYPE_SIZE: sizeof(uint8_t)
|
||||||
|
UINT8_T:INTERNAL=1
|
||||||
|
//Have function usleep
|
||||||
|
USLEEP:INTERNAL=
|
||||||
|
//Have includes utime.h
|
||||||
|
UTIME_H:INTERNAL=
|
||||||
|
//CMAKE_INSTALL_PREFIX during last run
|
||||||
|
_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX:INTERNAL=C:/Users/Damian/Desktop/dlang-sqlite/out/install/x64-release
|
||||||
|
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
set(CMAKE_C_COMPILER "C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.51.36231/bin/Hostx64/x64/cl.exe")
|
||||||
|
set(CMAKE_C_COMPILER_ARG1 "")
|
||||||
|
set(CMAKE_C_COMPILER_ID "MSVC")
|
||||||
|
set(CMAKE_C_COMPILER_VERSION "19.51.36260.0")
|
||||||
|
set(CMAKE_C_COMPILER_VERSION_INTERNAL "")
|
||||||
|
set(CMAKE_C_COMPILER_WRAPPER "")
|
||||||
|
set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "90")
|
||||||
|
set(CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT "OFF")
|
||||||
|
set(CMAKE_C_STANDARD_LATEST "23")
|
||||||
|
set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert;c_std_17;c_std_23")
|
||||||
|
set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes")
|
||||||
|
set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros")
|
||||||
|
set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert")
|
||||||
|
set(CMAKE_C17_COMPILE_FEATURES "c_std_17")
|
||||||
|
set(CMAKE_C23_COMPILE_FEATURES "c_std_23")
|
||||||
|
|
||||||
|
set(CMAKE_C_PLATFORM_ID "Windows")
|
||||||
|
set(CMAKE_C_SIMULATE_ID "")
|
||||||
|
set(CMAKE_C_COMPILER_FRONTEND_VARIANT "MSVC")
|
||||||
|
set(CMAKE_C_COMPILER_APPLE_SYSROOT "")
|
||||||
|
set(CMAKE_C_SIMULATE_VERSION "")
|
||||||
|
set(CMAKE_C_COMPILER_ARCHITECTURE_ID "x64")
|
||||||
|
|
||||||
|
set(MSVC_C_ARCHITECTURE_ID x64)
|
||||||
|
|
||||||
|
|
||||||
|
set(CMAKE_AR "C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.51.36231/bin/Hostx64/x64/lib.exe")
|
||||||
|
set(CMAKE_C_COMPILER_AR "")
|
||||||
|
set(CMAKE_RANLIB ":")
|
||||||
|
set(CMAKE_C_COMPILER_RANLIB "")
|
||||||
|
set(CMAKE_LINKER "C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.51.36231/bin/Hostx64/x64/link.exe")
|
||||||
|
set(CMAKE_LINKER_LINK "C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.51.36231/bin/Hostx64/x64/link.exe")
|
||||||
|
set(CMAKE_LINKER_LLD "lld-link")
|
||||||
|
set(CMAKE_C_COMPILER_LINKER "C:/PROGRA~1/MICROS~1/18/COMMUN~1/VC/Tools/MSVC/1451~1.362/bin/Hostx64/x64/link.exe")
|
||||||
|
set(CMAKE_C_COMPILER_LINKER_ID "MSVC")
|
||||||
|
set(CMAKE_C_COMPILER_LINKER_VERSION 14.51.36260.0)
|
||||||
|
set(CMAKE_C_COMPILER_LINKER_FRONTEND_VARIANT MSVC)
|
||||||
|
set(CMAKE_MT "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64/mt.exe")
|
||||||
|
set(CMAKE_TAPI "")
|
||||||
|
set(CMAKE_COMPILER_IS_GNUCC )
|
||||||
|
set(CMAKE_C_COMPILER_LOADED 1)
|
||||||
|
set(CMAKE_C_COMPILER_WORKS TRUE)
|
||||||
|
set(CMAKE_C_ABI_COMPILED TRUE)
|
||||||
|
|
||||||
|
set(CMAKE_C_COMPILER_ENV_VAR "CC")
|
||||||
|
|
||||||
|
set(CMAKE_C_COMPILER_ID_RUN 1)
|
||||||
|
set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m)
|
||||||
|
set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||||
|
set(CMAKE_C_LINKER_PREFERENCE 10)
|
||||||
|
set(CMAKE_C_LINKER_DEPFILE_SUPPORTED )
|
||||||
|
set(CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED )
|
||||||
|
set(CMAKE_C_LINKER_PUSHPOP_STATE_SUPPORTED )
|
||||||
|
|
||||||
|
# Save compiler ABI information.
|
||||||
|
set(CMAKE_C_SIZEOF_DATA_PTR "8")
|
||||||
|
set(CMAKE_C_COMPILER_ABI "")
|
||||||
|
set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN")
|
||||||
|
set(CMAKE_C_LIBRARY_ARCHITECTURE "")
|
||||||
|
|
||||||
|
if(CMAKE_C_SIZEOF_DATA_PTR)
|
||||||
|
set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_C_COMPILER_ABI)
|
||||||
|
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_C_LIBRARY_ARCHITECTURE)
|
||||||
|
set(CMAKE_LIBRARY_ARCHITECTURE "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "Note: including file: ")
|
||||||
|
if(CMAKE_C_CL_SHOWINCLUDES_PREFIX)
|
||||||
|
set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "")
|
||||||
|
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "")
|
||||||
|
set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "")
|
||||||
|
set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
set(CMAKE_CXX_COMPILER "C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.51.36231/bin/Hostx64/x64/cl.exe")
|
||||||
|
set(CMAKE_CXX_COMPILER_ARG1 "")
|
||||||
|
set(CMAKE_CXX_COMPILER_ID "MSVC")
|
||||||
|
set(CMAKE_CXX_COMPILER_VERSION "19.51.36260.0")
|
||||||
|
set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "")
|
||||||
|
set(CMAKE_CXX_COMPILER_WRAPPER "")
|
||||||
|
set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14")
|
||||||
|
set(CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT "OFF")
|
||||||
|
set(CMAKE_CXX_STANDARD_LATEST "23")
|
||||||
|
set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20;cxx_std_23")
|
||||||
|
set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters")
|
||||||
|
set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates")
|
||||||
|
set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates")
|
||||||
|
set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17")
|
||||||
|
set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20")
|
||||||
|
set(CMAKE_CXX23_COMPILE_FEATURES "cxx_std_23")
|
||||||
|
set(CMAKE_CXX26_COMPILE_FEATURES "")
|
||||||
|
|
||||||
|
set(CMAKE_CXX_PLATFORM_ID "Windows")
|
||||||
|
set(CMAKE_CXX_SIMULATE_ID "")
|
||||||
|
set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "MSVC")
|
||||||
|
set(CMAKE_CXX_COMPILER_APPLE_SYSROOT "")
|
||||||
|
set(CMAKE_CXX_SIMULATE_VERSION "")
|
||||||
|
set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID "x64")
|
||||||
|
|
||||||
|
set(MSVC_CXX_ARCHITECTURE_ID x64)
|
||||||
|
|
||||||
|
|
||||||
|
set(CMAKE_AR "C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.51.36231/bin/Hostx64/x64/lib.exe")
|
||||||
|
set(CMAKE_CXX_COMPILER_AR "")
|
||||||
|
set(CMAKE_RANLIB ":")
|
||||||
|
set(CMAKE_CXX_COMPILER_RANLIB "")
|
||||||
|
set(CMAKE_LINKER "C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.51.36231/bin/Hostx64/x64/link.exe")
|
||||||
|
set(CMAKE_LINKER_LINK "C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.51.36231/bin/Hostx64/x64/link.exe")
|
||||||
|
set(CMAKE_LINKER_LLD "lld-link")
|
||||||
|
set(CMAKE_CXX_COMPILER_LINKER "C:/PROGRA~1/MICROS~1/18/COMMUN~1/VC/Tools/MSVC/1451~1.362/bin/Hostx64/x64/link.exe")
|
||||||
|
set(CMAKE_CXX_COMPILER_LINKER_ID "MSVC")
|
||||||
|
set(CMAKE_CXX_COMPILER_LINKER_VERSION 14.51.36260.0)
|
||||||
|
set(CMAKE_CXX_COMPILER_LINKER_FRONTEND_VARIANT MSVC)
|
||||||
|
set(CMAKE_MT "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64/mt.exe")
|
||||||
|
set(CMAKE_TAPI "")
|
||||||
|
set(CMAKE_COMPILER_IS_GNUCXX )
|
||||||
|
set(CMAKE_CXX_COMPILER_LOADED 1)
|
||||||
|
set(CMAKE_CXX_COMPILER_WORKS TRUE)
|
||||||
|
set(CMAKE_CXX_ABI_COMPILED TRUE)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
|
||||||
|
|
||||||
|
set(CMAKE_CXX_COMPILER_ID_RUN 1)
|
||||||
|
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm;ccm;cxxm;c++m)
|
||||||
|
set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||||
|
|
||||||
|
foreach (lang IN ITEMS C OBJC OBJCXX)
|
||||||
|
if (CMAKE_${lang}_COMPILER_ID_RUN)
|
||||||
|
foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS)
|
||||||
|
list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension})
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
set(CMAKE_CXX_LINKER_PREFERENCE 30)
|
||||||
|
set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
|
||||||
|
set(CMAKE_CXX_LINKER_DEPFILE_SUPPORTED )
|
||||||
|
set(CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED )
|
||||||
|
set(CMAKE_CXX_LINKER_PUSHPOP_STATE_SUPPORTED )
|
||||||
|
|
||||||
|
# Save compiler ABI information.
|
||||||
|
set(CMAKE_CXX_SIZEOF_DATA_PTR "8")
|
||||||
|
set(CMAKE_CXX_COMPILER_ABI "")
|
||||||
|
set(CMAKE_CXX_BYTE_ORDER "LITTLE_ENDIAN")
|
||||||
|
set(CMAKE_CXX_LIBRARY_ARCHITECTURE "")
|
||||||
|
|
||||||
|
if(CMAKE_CXX_SIZEOF_DATA_PTR)
|
||||||
|
set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_CXX_COMPILER_ABI)
|
||||||
|
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
|
||||||
|
set(CMAKE_LIBRARY_ARCHITECTURE "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "Note: including file: ")
|
||||||
|
if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX)
|
||||||
|
set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "")
|
||||||
|
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
|
||||||
|
set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "")
|
||||||
|
set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
|
||||||
|
set(CMAKE_CXX_COMPILER_CLANG_RESOURCE_DIR "")
|
||||||
|
|
||||||
|
set(CMAKE_CXX_COMPILER_IMPORT_STD "")
|
||||||
|
set(CMAKE_CXX_COMPILER_IMPORT_STD_ERROR_MESSAGE "Experimental `import std` support not enabled when detecting toolchain; it must be set before `CXX` is enabled (usually a `project()` call)")
|
||||||
|
set(CMAKE_CXX_STDLIB_MODULES_JSON "")
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,6 @@
|
|||||||
|
set(CMAKE_RC_COMPILER "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64/rc.exe")
|
||||||
|
set(CMAKE_RC_COMPILER_ARG1 "")
|
||||||
|
set(CMAKE_RC_COMPILER_LOADED 1)
|
||||||
|
set(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc;RC)
|
||||||
|
set(CMAKE_RC_OUTPUT_EXTENSION .res)
|
||||||
|
set(CMAKE_RC_COMPILER_ENV_VAR "RC")
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
set(CMAKE_HOST_SYSTEM "Windows-10.0.19045")
|
||||||
|
set(CMAKE_HOST_SYSTEM_NAME "Windows")
|
||||||
|
set(CMAKE_HOST_SYSTEM_VERSION "10.0.19045")
|
||||||
|
set(CMAKE_HOST_SYSTEM_PROCESSOR "AMD64")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set(CMAKE_SYSTEM "Windows-10.0.19045")
|
||||||
|
set(CMAKE_SYSTEM_NAME "Windows")
|
||||||
|
set(CMAKE_SYSTEM_VERSION "10.0.19045")
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR "AMD64")
|
||||||
|
|
||||||
|
set(CMAKE_CROSSCOMPILING "FALSE")
|
||||||
|
|
||||||
|
set(CMAKE_SYSTEM_LOADED 1)
|
||||||
@@ -0,0 +1,934 @@
|
|||||||
|
#ifdef __cplusplus
|
||||||
|
# error "A C++ compiler has been selected for C."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__18CXX)
|
||||||
|
# define ID_VOID_MAIN
|
||||||
|
#endif
|
||||||
|
#if defined(__CLASSIC_C__)
|
||||||
|
/* cv-qualifiers did not exist in K&R C */
|
||||||
|
# define const
|
||||||
|
# define volatile
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(__has_include)
|
||||||
|
/* If the compiler does not have __has_include, pretend the answer is
|
||||||
|
always no. */
|
||||||
|
# define __has_include(x) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* Version number components: V=Version, R=Revision, P=Patch
|
||||||
|
Version date components: YYYY=Year, MM=Month, DD=Day */
|
||||||
|
|
||||||
|
#if defined(__INTEL_COMPILER) || defined(__ICC)
|
||||||
|
# define COMPILER_ID "Intel"
|
||||||
|
# if defined(_MSC_VER)
|
||||||
|
# define SIMULATE_ID "MSVC"
|
||||||
|
# endif
|
||||||
|
# if defined(__GNUC__)
|
||||||
|
# define SIMULATE_ID "GNU"
|
||||||
|
# endif
|
||||||
|
/* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later,
|
||||||
|
except that a few beta releases use the old format with V=2021. */
|
||||||
|
# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
|
||||||
|
# if defined(__INTEL_COMPILER_UPDATE)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
|
||||||
|
# else
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
|
||||||
|
# endif
|
||||||
|
# else
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE)
|
||||||
|
/* The third version component from --version is an update index,
|
||||||
|
but no macro is provided for it. */
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(0)
|
||||||
|
# endif
|
||||||
|
# if defined(__INTEL_COMPILER_BUILD_DATE)
|
||||||
|
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
|
||||||
|
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
|
||||||
|
# endif
|
||||||
|
# if defined(_MSC_VER)
|
||||||
|
/* _MSC_VER = VVRR */
|
||||||
|
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||||
|
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||||
|
# endif
|
||||||
|
# if defined(__GNUC__)
|
||||||
|
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
|
||||||
|
# elif defined(__GNUG__)
|
||||||
|
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
|
||||||
|
# endif
|
||||||
|
# if defined(__GNUC_MINOR__)
|
||||||
|
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||||
|
# endif
|
||||||
|
# if defined(__GNUC_PATCHLEVEL__)
|
||||||
|
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER)
|
||||||
|
# define COMPILER_ID "IntelLLVM"
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
# define SIMULATE_ID "MSVC"
|
||||||
|
#endif
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
# define SIMULATE_ID "GNU"
|
||||||
|
#endif
|
||||||
|
/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and
|
||||||
|
* later. Look for 6 digit vs. 8 digit version number to decide encoding.
|
||||||
|
* VVVV is no smaller than the current year when a version is released.
|
||||||
|
*/
|
||||||
|
#if __INTEL_LLVM_COMPILER < 1000000L
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10)
|
||||||
|
#else
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100)
|
||||||
|
#endif
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
/* _MSC_VER = VVRR */
|
||||||
|
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||||
|
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||||
|
#endif
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
|
||||||
|
#elif defined(__GNUG__)
|
||||||
|
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
|
||||||
|
#endif
|
||||||
|
#if defined(__GNUC_MINOR__)
|
||||||
|
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||||
|
#endif
|
||||||
|
#if defined(__GNUC_PATCHLEVEL__)
|
||||||
|
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#elif defined(__PATHCC__)
|
||||||
|
# define COMPILER_ID "PathScale"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
|
||||||
|
# if defined(__PATHCC_PATCHLEVEL__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
|
||||||
|
# define COMPILER_ID "Embarcadero"
|
||||||
|
# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
|
||||||
|
# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
|
||||||
|
|
||||||
|
#elif defined(__BORLANDC__)
|
||||||
|
# define COMPILER_ID "Borland"
|
||||||
|
/* __BORLANDC__ = 0xVRR */
|
||||||
|
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
|
||||||
|
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
|
||||||
|
|
||||||
|
#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
|
||||||
|
# define COMPILER_ID "Watcom"
|
||||||
|
/* __WATCOMC__ = VVRR */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||||
|
# if (__WATCOMC__ % 10) > 0
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__WATCOMC__)
|
||||||
|
# define COMPILER_ID "OpenWatcom"
|
||||||
|
/* __WATCOMC__ = VVRP + 1100 */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||||
|
# if (__WATCOMC__ % 10) > 0
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__SUNPRO_C)
|
||||||
|
# define COMPILER_ID "SunPro"
|
||||||
|
# if __SUNPRO_C >= 0x5100
|
||||||
|
/* __SUNPRO_C = 0xVRRP */
|
||||||
|
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12)
|
||||||
|
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF)
|
||||||
|
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
|
||||||
|
# else
|
||||||
|
/* __SUNPRO_CC = 0xVRP */
|
||||||
|
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8)
|
||||||
|
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF)
|
||||||
|
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__HP_cc)
|
||||||
|
# define COMPILER_ID "HP"
|
||||||
|
/* __HP_cc = VVRRPP */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100)
|
||||||
|
|
||||||
|
#elif defined(__DECC)
|
||||||
|
# define COMPILER_ID "Compaq"
|
||||||
|
/* __DECC_VER = VVRRTPPPP */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000)
|
||||||
|
|
||||||
|
#elif defined(__IBMC__) && defined(__COMPILER_VER__)
|
||||||
|
# define COMPILER_ID "zOS"
|
||||||
|
/* __IBMC__ = VRP */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
|
||||||
|
|
||||||
|
#elif defined(__open_xl__) && defined(__clang__)
|
||||||
|
# define COMPILER_ID "IBMClang"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__open_xl_release__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__)
|
||||||
|
# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__)
|
||||||
|
# define COMPILER_VERSION_INTERNAL_STR __clang_version__
|
||||||
|
|
||||||
|
|
||||||
|
#elif defined(__ibmxl__) && defined(__clang__)
|
||||||
|
# define COMPILER_ID "XLClang"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
|
||||||
|
# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
|
||||||
|
|
||||||
|
|
||||||
|
#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800
|
||||||
|
# define COMPILER_ID "XL"
|
||||||
|
/* __IBMC__ = VRP */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
|
||||||
|
|
||||||
|
#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800
|
||||||
|
# define COMPILER_ID "VisualAge"
|
||||||
|
/* __IBMC__ = VRP */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
|
||||||
|
|
||||||
|
#elif defined(__NVCOMPILER)
|
||||||
|
# define COMPILER_ID "NVHPC"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__)
|
||||||
|
# if defined(__NVCOMPILER_PATCHLEVEL__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__PGI)
|
||||||
|
# define COMPILER_ID "PGI"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
|
||||||
|
# if defined(__PGIC_PATCHLEVEL__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__clang__) && defined(__cray__)
|
||||||
|
# define COMPILER_ID "CrayClang"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__cray_major__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__cray_minor__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__)
|
||||||
|
# define COMPILER_VERSION_INTERNAL_STR __clang_version__
|
||||||
|
|
||||||
|
|
||||||
|
#elif defined(_CRAYC)
|
||||||
|
# define COMPILER_ID "Cray"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
|
||||||
|
|
||||||
|
#elif defined(__TI_COMPILER_VERSION__)
|
||||||
|
# define COMPILER_ID "TI"
|
||||||
|
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
|
||||||
|
|
||||||
|
#elif defined(__CLANG_FUJITSU)
|
||||||
|
# define COMPILER_ID "FujitsuClang"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
|
||||||
|
# define COMPILER_VERSION_INTERNAL_STR __clang_version__
|
||||||
|
|
||||||
|
|
||||||
|
#elif defined(__FUJITSU)
|
||||||
|
# define COMPILER_ID "Fujitsu"
|
||||||
|
# if defined(__FCC_version__)
|
||||||
|
# define COMPILER_VERSION __FCC_version__
|
||||||
|
# elif defined(__FCC_major__)
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
|
||||||
|
# endif
|
||||||
|
# if defined(__fcc_version)
|
||||||
|
# define COMPILER_VERSION_INTERNAL DEC(__fcc_version)
|
||||||
|
# elif defined(__FCC_VERSION)
|
||||||
|
# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
|
||||||
|
#elif defined(__ghs__)
|
||||||
|
# define COMPILER_ID "GHS"
|
||||||
|
/* __GHS_VERSION_NUMBER = VVVVRP */
|
||||||
|
# ifdef __GHS_VERSION_NUMBER
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__TASKING__)
|
||||||
|
# define COMPILER_ID "Tasking"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100)
|
||||||
|
# define COMPILER_VERSION_INTERNAL DEC(__VERSION__)
|
||||||
|
|
||||||
|
#elif defined(__ORANGEC__)
|
||||||
|
# define COMPILER_ID "OrangeC"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__)
|
||||||
|
|
||||||
|
#elif defined(__RENESAS__)
|
||||||
|
# define COMPILER_ID "Renesas"
|
||||||
|
/* __RENESAS_VERSION__ = 0xVVRRPP00 */
|
||||||
|
# define COMPILER_VERSION_MAJOR HEX(__RENESAS_VERSION__ >> 24 & 0xFF)
|
||||||
|
# define COMPILER_VERSION_MINOR HEX(__RENESAS_VERSION__ >> 16 & 0xFF)
|
||||||
|
# define COMPILER_VERSION_PATCH HEX(__RENESAS_VERSION__ >> 8 & 0xFF)
|
||||||
|
|
||||||
|
#elif defined(__TINYC__)
|
||||||
|
# define COMPILER_ID "TinyCC"
|
||||||
|
|
||||||
|
#elif defined(__BCC__)
|
||||||
|
# define COMPILER_ID "Bruce"
|
||||||
|
|
||||||
|
#elif defined(__SCO_VERSION__)
|
||||||
|
# define COMPILER_ID "SCO"
|
||||||
|
|
||||||
|
#elif defined(__ARMCC_VERSION) && !defined(__clang__)
|
||||||
|
# define COMPILER_ID "ARMCC"
|
||||||
|
#if __ARMCC_VERSION >= 1000000
|
||||||
|
/* __ARMCC_VERSION = VRRPPPP */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
|
||||||
|
#else
|
||||||
|
/* __ARMCC_VERSION = VRPPPP */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#elif defined(__clang__) && defined(__apple_build_version__)
|
||||||
|
# define COMPILER_ID "AppleClang"
|
||||||
|
# if defined(_MSC_VER)
|
||||||
|
# define SIMULATE_ID "MSVC"
|
||||||
|
# endif
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
||||||
|
# if defined(_MSC_VER)
|
||||||
|
/* _MSC_VER = VVRR */
|
||||||
|
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||||
|
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||||
|
# endif
|
||||||
|
# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
|
||||||
|
|
||||||
|
#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
|
||||||
|
# define COMPILER_ID "ARMClang"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100)
|
||||||
|
# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
|
||||||
|
|
||||||
|
#elif defined(__clang__) && defined(__ti__)
|
||||||
|
# define COMPILER_ID "TIClang"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__ti_major__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__ti_minor__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__)
|
||||||
|
# define COMPILER_VERSION_INTERNAL DEC(__ti_version__)
|
||||||
|
|
||||||
|
#elif defined(__clang__)
|
||||||
|
# define COMPILER_ID "Clang"
|
||||||
|
# if defined(_MSC_VER)
|
||||||
|
# define SIMULATE_ID "MSVC"
|
||||||
|
# endif
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
||||||
|
# if defined(_MSC_VER)
|
||||||
|
/* _MSC_VER = VVRR */
|
||||||
|
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||||
|
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__))
|
||||||
|
# define COMPILER_ID "LCC"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100)
|
||||||
|
# if defined(__LCC_MINOR__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__)
|
||||||
|
# endif
|
||||||
|
# if defined(__GNUC__) && defined(__GNUC_MINOR__)
|
||||||
|
# define SIMULATE_ID "GNU"
|
||||||
|
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
|
||||||
|
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||||
|
# if defined(__GNUC_PATCHLEVEL__)
|
||||||
|
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
# define COMPILER_ID "GNU"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
|
||||||
|
# if defined(__GNUC_MINOR__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||||
|
# endif
|
||||||
|
# if defined(__GNUC_PATCHLEVEL__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
# define COMPILER_ID "MSVC"
|
||||||
|
/* _MSC_VER = VVRR */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||||
|
# if defined(_MSC_FULL_VER)
|
||||||
|
# if _MSC_VER >= 1400
|
||||||
|
/* _MSC_FULL_VER = VVRRPPPPP */
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
|
||||||
|
# else
|
||||||
|
/* _MSC_FULL_VER = VVRRPPPP */
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
# if defined(_MSC_BUILD)
|
||||||
|
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(_ADI_COMPILER)
|
||||||
|
# define COMPILER_ID "ADSP"
|
||||||
|
#if defined(__VERSIONNUM__)
|
||||||
|
/* __VERSIONNUM__ = 0xVVRRPPTT */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF)
|
||||||
|
# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
|
||||||
|
# define COMPILER_ID "IAR"
|
||||||
|
# if defined(__VER__) && defined(__ICCARM__)
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
|
||||||
|
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
|
||||||
|
# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__))
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
|
||||||
|
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__DCC__) && defined(_DIAB_TOOL)
|
||||||
|
# define COMPILER_ID "Diab"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__VERSION_MAJOR_NUMBER__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__VERSION_MINOR_NUMBER__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__VERSION_ARCH_FEATURE_NUMBER__)
|
||||||
|
# define COMPILER_VERSION_TWEAK DEC(__VERSION_BUG_FIX_NUMBER__)
|
||||||
|
|
||||||
|
|
||||||
|
#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC)
|
||||||
|
# define COMPILER_ID "SDCC"
|
||||||
|
# if defined(__SDCC_VERSION_MAJOR)
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH)
|
||||||
|
# else
|
||||||
|
/* SDCC = VRP */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(SDCC/100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(SDCC % 10)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
|
||||||
|
/* These compilers are either not known or too old to define an
|
||||||
|
identification macro. Try to identify the platform and guess that
|
||||||
|
it is the native compiler. */
|
||||||
|
#elif defined(__hpux) || defined(__hpua)
|
||||||
|
# define COMPILER_ID "HP"
|
||||||
|
|
||||||
|
#else /* unknown compiler */
|
||||||
|
# define COMPILER_ID ""
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Construct the string literal in pieces to prevent the source from
|
||||||
|
getting matched. Store it in a pointer rather than an array
|
||||||
|
because some compilers will just produce instructions to fill the
|
||||||
|
array rather than assigning a pointer to a static array. */
|
||||||
|
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
|
||||||
|
#ifdef SIMULATE_ID
|
||||||
|
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __QNXNTO__
|
||||||
|
char const* qnxnto = "INFO" ":" "qnxnto[]";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
|
||||||
|
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define STRINGIFY_HELPER(X) #X
|
||||||
|
#define STRINGIFY(X) STRINGIFY_HELPER(X)
|
||||||
|
|
||||||
|
/* Identify known platforms by name. */
|
||||||
|
#if defined(__linux) || defined(__linux__) || defined(linux)
|
||||||
|
# define PLATFORM_ID "Linux"
|
||||||
|
|
||||||
|
#elif defined(__MSYS__)
|
||||||
|
# define PLATFORM_ID "MSYS"
|
||||||
|
|
||||||
|
#elif defined(__CYGWIN__)
|
||||||
|
# define PLATFORM_ID "Cygwin"
|
||||||
|
|
||||||
|
#elif defined(__MINGW32__)
|
||||||
|
# define PLATFORM_ID "MinGW"
|
||||||
|
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
# define PLATFORM_ID "Darwin"
|
||||||
|
|
||||||
|
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
|
||||||
|
# define PLATFORM_ID "Windows"
|
||||||
|
|
||||||
|
#elif defined(__FreeBSD__) || defined(__FreeBSD)
|
||||||
|
# define PLATFORM_ID "FreeBSD"
|
||||||
|
|
||||||
|
#elif defined(__NetBSD__) || defined(__NetBSD)
|
||||||
|
# define PLATFORM_ID "NetBSD"
|
||||||
|
|
||||||
|
#elif defined(__OpenBSD__) || defined(__OPENBSD)
|
||||||
|
# define PLATFORM_ID "OpenBSD"
|
||||||
|
|
||||||
|
#elif defined(__sun) || defined(sun)
|
||||||
|
# define PLATFORM_ID "SunOS"
|
||||||
|
|
||||||
|
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
|
||||||
|
# define PLATFORM_ID "AIX"
|
||||||
|
|
||||||
|
#elif defined(__hpux) || defined(__hpux__)
|
||||||
|
# define PLATFORM_ID "HP-UX"
|
||||||
|
|
||||||
|
#elif defined(__HAIKU__)
|
||||||
|
# define PLATFORM_ID "Haiku"
|
||||||
|
|
||||||
|
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
|
||||||
|
# define PLATFORM_ID "BeOS"
|
||||||
|
|
||||||
|
#elif defined(__QNX__) || defined(__QNXNTO__)
|
||||||
|
# define PLATFORM_ID "QNX"
|
||||||
|
|
||||||
|
#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
|
||||||
|
# define PLATFORM_ID "Tru64"
|
||||||
|
|
||||||
|
#elif defined(__riscos) || defined(__riscos__)
|
||||||
|
# define PLATFORM_ID "RISCos"
|
||||||
|
|
||||||
|
#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
|
||||||
|
# define PLATFORM_ID "SINIX"
|
||||||
|
|
||||||
|
#elif defined(__UNIX_SV__)
|
||||||
|
# define PLATFORM_ID "UNIX_SV"
|
||||||
|
|
||||||
|
#elif defined(__bsdos__)
|
||||||
|
# define PLATFORM_ID "BSDOS"
|
||||||
|
|
||||||
|
#elif defined(_MPRAS) || defined(MPRAS)
|
||||||
|
# define PLATFORM_ID "MP-RAS"
|
||||||
|
|
||||||
|
#elif defined(__osf) || defined(__osf__)
|
||||||
|
# define PLATFORM_ID "OSF1"
|
||||||
|
|
||||||
|
#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
|
||||||
|
# define PLATFORM_ID "SCO_SV"
|
||||||
|
|
||||||
|
#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
|
||||||
|
# define PLATFORM_ID "ULTRIX"
|
||||||
|
|
||||||
|
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
|
||||||
|
# define PLATFORM_ID "Xenix"
|
||||||
|
|
||||||
|
#elif defined(__WATCOMC__)
|
||||||
|
# if defined(__LINUX__)
|
||||||
|
# define PLATFORM_ID "Linux"
|
||||||
|
|
||||||
|
# elif defined(__DOS__)
|
||||||
|
# define PLATFORM_ID "DOS"
|
||||||
|
|
||||||
|
# elif defined(__OS2__)
|
||||||
|
# define PLATFORM_ID "OS2"
|
||||||
|
|
||||||
|
# elif defined(__WINDOWS__)
|
||||||
|
# define PLATFORM_ID "Windows3x"
|
||||||
|
|
||||||
|
# elif defined(__VXWORKS__)
|
||||||
|
# define PLATFORM_ID "VxWorks"
|
||||||
|
|
||||||
|
# else /* unknown platform */
|
||||||
|
# define PLATFORM_ID
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__INTEGRITY)
|
||||||
|
# if defined(INT_178B)
|
||||||
|
# define PLATFORM_ID "Integrity178"
|
||||||
|
|
||||||
|
# else /* regular Integrity */
|
||||||
|
# define PLATFORM_ID "Integrity"
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# elif defined(_ADI_COMPILER)
|
||||||
|
# define PLATFORM_ID "ADSP"
|
||||||
|
|
||||||
|
#else /* unknown platform */
|
||||||
|
# define PLATFORM_ID
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* For windows compilers MSVC and Intel we can determine
|
||||||
|
the architecture of the compiler being used. This is because
|
||||||
|
the compilers do not have flags that can change the architecture,
|
||||||
|
but rather depend on which compiler is being used
|
||||||
|
*/
|
||||||
|
#if defined(_WIN32) && defined(_MSC_VER)
|
||||||
|
# if defined(_M_IA64)
|
||||||
|
# define ARCHITECTURE_ID "IA64"
|
||||||
|
|
||||||
|
# elif defined(_M_ARM64EC)
|
||||||
|
# define ARCHITECTURE_ID "ARM64EC"
|
||||||
|
|
||||||
|
# elif defined(_M_X64) || defined(_M_AMD64)
|
||||||
|
# define ARCHITECTURE_ID "x64"
|
||||||
|
|
||||||
|
# elif defined(_M_IX86)
|
||||||
|
# define ARCHITECTURE_ID "X86"
|
||||||
|
|
||||||
|
# elif defined(_M_ARM64)
|
||||||
|
# define ARCHITECTURE_ID "ARM64"
|
||||||
|
|
||||||
|
# elif defined(_M_ARM)
|
||||||
|
# if _M_ARM == 4
|
||||||
|
# define ARCHITECTURE_ID "ARMV4I"
|
||||||
|
# elif _M_ARM == 5
|
||||||
|
# define ARCHITECTURE_ID "ARMV5I"
|
||||||
|
# else
|
||||||
|
# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# elif defined(_M_MIPS)
|
||||||
|
# define ARCHITECTURE_ID "MIPS"
|
||||||
|
|
||||||
|
# elif defined(_M_SH)
|
||||||
|
# define ARCHITECTURE_ID "SHx"
|
||||||
|
|
||||||
|
# else /* unknown architecture */
|
||||||
|
# define ARCHITECTURE_ID ""
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__WATCOMC__)
|
||||||
|
# if defined(_M_I86)
|
||||||
|
# define ARCHITECTURE_ID "I86"
|
||||||
|
|
||||||
|
# elif defined(_M_IX86)
|
||||||
|
# define ARCHITECTURE_ID "X86"
|
||||||
|
|
||||||
|
# else /* unknown architecture */
|
||||||
|
# define ARCHITECTURE_ID ""
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
|
||||||
|
# if defined(__ICCARM__)
|
||||||
|
# define ARCHITECTURE_ID "ARM"
|
||||||
|
|
||||||
|
# elif defined(__ICCRX__)
|
||||||
|
# define ARCHITECTURE_ID "RX"
|
||||||
|
|
||||||
|
# elif defined(__ICCRH850__)
|
||||||
|
# define ARCHITECTURE_ID "RH850"
|
||||||
|
|
||||||
|
# elif defined(__ICCRL78__)
|
||||||
|
# define ARCHITECTURE_ID "RL78"
|
||||||
|
|
||||||
|
# elif defined(__ICCRISCV__)
|
||||||
|
# define ARCHITECTURE_ID "RISCV"
|
||||||
|
|
||||||
|
# elif defined(__ICCAVR__)
|
||||||
|
# define ARCHITECTURE_ID "AVR"
|
||||||
|
|
||||||
|
# elif defined(__ICC430__)
|
||||||
|
# define ARCHITECTURE_ID "MSP430"
|
||||||
|
|
||||||
|
# elif defined(__ICCV850__)
|
||||||
|
# define ARCHITECTURE_ID "V850"
|
||||||
|
|
||||||
|
# elif defined(__ICC8051__)
|
||||||
|
# define ARCHITECTURE_ID "8051"
|
||||||
|
|
||||||
|
# elif defined(__ICCSTM8__)
|
||||||
|
# define ARCHITECTURE_ID "STM8"
|
||||||
|
|
||||||
|
# else /* unknown architecture */
|
||||||
|
# define ARCHITECTURE_ID ""
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__ghs__)
|
||||||
|
# if defined(__PPC64__)
|
||||||
|
# define ARCHITECTURE_ID "PPC64"
|
||||||
|
|
||||||
|
# elif defined(__ppc__)
|
||||||
|
# define ARCHITECTURE_ID "PPC"
|
||||||
|
|
||||||
|
# elif defined(__ARM__)
|
||||||
|
# define ARCHITECTURE_ID "ARM"
|
||||||
|
|
||||||
|
# elif defined(__x86_64__)
|
||||||
|
# define ARCHITECTURE_ID "x64"
|
||||||
|
|
||||||
|
# elif defined(__i386__)
|
||||||
|
# define ARCHITECTURE_ID "X86"
|
||||||
|
|
||||||
|
# else /* unknown architecture */
|
||||||
|
# define ARCHITECTURE_ID ""
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__clang__) && defined(__ti__)
|
||||||
|
# if defined(__ARM_ARCH)
|
||||||
|
# define ARCHITECTURE_ID "ARM"
|
||||||
|
|
||||||
|
# else /* unknown architecture */
|
||||||
|
# define ARCHITECTURE_ID ""
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__TI_COMPILER_VERSION__)
|
||||||
|
# if defined(__TI_ARM__)
|
||||||
|
# define ARCHITECTURE_ID "ARM"
|
||||||
|
|
||||||
|
# elif defined(__MSP430__)
|
||||||
|
# define ARCHITECTURE_ID "MSP430"
|
||||||
|
|
||||||
|
# elif defined(__TMS320C28XX__)
|
||||||
|
# define ARCHITECTURE_ID "TMS320C28x"
|
||||||
|
|
||||||
|
# elif defined(__TMS320C6X__) || defined(_TMS320C6X)
|
||||||
|
# define ARCHITECTURE_ID "TMS320C6x"
|
||||||
|
|
||||||
|
# else /* unknown architecture */
|
||||||
|
# define ARCHITECTURE_ID ""
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# elif defined(__ADSPSHARC__)
|
||||||
|
# define ARCHITECTURE_ID "SHARC"
|
||||||
|
|
||||||
|
# elif defined(__ADSPBLACKFIN__)
|
||||||
|
# define ARCHITECTURE_ID "Blackfin"
|
||||||
|
|
||||||
|
#elif defined(__TASKING__)
|
||||||
|
|
||||||
|
# if defined(__CTC__) || defined(__CPTC__)
|
||||||
|
# define ARCHITECTURE_ID "TriCore"
|
||||||
|
|
||||||
|
# elif defined(__CMCS__)
|
||||||
|
# define ARCHITECTURE_ID "MCS"
|
||||||
|
|
||||||
|
# elif defined(__CARM__) || defined(__CPARM__)
|
||||||
|
# define ARCHITECTURE_ID "ARM"
|
||||||
|
|
||||||
|
# elif defined(__CARC__)
|
||||||
|
# define ARCHITECTURE_ID "ARC"
|
||||||
|
|
||||||
|
# elif defined(__C51__)
|
||||||
|
# define ARCHITECTURE_ID "8051"
|
||||||
|
|
||||||
|
# elif defined(__CPCP__)
|
||||||
|
# define ARCHITECTURE_ID "PCP"
|
||||||
|
|
||||||
|
# else
|
||||||
|
# define ARCHITECTURE_ID ""
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__RENESAS__)
|
||||||
|
# if defined(__CCRX__)
|
||||||
|
# define ARCHITECTURE_ID "RX"
|
||||||
|
|
||||||
|
# elif defined(__CCRL__)
|
||||||
|
# define ARCHITECTURE_ID "RL78"
|
||||||
|
|
||||||
|
# elif defined(__CCRH__)
|
||||||
|
# define ARCHITECTURE_ID "RH850"
|
||||||
|
|
||||||
|
# else
|
||||||
|
# define ARCHITECTURE_ID ""
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#else
|
||||||
|
# define ARCHITECTURE_ID
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Convert integer to decimal digit literals. */
|
||||||
|
#define DEC(n) \
|
||||||
|
('0' + (((n) / 10000000)%10)), \
|
||||||
|
('0' + (((n) / 1000000)%10)), \
|
||||||
|
('0' + (((n) / 100000)%10)), \
|
||||||
|
('0' + (((n) / 10000)%10)), \
|
||||||
|
('0' + (((n) / 1000)%10)), \
|
||||||
|
('0' + (((n) / 100)%10)), \
|
||||||
|
('0' + (((n) / 10)%10)), \
|
||||||
|
('0' + ((n) % 10))
|
||||||
|
|
||||||
|
/* Convert integer to hex digit literals. */
|
||||||
|
#define HEX(n) \
|
||||||
|
('0' + ((n)>>28 & 0xF)), \
|
||||||
|
('0' + ((n)>>24 & 0xF)), \
|
||||||
|
('0' + ((n)>>20 & 0xF)), \
|
||||||
|
('0' + ((n)>>16 & 0xF)), \
|
||||||
|
('0' + ((n)>>12 & 0xF)), \
|
||||||
|
('0' + ((n)>>8 & 0xF)), \
|
||||||
|
('0' + ((n)>>4 & 0xF)), \
|
||||||
|
('0' + ((n) & 0xF))
|
||||||
|
|
||||||
|
/* Construct a string literal encoding the version number. */
|
||||||
|
#ifdef COMPILER_VERSION
|
||||||
|
char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]";
|
||||||
|
|
||||||
|
/* Construct a string literal encoding the version number components. */
|
||||||
|
#elif defined(COMPILER_VERSION_MAJOR)
|
||||||
|
char const info_version[] = {
|
||||||
|
'I', 'N', 'F', 'O', ':',
|
||||||
|
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
|
||||||
|
COMPILER_VERSION_MAJOR,
|
||||||
|
# ifdef COMPILER_VERSION_MINOR
|
||||||
|
'.', COMPILER_VERSION_MINOR,
|
||||||
|
# ifdef COMPILER_VERSION_PATCH
|
||||||
|
'.', COMPILER_VERSION_PATCH,
|
||||||
|
# ifdef COMPILER_VERSION_TWEAK
|
||||||
|
'.', COMPILER_VERSION_TWEAK,
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
']','\0'};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Construct a string literal encoding the internal version number. */
|
||||||
|
#ifdef COMPILER_VERSION_INTERNAL
|
||||||
|
char const info_version_internal[] = {
|
||||||
|
'I', 'N', 'F', 'O', ':',
|
||||||
|
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
|
||||||
|
'i','n','t','e','r','n','a','l','[',
|
||||||
|
COMPILER_VERSION_INTERNAL,']','\0'};
|
||||||
|
#elif defined(COMPILER_VERSION_INTERNAL_STR)
|
||||||
|
char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Construct a string literal encoding the version number components. */
|
||||||
|
#ifdef SIMULATE_VERSION_MAJOR
|
||||||
|
char const info_simulate_version[] = {
|
||||||
|
'I', 'N', 'F', 'O', ':',
|
||||||
|
's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
|
||||||
|
SIMULATE_VERSION_MAJOR,
|
||||||
|
# ifdef SIMULATE_VERSION_MINOR
|
||||||
|
'.', SIMULATE_VERSION_MINOR,
|
||||||
|
# ifdef SIMULATE_VERSION_PATCH
|
||||||
|
'.', SIMULATE_VERSION_PATCH,
|
||||||
|
# ifdef SIMULATE_VERSION_TWEAK
|
||||||
|
'.', SIMULATE_VERSION_TWEAK,
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
']','\0'};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Construct the string literal in pieces to prevent the source from
|
||||||
|
getting matched. Store it in a pointer rather than an array
|
||||||
|
because some compilers will just produce instructions to fill the
|
||||||
|
array rather than assigning a pointer to a static array. */
|
||||||
|
char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
|
||||||
|
char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define C_STD_99 199901L
|
||||||
|
#define C_STD_11 201112L
|
||||||
|
#define C_STD_17 201710L
|
||||||
|
#define C_STD_23 202311L
|
||||||
|
|
||||||
|
#ifdef __STDC_VERSION__
|
||||||
|
# define C_STD __STDC_VERSION__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(__STDC__) && !defined(__clang__) && !defined(__RENESAS__)
|
||||||
|
# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__)
|
||||||
|
# define C_VERSION "90"
|
||||||
|
# else
|
||||||
|
# define C_VERSION
|
||||||
|
# endif
|
||||||
|
#elif C_STD > C_STD_17
|
||||||
|
# define C_VERSION "23"
|
||||||
|
#elif C_STD > C_STD_11
|
||||||
|
# define C_VERSION "17"
|
||||||
|
#elif C_STD > C_STD_99
|
||||||
|
# define C_VERSION "11"
|
||||||
|
#elif C_STD >= C_STD_99
|
||||||
|
# define C_VERSION "99"
|
||||||
|
#else
|
||||||
|
# define C_VERSION "90"
|
||||||
|
#endif
|
||||||
|
const char* info_language_standard_default =
|
||||||
|
"INFO" ":" "standard_default[" C_VERSION "]";
|
||||||
|
|
||||||
|
const char* info_language_extensions_default = "INFO" ":" "extensions_default["
|
||||||
|
#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
|
||||||
|
defined(__TI_COMPILER_VERSION__) || defined(__RENESAS__)) && \
|
||||||
|
!defined(__STRICT_ANSI__)
|
||||||
|
"ON"
|
||||||
|
#else
|
||||||
|
"OFF"
|
||||||
|
#endif
|
||||||
|
"]";
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifdef ID_VOID_MAIN
|
||||||
|
void main() {}
|
||||||
|
#else
|
||||||
|
# if defined(__CLASSIC_C__)
|
||||||
|
int main(argc, argv) int argc; char *argv[];
|
||||||
|
# else
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
# endif
|
||||||
|
{
|
||||||
|
int require = 0;
|
||||||
|
require += info_compiler[argc];
|
||||||
|
require += info_platform[argc];
|
||||||
|
require += info_arch[argc];
|
||||||
|
#ifdef COMPILER_VERSION_MAJOR
|
||||||
|
require += info_version[argc];
|
||||||
|
#endif
|
||||||
|
#if defined(COMPILER_VERSION_INTERNAL) || defined(COMPILER_VERSION_INTERNAL_STR)
|
||||||
|
require += info_version_internal[argc];
|
||||||
|
#endif
|
||||||
|
#ifdef SIMULATE_ID
|
||||||
|
require += info_simulate[argc];
|
||||||
|
#endif
|
||||||
|
#ifdef SIMULATE_VERSION_MAJOR
|
||||||
|
require += info_simulate_version[argc];
|
||||||
|
#endif
|
||||||
|
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
|
||||||
|
require += info_cray[argc];
|
||||||
|
#endif
|
||||||
|
require += info_language_standard_default[argc];
|
||||||
|
require += info_language_extensions_default[argc];
|
||||||
|
(void)argv;
|
||||||
|
return require;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,949 @@
|
|||||||
|
/* This source file must have a .cpp extension so that all C++ compilers
|
||||||
|
recognize the extension without flags. Borland does not know .cxx for
|
||||||
|
example. */
|
||||||
|
#ifndef __cplusplus
|
||||||
|
# error "A C compiler has been selected for C++."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(__has_include)
|
||||||
|
/* If the compiler does not have __has_include, pretend the answer is
|
||||||
|
always no. */
|
||||||
|
# define __has_include(x) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* Version number components: V=Version, R=Revision, P=Patch
|
||||||
|
Version date components: YYYY=Year, MM=Month, DD=Day */
|
||||||
|
|
||||||
|
#if defined(__INTEL_COMPILER) || defined(__ICC)
|
||||||
|
# define COMPILER_ID "Intel"
|
||||||
|
# if defined(_MSC_VER)
|
||||||
|
# define SIMULATE_ID "MSVC"
|
||||||
|
# endif
|
||||||
|
# if defined(__GNUC__)
|
||||||
|
# define SIMULATE_ID "GNU"
|
||||||
|
# endif
|
||||||
|
/* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later,
|
||||||
|
except that a few beta releases use the old format with V=2021. */
|
||||||
|
# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
|
||||||
|
# if defined(__INTEL_COMPILER_UPDATE)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
|
||||||
|
# else
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
|
||||||
|
# endif
|
||||||
|
# else
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE)
|
||||||
|
/* The third version component from --version is an update index,
|
||||||
|
but no macro is provided for it. */
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(0)
|
||||||
|
# endif
|
||||||
|
# if defined(__INTEL_COMPILER_BUILD_DATE)
|
||||||
|
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
|
||||||
|
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
|
||||||
|
# endif
|
||||||
|
# if defined(_MSC_VER)
|
||||||
|
/* _MSC_VER = VVRR */
|
||||||
|
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||||
|
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||||
|
# endif
|
||||||
|
# if defined(__GNUC__)
|
||||||
|
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
|
||||||
|
# elif defined(__GNUG__)
|
||||||
|
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
|
||||||
|
# endif
|
||||||
|
# if defined(__GNUC_MINOR__)
|
||||||
|
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||||
|
# endif
|
||||||
|
# if defined(__GNUC_PATCHLEVEL__)
|
||||||
|
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER)
|
||||||
|
# define COMPILER_ID "IntelLLVM"
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
# define SIMULATE_ID "MSVC"
|
||||||
|
#endif
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
# define SIMULATE_ID "GNU"
|
||||||
|
#endif
|
||||||
|
/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and
|
||||||
|
* later. Look for 6 digit vs. 8 digit version number to decide encoding.
|
||||||
|
* VVVV is no smaller than the current year when a version is released.
|
||||||
|
*/
|
||||||
|
#if __INTEL_LLVM_COMPILER < 1000000L
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10)
|
||||||
|
#else
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100)
|
||||||
|
#endif
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
/* _MSC_VER = VVRR */
|
||||||
|
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||||
|
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||||
|
#endif
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
|
||||||
|
#elif defined(__GNUG__)
|
||||||
|
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
|
||||||
|
#endif
|
||||||
|
#if defined(__GNUC_MINOR__)
|
||||||
|
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||||
|
#endif
|
||||||
|
#if defined(__GNUC_PATCHLEVEL__)
|
||||||
|
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#elif defined(__PATHCC__)
|
||||||
|
# define COMPILER_ID "PathScale"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
|
||||||
|
# if defined(__PATHCC_PATCHLEVEL__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
|
||||||
|
# define COMPILER_ID "Embarcadero"
|
||||||
|
# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
|
||||||
|
# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
|
||||||
|
|
||||||
|
#elif defined(__BORLANDC__)
|
||||||
|
# define COMPILER_ID "Borland"
|
||||||
|
/* __BORLANDC__ = 0xVRR */
|
||||||
|
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
|
||||||
|
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
|
||||||
|
|
||||||
|
#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
|
||||||
|
# define COMPILER_ID "Watcom"
|
||||||
|
/* __WATCOMC__ = VVRR */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||||
|
# if (__WATCOMC__ % 10) > 0
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__WATCOMC__)
|
||||||
|
# define COMPILER_ID "OpenWatcom"
|
||||||
|
/* __WATCOMC__ = VVRP + 1100 */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||||
|
# if (__WATCOMC__ % 10) > 0
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__SUNPRO_CC)
|
||||||
|
# define COMPILER_ID "SunPro"
|
||||||
|
# if __SUNPRO_CC >= 0x5100
|
||||||
|
/* __SUNPRO_CC = 0xVRRP */
|
||||||
|
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
|
||||||
|
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
|
||||||
|
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
|
||||||
|
# else
|
||||||
|
/* __SUNPRO_CC = 0xVRP */
|
||||||
|
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
|
||||||
|
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
|
||||||
|
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__HP_aCC)
|
||||||
|
# define COMPILER_ID "HP"
|
||||||
|
/* __HP_aCC = VVRRPP */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)
|
||||||
|
|
||||||
|
#elif defined(__DECCXX)
|
||||||
|
# define COMPILER_ID "Compaq"
|
||||||
|
/* __DECCXX_VER = VVRRTPPPP */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)
|
||||||
|
|
||||||
|
#elif defined(__IBMCPP__) && defined(__COMPILER_VER__)
|
||||||
|
# define COMPILER_ID "zOS"
|
||||||
|
/* __IBMCPP__ = VRP */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
|
||||||
|
|
||||||
|
#elif defined(__open_xl__) && defined(__clang__)
|
||||||
|
# define COMPILER_ID "IBMClang"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__open_xl_release__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__)
|
||||||
|
# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__)
|
||||||
|
# define COMPILER_VERSION_INTERNAL_STR __clang_version__
|
||||||
|
|
||||||
|
|
||||||
|
#elif defined(__ibmxl__) && defined(__clang__)
|
||||||
|
# define COMPILER_ID "XLClang"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
|
||||||
|
# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
|
||||||
|
|
||||||
|
|
||||||
|
#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800
|
||||||
|
# define COMPILER_ID "XL"
|
||||||
|
/* __IBMCPP__ = VRP */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
|
||||||
|
|
||||||
|
#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800
|
||||||
|
# define COMPILER_ID "VisualAge"
|
||||||
|
/* __IBMCPP__ = VRP */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
|
||||||
|
|
||||||
|
#elif defined(__NVCOMPILER)
|
||||||
|
# define COMPILER_ID "NVHPC"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__)
|
||||||
|
# if defined(__NVCOMPILER_PATCHLEVEL__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__PGI)
|
||||||
|
# define COMPILER_ID "PGI"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
|
||||||
|
# if defined(__PGIC_PATCHLEVEL__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__clang__) && defined(__cray__)
|
||||||
|
# define COMPILER_ID "CrayClang"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__cray_major__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__cray_minor__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__)
|
||||||
|
# define COMPILER_VERSION_INTERNAL_STR __clang_version__
|
||||||
|
|
||||||
|
|
||||||
|
#elif defined(_CRAYC)
|
||||||
|
# define COMPILER_ID "Cray"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
|
||||||
|
|
||||||
|
#elif defined(__TI_COMPILER_VERSION__)
|
||||||
|
# define COMPILER_ID "TI"
|
||||||
|
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
|
||||||
|
|
||||||
|
#elif defined(__CLANG_FUJITSU)
|
||||||
|
# define COMPILER_ID "FujitsuClang"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
|
||||||
|
# define COMPILER_VERSION_INTERNAL_STR __clang_version__
|
||||||
|
|
||||||
|
|
||||||
|
#elif defined(__FUJITSU)
|
||||||
|
# define COMPILER_ID "Fujitsu"
|
||||||
|
# if defined(__FCC_version__)
|
||||||
|
# define COMPILER_VERSION __FCC_version__
|
||||||
|
# elif defined(__FCC_major__)
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
|
||||||
|
# endif
|
||||||
|
# if defined(__fcc_version)
|
||||||
|
# define COMPILER_VERSION_INTERNAL DEC(__fcc_version)
|
||||||
|
# elif defined(__FCC_VERSION)
|
||||||
|
# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
|
||||||
|
#elif defined(__ghs__)
|
||||||
|
# define COMPILER_ID "GHS"
|
||||||
|
/* __GHS_VERSION_NUMBER = VVVVRP */
|
||||||
|
# ifdef __GHS_VERSION_NUMBER
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__TASKING__)
|
||||||
|
# define COMPILER_ID "Tasking"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100)
|
||||||
|
# define COMPILER_VERSION_INTERNAL DEC(__VERSION__)
|
||||||
|
|
||||||
|
#elif defined(__ORANGEC__)
|
||||||
|
# define COMPILER_ID "OrangeC"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__)
|
||||||
|
|
||||||
|
#elif defined(__RENESAS__)
|
||||||
|
# define COMPILER_ID "Renesas"
|
||||||
|
/* __RENESAS_VERSION__ = 0xVVRRPP00 */
|
||||||
|
# define COMPILER_VERSION_MAJOR HEX(__RENESAS_VERSION__ >> 24 & 0xFF)
|
||||||
|
# define COMPILER_VERSION_MINOR HEX(__RENESAS_VERSION__ >> 16 & 0xFF)
|
||||||
|
# define COMPILER_VERSION_PATCH HEX(__RENESAS_VERSION__ >> 8 & 0xFF)
|
||||||
|
|
||||||
|
#elif defined(__SCO_VERSION__)
|
||||||
|
# define COMPILER_ID "SCO"
|
||||||
|
|
||||||
|
#elif defined(__ARMCC_VERSION) && !defined(__clang__)
|
||||||
|
# define COMPILER_ID "ARMCC"
|
||||||
|
#if __ARMCC_VERSION >= 1000000
|
||||||
|
/* __ARMCC_VERSION = VRRPPPP */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
|
||||||
|
#else
|
||||||
|
/* __ARMCC_VERSION = VRPPPP */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#elif defined(__clang__) && defined(__apple_build_version__)
|
||||||
|
# define COMPILER_ID "AppleClang"
|
||||||
|
# if defined(_MSC_VER)
|
||||||
|
# define SIMULATE_ID "MSVC"
|
||||||
|
# endif
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
||||||
|
# if defined(_MSC_VER)
|
||||||
|
/* _MSC_VER = VVRR */
|
||||||
|
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||||
|
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||||
|
# endif
|
||||||
|
# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
|
||||||
|
|
||||||
|
#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
|
||||||
|
# define COMPILER_ID "ARMClang"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100)
|
||||||
|
# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
|
||||||
|
|
||||||
|
#elif defined(__clang__) && defined(__ti__)
|
||||||
|
# define COMPILER_ID "TIClang"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__ti_major__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__ti_minor__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__)
|
||||||
|
# define COMPILER_VERSION_INTERNAL DEC(__ti_version__)
|
||||||
|
|
||||||
|
#elif defined(__clang__)
|
||||||
|
# define COMPILER_ID "Clang"
|
||||||
|
# if defined(_MSC_VER)
|
||||||
|
# define SIMULATE_ID "MSVC"
|
||||||
|
# endif
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
||||||
|
# if defined(_MSC_VER)
|
||||||
|
/* _MSC_VER = VVRR */
|
||||||
|
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||||
|
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__))
|
||||||
|
# define COMPILER_ID "LCC"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100)
|
||||||
|
# if defined(__LCC_MINOR__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__)
|
||||||
|
# endif
|
||||||
|
# if defined(__GNUC__) && defined(__GNUC_MINOR__)
|
||||||
|
# define SIMULATE_ID "GNU"
|
||||||
|
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
|
||||||
|
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||||
|
# if defined(__GNUC_PATCHLEVEL__)
|
||||||
|
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__GNUC__) || defined(__GNUG__)
|
||||||
|
# define COMPILER_ID "GNU"
|
||||||
|
# if defined(__GNUC__)
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
|
||||||
|
# else
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__GNUG__)
|
||||||
|
# endif
|
||||||
|
# if defined(__GNUC_MINOR__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||||
|
# endif
|
||||||
|
# if defined(__GNUC_PATCHLEVEL__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
# define COMPILER_ID "MSVC"
|
||||||
|
/* _MSC_VER = VVRR */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||||
|
# if defined(_MSC_FULL_VER)
|
||||||
|
# if _MSC_VER >= 1400
|
||||||
|
/* _MSC_FULL_VER = VVRRPPPPP */
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
|
||||||
|
# else
|
||||||
|
/* _MSC_FULL_VER = VVRRPPPP */
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
# if defined(_MSC_BUILD)
|
||||||
|
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(_ADI_COMPILER)
|
||||||
|
# define COMPILER_ID "ADSP"
|
||||||
|
#if defined(__VERSIONNUM__)
|
||||||
|
/* __VERSIONNUM__ = 0xVVRRPPTT */
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF)
|
||||||
|
# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
|
||||||
|
# define COMPILER_ID "IAR"
|
||||||
|
# if defined(__VER__) && defined(__ICCARM__)
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
|
||||||
|
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
|
||||||
|
# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__))
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
|
||||||
|
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__DCC__) && defined(_DIAB_TOOL)
|
||||||
|
# define COMPILER_ID "Diab"
|
||||||
|
# define COMPILER_VERSION_MAJOR DEC(__VERSION_MAJOR_NUMBER__)
|
||||||
|
# define COMPILER_VERSION_MINOR DEC(__VERSION_MINOR_NUMBER__)
|
||||||
|
# define COMPILER_VERSION_PATCH DEC(__VERSION_ARCH_FEATURE_NUMBER__)
|
||||||
|
# define COMPILER_VERSION_TWEAK DEC(__VERSION_BUG_FIX_NUMBER__)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* These compilers are either not known or too old to define an
|
||||||
|
identification macro. Try to identify the platform and guess that
|
||||||
|
it is the native compiler. */
|
||||||
|
#elif defined(__hpux) || defined(__hpua)
|
||||||
|
# define COMPILER_ID "HP"
|
||||||
|
|
||||||
|
#else /* unknown compiler */
|
||||||
|
# define COMPILER_ID ""
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Construct the string literal in pieces to prevent the source from
|
||||||
|
getting matched. Store it in a pointer rather than an array
|
||||||
|
because some compilers will just produce instructions to fill the
|
||||||
|
array rather than assigning a pointer to a static array. */
|
||||||
|
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
|
||||||
|
#ifdef SIMULATE_ID
|
||||||
|
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __QNXNTO__
|
||||||
|
char const* qnxnto = "INFO" ":" "qnxnto[]";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
|
||||||
|
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define STRINGIFY_HELPER(X) #X
|
||||||
|
#define STRINGIFY(X) STRINGIFY_HELPER(X)
|
||||||
|
|
||||||
|
/* Identify known platforms by name. */
|
||||||
|
#if defined(__linux) || defined(__linux__) || defined(linux)
|
||||||
|
# define PLATFORM_ID "Linux"
|
||||||
|
|
||||||
|
#elif defined(__MSYS__)
|
||||||
|
# define PLATFORM_ID "MSYS"
|
||||||
|
|
||||||
|
#elif defined(__CYGWIN__)
|
||||||
|
# define PLATFORM_ID "Cygwin"
|
||||||
|
|
||||||
|
#elif defined(__MINGW32__)
|
||||||
|
# define PLATFORM_ID "MinGW"
|
||||||
|
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
# define PLATFORM_ID "Darwin"
|
||||||
|
|
||||||
|
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
|
||||||
|
# define PLATFORM_ID "Windows"
|
||||||
|
|
||||||
|
#elif defined(__FreeBSD__) || defined(__FreeBSD)
|
||||||
|
# define PLATFORM_ID "FreeBSD"
|
||||||
|
|
||||||
|
#elif defined(__NetBSD__) || defined(__NetBSD)
|
||||||
|
# define PLATFORM_ID "NetBSD"
|
||||||
|
|
||||||
|
#elif defined(__OpenBSD__) || defined(__OPENBSD)
|
||||||
|
# define PLATFORM_ID "OpenBSD"
|
||||||
|
|
||||||
|
#elif defined(__sun) || defined(sun)
|
||||||
|
# define PLATFORM_ID "SunOS"
|
||||||
|
|
||||||
|
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
|
||||||
|
# define PLATFORM_ID "AIX"
|
||||||
|
|
||||||
|
#elif defined(__hpux) || defined(__hpux__)
|
||||||
|
# define PLATFORM_ID "HP-UX"
|
||||||
|
|
||||||
|
#elif defined(__HAIKU__)
|
||||||
|
# define PLATFORM_ID "Haiku"
|
||||||
|
|
||||||
|
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
|
||||||
|
# define PLATFORM_ID "BeOS"
|
||||||
|
|
||||||
|
#elif defined(__QNX__) || defined(__QNXNTO__)
|
||||||
|
# define PLATFORM_ID "QNX"
|
||||||
|
|
||||||
|
#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
|
||||||
|
# define PLATFORM_ID "Tru64"
|
||||||
|
|
||||||
|
#elif defined(__riscos) || defined(__riscos__)
|
||||||
|
# define PLATFORM_ID "RISCos"
|
||||||
|
|
||||||
|
#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
|
||||||
|
# define PLATFORM_ID "SINIX"
|
||||||
|
|
||||||
|
#elif defined(__UNIX_SV__)
|
||||||
|
# define PLATFORM_ID "UNIX_SV"
|
||||||
|
|
||||||
|
#elif defined(__bsdos__)
|
||||||
|
# define PLATFORM_ID "BSDOS"
|
||||||
|
|
||||||
|
#elif defined(_MPRAS) || defined(MPRAS)
|
||||||
|
# define PLATFORM_ID "MP-RAS"
|
||||||
|
|
||||||
|
#elif defined(__osf) || defined(__osf__)
|
||||||
|
# define PLATFORM_ID "OSF1"
|
||||||
|
|
||||||
|
#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
|
||||||
|
# define PLATFORM_ID "SCO_SV"
|
||||||
|
|
||||||
|
#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
|
||||||
|
# define PLATFORM_ID "ULTRIX"
|
||||||
|
|
||||||
|
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
|
||||||
|
# define PLATFORM_ID "Xenix"
|
||||||
|
|
||||||
|
#elif defined(__WATCOMC__)
|
||||||
|
# if defined(__LINUX__)
|
||||||
|
# define PLATFORM_ID "Linux"
|
||||||
|
|
||||||
|
# elif defined(__DOS__)
|
||||||
|
# define PLATFORM_ID "DOS"
|
||||||
|
|
||||||
|
# elif defined(__OS2__)
|
||||||
|
# define PLATFORM_ID "OS2"
|
||||||
|
|
||||||
|
# elif defined(__WINDOWS__)
|
||||||
|
# define PLATFORM_ID "Windows3x"
|
||||||
|
|
||||||
|
# elif defined(__VXWORKS__)
|
||||||
|
# define PLATFORM_ID "VxWorks"
|
||||||
|
|
||||||
|
# else /* unknown platform */
|
||||||
|
# define PLATFORM_ID
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__INTEGRITY)
|
||||||
|
# if defined(INT_178B)
|
||||||
|
# define PLATFORM_ID "Integrity178"
|
||||||
|
|
||||||
|
# else /* regular Integrity */
|
||||||
|
# define PLATFORM_ID "Integrity"
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# elif defined(_ADI_COMPILER)
|
||||||
|
# define PLATFORM_ID "ADSP"
|
||||||
|
|
||||||
|
#else /* unknown platform */
|
||||||
|
# define PLATFORM_ID
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* For windows compilers MSVC and Intel we can determine
|
||||||
|
the architecture of the compiler being used. This is because
|
||||||
|
the compilers do not have flags that can change the architecture,
|
||||||
|
but rather depend on which compiler is being used
|
||||||
|
*/
|
||||||
|
#if defined(_WIN32) && defined(_MSC_VER)
|
||||||
|
# if defined(_M_IA64)
|
||||||
|
# define ARCHITECTURE_ID "IA64"
|
||||||
|
|
||||||
|
# elif defined(_M_ARM64EC)
|
||||||
|
# define ARCHITECTURE_ID "ARM64EC"
|
||||||
|
|
||||||
|
# elif defined(_M_X64) || defined(_M_AMD64)
|
||||||
|
# define ARCHITECTURE_ID "x64"
|
||||||
|
|
||||||
|
# elif defined(_M_IX86)
|
||||||
|
# define ARCHITECTURE_ID "X86"
|
||||||
|
|
||||||
|
# elif defined(_M_ARM64)
|
||||||
|
# define ARCHITECTURE_ID "ARM64"
|
||||||
|
|
||||||
|
# elif defined(_M_ARM)
|
||||||
|
# if _M_ARM == 4
|
||||||
|
# define ARCHITECTURE_ID "ARMV4I"
|
||||||
|
# elif _M_ARM == 5
|
||||||
|
# define ARCHITECTURE_ID "ARMV5I"
|
||||||
|
# else
|
||||||
|
# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# elif defined(_M_MIPS)
|
||||||
|
# define ARCHITECTURE_ID "MIPS"
|
||||||
|
|
||||||
|
# elif defined(_M_SH)
|
||||||
|
# define ARCHITECTURE_ID "SHx"
|
||||||
|
|
||||||
|
# else /* unknown architecture */
|
||||||
|
# define ARCHITECTURE_ID ""
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__WATCOMC__)
|
||||||
|
# if defined(_M_I86)
|
||||||
|
# define ARCHITECTURE_ID "I86"
|
||||||
|
|
||||||
|
# elif defined(_M_IX86)
|
||||||
|
# define ARCHITECTURE_ID "X86"
|
||||||
|
|
||||||
|
# else /* unknown architecture */
|
||||||
|
# define ARCHITECTURE_ID ""
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
|
||||||
|
# if defined(__ICCARM__)
|
||||||
|
# define ARCHITECTURE_ID "ARM"
|
||||||
|
|
||||||
|
# elif defined(__ICCRX__)
|
||||||
|
# define ARCHITECTURE_ID "RX"
|
||||||
|
|
||||||
|
# elif defined(__ICCRH850__)
|
||||||
|
# define ARCHITECTURE_ID "RH850"
|
||||||
|
|
||||||
|
# elif defined(__ICCRL78__)
|
||||||
|
# define ARCHITECTURE_ID "RL78"
|
||||||
|
|
||||||
|
# elif defined(__ICCRISCV__)
|
||||||
|
# define ARCHITECTURE_ID "RISCV"
|
||||||
|
|
||||||
|
# elif defined(__ICCAVR__)
|
||||||
|
# define ARCHITECTURE_ID "AVR"
|
||||||
|
|
||||||
|
# elif defined(__ICC430__)
|
||||||
|
# define ARCHITECTURE_ID "MSP430"
|
||||||
|
|
||||||
|
# elif defined(__ICCV850__)
|
||||||
|
# define ARCHITECTURE_ID "V850"
|
||||||
|
|
||||||
|
# elif defined(__ICC8051__)
|
||||||
|
# define ARCHITECTURE_ID "8051"
|
||||||
|
|
||||||
|
# elif defined(__ICCSTM8__)
|
||||||
|
# define ARCHITECTURE_ID "STM8"
|
||||||
|
|
||||||
|
# else /* unknown architecture */
|
||||||
|
# define ARCHITECTURE_ID ""
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__ghs__)
|
||||||
|
# if defined(__PPC64__)
|
||||||
|
# define ARCHITECTURE_ID "PPC64"
|
||||||
|
|
||||||
|
# elif defined(__ppc__)
|
||||||
|
# define ARCHITECTURE_ID "PPC"
|
||||||
|
|
||||||
|
# elif defined(__ARM__)
|
||||||
|
# define ARCHITECTURE_ID "ARM"
|
||||||
|
|
||||||
|
# elif defined(__x86_64__)
|
||||||
|
# define ARCHITECTURE_ID "x64"
|
||||||
|
|
||||||
|
# elif defined(__i386__)
|
||||||
|
# define ARCHITECTURE_ID "X86"
|
||||||
|
|
||||||
|
# else /* unknown architecture */
|
||||||
|
# define ARCHITECTURE_ID ""
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__clang__) && defined(__ti__)
|
||||||
|
# if defined(__ARM_ARCH)
|
||||||
|
# define ARCHITECTURE_ID "ARM"
|
||||||
|
|
||||||
|
# else /* unknown architecture */
|
||||||
|
# define ARCHITECTURE_ID ""
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__TI_COMPILER_VERSION__)
|
||||||
|
# if defined(__TI_ARM__)
|
||||||
|
# define ARCHITECTURE_ID "ARM"
|
||||||
|
|
||||||
|
# elif defined(__MSP430__)
|
||||||
|
# define ARCHITECTURE_ID "MSP430"
|
||||||
|
|
||||||
|
# elif defined(__TMS320C28XX__)
|
||||||
|
# define ARCHITECTURE_ID "TMS320C28x"
|
||||||
|
|
||||||
|
# elif defined(__TMS320C6X__) || defined(_TMS320C6X)
|
||||||
|
# define ARCHITECTURE_ID "TMS320C6x"
|
||||||
|
|
||||||
|
# else /* unknown architecture */
|
||||||
|
# define ARCHITECTURE_ID ""
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# elif defined(__ADSPSHARC__)
|
||||||
|
# define ARCHITECTURE_ID "SHARC"
|
||||||
|
|
||||||
|
# elif defined(__ADSPBLACKFIN__)
|
||||||
|
# define ARCHITECTURE_ID "Blackfin"
|
||||||
|
|
||||||
|
#elif defined(__TASKING__)
|
||||||
|
|
||||||
|
# if defined(__CTC__) || defined(__CPTC__)
|
||||||
|
# define ARCHITECTURE_ID "TriCore"
|
||||||
|
|
||||||
|
# elif defined(__CMCS__)
|
||||||
|
# define ARCHITECTURE_ID "MCS"
|
||||||
|
|
||||||
|
# elif defined(__CARM__) || defined(__CPARM__)
|
||||||
|
# define ARCHITECTURE_ID "ARM"
|
||||||
|
|
||||||
|
# elif defined(__CARC__)
|
||||||
|
# define ARCHITECTURE_ID "ARC"
|
||||||
|
|
||||||
|
# elif defined(__C51__)
|
||||||
|
# define ARCHITECTURE_ID "8051"
|
||||||
|
|
||||||
|
# elif defined(__CPCP__)
|
||||||
|
# define ARCHITECTURE_ID "PCP"
|
||||||
|
|
||||||
|
# else
|
||||||
|
# define ARCHITECTURE_ID ""
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__RENESAS__)
|
||||||
|
# if defined(__CCRX__)
|
||||||
|
# define ARCHITECTURE_ID "RX"
|
||||||
|
|
||||||
|
# elif defined(__CCRL__)
|
||||||
|
# define ARCHITECTURE_ID "RL78"
|
||||||
|
|
||||||
|
# elif defined(__CCRH__)
|
||||||
|
# define ARCHITECTURE_ID "RH850"
|
||||||
|
|
||||||
|
# else
|
||||||
|
# define ARCHITECTURE_ID ""
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#else
|
||||||
|
# define ARCHITECTURE_ID
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Convert integer to decimal digit literals. */
|
||||||
|
#define DEC(n) \
|
||||||
|
('0' + (((n) / 10000000)%10)), \
|
||||||
|
('0' + (((n) / 1000000)%10)), \
|
||||||
|
('0' + (((n) / 100000)%10)), \
|
||||||
|
('0' + (((n) / 10000)%10)), \
|
||||||
|
('0' + (((n) / 1000)%10)), \
|
||||||
|
('0' + (((n) / 100)%10)), \
|
||||||
|
('0' + (((n) / 10)%10)), \
|
||||||
|
('0' + ((n) % 10))
|
||||||
|
|
||||||
|
/* Convert integer to hex digit literals. */
|
||||||
|
#define HEX(n) \
|
||||||
|
('0' + ((n)>>28 & 0xF)), \
|
||||||
|
('0' + ((n)>>24 & 0xF)), \
|
||||||
|
('0' + ((n)>>20 & 0xF)), \
|
||||||
|
('0' + ((n)>>16 & 0xF)), \
|
||||||
|
('0' + ((n)>>12 & 0xF)), \
|
||||||
|
('0' + ((n)>>8 & 0xF)), \
|
||||||
|
('0' + ((n)>>4 & 0xF)), \
|
||||||
|
('0' + ((n) & 0xF))
|
||||||
|
|
||||||
|
/* Construct a string literal encoding the version number. */
|
||||||
|
#ifdef COMPILER_VERSION
|
||||||
|
char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]";
|
||||||
|
|
||||||
|
/* Construct a string literal encoding the version number components. */
|
||||||
|
#elif defined(COMPILER_VERSION_MAJOR)
|
||||||
|
char const info_version[] = {
|
||||||
|
'I', 'N', 'F', 'O', ':',
|
||||||
|
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
|
||||||
|
COMPILER_VERSION_MAJOR,
|
||||||
|
# ifdef COMPILER_VERSION_MINOR
|
||||||
|
'.', COMPILER_VERSION_MINOR,
|
||||||
|
# ifdef COMPILER_VERSION_PATCH
|
||||||
|
'.', COMPILER_VERSION_PATCH,
|
||||||
|
# ifdef COMPILER_VERSION_TWEAK
|
||||||
|
'.', COMPILER_VERSION_TWEAK,
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
']','\0'};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Construct a string literal encoding the internal version number. */
|
||||||
|
#ifdef COMPILER_VERSION_INTERNAL
|
||||||
|
char const info_version_internal[] = {
|
||||||
|
'I', 'N', 'F', 'O', ':',
|
||||||
|
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
|
||||||
|
'i','n','t','e','r','n','a','l','[',
|
||||||
|
COMPILER_VERSION_INTERNAL,']','\0'};
|
||||||
|
#elif defined(COMPILER_VERSION_INTERNAL_STR)
|
||||||
|
char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Construct a string literal encoding the version number components. */
|
||||||
|
#ifdef SIMULATE_VERSION_MAJOR
|
||||||
|
char const info_simulate_version[] = {
|
||||||
|
'I', 'N', 'F', 'O', ':',
|
||||||
|
's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
|
||||||
|
SIMULATE_VERSION_MAJOR,
|
||||||
|
# ifdef SIMULATE_VERSION_MINOR
|
||||||
|
'.', SIMULATE_VERSION_MINOR,
|
||||||
|
# ifdef SIMULATE_VERSION_PATCH
|
||||||
|
'.', SIMULATE_VERSION_PATCH,
|
||||||
|
# ifdef SIMULATE_VERSION_TWEAK
|
||||||
|
'.', SIMULATE_VERSION_TWEAK,
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
']','\0'};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Construct the string literal in pieces to prevent the source from
|
||||||
|
getting matched. Store it in a pointer rather than an array
|
||||||
|
because some compilers will just produce instructions to fill the
|
||||||
|
array rather than assigning a pointer to a static array. */
|
||||||
|
char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
|
||||||
|
char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define CXX_STD_98 199711L
|
||||||
|
#define CXX_STD_11 201103L
|
||||||
|
#define CXX_STD_14 201402L
|
||||||
|
#define CXX_STD_17 201703L
|
||||||
|
#define CXX_STD_20 202002L
|
||||||
|
#define CXX_STD_23 202302L
|
||||||
|
|
||||||
|
#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG)
|
||||||
|
# if _MSVC_LANG > CXX_STD_17
|
||||||
|
# define CXX_STD _MSVC_LANG
|
||||||
|
# elif _MSVC_LANG == CXX_STD_17 && defined(__cpp_aggregate_paren_init)
|
||||||
|
# define CXX_STD CXX_STD_20
|
||||||
|
# elif _MSVC_LANG > CXX_STD_14 && __cplusplus > CXX_STD_17
|
||||||
|
# define CXX_STD CXX_STD_20
|
||||||
|
# elif _MSVC_LANG > CXX_STD_14
|
||||||
|
# define CXX_STD CXX_STD_17
|
||||||
|
# elif defined(__INTEL_CXX11_MODE__) && defined(__cpp_aggregate_nsdmi)
|
||||||
|
# define CXX_STD CXX_STD_14
|
||||||
|
# elif defined(__INTEL_CXX11_MODE__)
|
||||||
|
# define CXX_STD CXX_STD_11
|
||||||
|
# else
|
||||||
|
# define CXX_STD CXX_STD_98
|
||||||
|
# endif
|
||||||
|
#elif defined(_MSC_VER) && defined(_MSVC_LANG)
|
||||||
|
# if _MSVC_LANG > __cplusplus
|
||||||
|
# define CXX_STD _MSVC_LANG
|
||||||
|
# else
|
||||||
|
# define CXX_STD __cplusplus
|
||||||
|
# endif
|
||||||
|
#elif defined(__NVCOMPILER)
|
||||||
|
# if __cplusplus == CXX_STD_17 && defined(__cpp_aggregate_paren_init)
|
||||||
|
# define CXX_STD CXX_STD_20
|
||||||
|
# else
|
||||||
|
# define CXX_STD __cplusplus
|
||||||
|
# endif
|
||||||
|
#elif defined(__INTEL_COMPILER) || defined(__PGI)
|
||||||
|
# if __cplusplus == CXX_STD_11 && defined(__cpp_namespace_attributes)
|
||||||
|
# define CXX_STD CXX_STD_17
|
||||||
|
# elif __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi)
|
||||||
|
# define CXX_STD CXX_STD_14
|
||||||
|
# else
|
||||||
|
# define CXX_STD __cplusplus
|
||||||
|
# endif
|
||||||
|
#elif (defined(__IBMCPP__) || defined(__ibmxl__)) && defined(__linux__)
|
||||||
|
# if __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi)
|
||||||
|
# define CXX_STD CXX_STD_14
|
||||||
|
# else
|
||||||
|
# define CXX_STD __cplusplus
|
||||||
|
# endif
|
||||||
|
#elif __cplusplus == 1 && defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||||
|
# define CXX_STD CXX_STD_11
|
||||||
|
#else
|
||||||
|
# define CXX_STD __cplusplus
|
||||||
|
#endif
|
||||||
|
|
||||||
|
const char* info_language_standard_default = "INFO" ":" "standard_default["
|
||||||
|
#if CXX_STD > CXX_STD_23
|
||||||
|
"26"
|
||||||
|
#elif CXX_STD > CXX_STD_20
|
||||||
|
"23"
|
||||||
|
#elif CXX_STD > CXX_STD_17
|
||||||
|
"20"
|
||||||
|
#elif CXX_STD > CXX_STD_14
|
||||||
|
"17"
|
||||||
|
#elif CXX_STD > CXX_STD_11
|
||||||
|
"14"
|
||||||
|
#elif CXX_STD >= CXX_STD_11
|
||||||
|
"11"
|
||||||
|
#else
|
||||||
|
"98"
|
||||||
|
#endif
|
||||||
|
"]";
|
||||||
|
|
||||||
|
const char* info_language_extensions_default = "INFO" ":" "extensions_default["
|
||||||
|
#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
|
||||||
|
defined(__TI_COMPILER_VERSION__) || defined(__RENESAS__)) && \
|
||||||
|
!defined(__STRICT_ANSI__)
|
||||||
|
"ON"
|
||||||
|
#else
|
||||||
|
"OFF"
|
||||||
|
#endif
|
||||||
|
"]";
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
int require = 0;
|
||||||
|
require += info_compiler[argc];
|
||||||
|
require += info_platform[argc];
|
||||||
|
require += info_arch[argc];
|
||||||
|
#ifdef COMPILER_VERSION_MAJOR
|
||||||
|
require += info_version[argc];
|
||||||
|
#endif
|
||||||
|
#if defined(COMPILER_VERSION_INTERNAL) || defined(COMPILER_VERSION_INTERNAL_STR)
|
||||||
|
require += info_version_internal[argc];
|
||||||
|
#endif
|
||||||
|
#ifdef SIMULATE_ID
|
||||||
|
require += info_simulate[argc];
|
||||||
|
#endif
|
||||||
|
#ifdef SIMULATE_VERSION_MAJOR
|
||||||
|
require += info_simulate_version[argc];
|
||||||
|
#endif
|
||||||
|
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
|
||||||
|
require += info_cray[argc];
|
||||||
|
#endif
|
||||||
|
require += info_language_standard_default[argc];
|
||||||
|
require += info_language_extensions_default[argc];
|
||||||
|
(void)argv;
|
||||||
|
return require;
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"InstallScripts" :
|
||||||
|
[
|
||||||
|
"C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/cmake_install.cmake",
|
||||||
|
"C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/dlang.sqlite/cmake_install.cmake",
|
||||||
|
"C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-build/cmake_install.cmake"
|
||||||
|
],
|
||||||
|
"Parallel" : false
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#include "foo.h"
|
||||||
|
int main(){}
|
||||||
Binary file not shown.
@@ -0,0 +1,17 @@
|
|||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/CMakeFiles/edit_cache.dir
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/CMakeFiles/rebuild_cache.dir
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/CMakeFiles/list_install_components.dir
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/CMakeFiles/install.dir
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/CMakeFiles/install/local.dir
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/dlang.sqlite/CMakeFiles/dlang.sqlite.dir
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/dlang.sqlite/CMakeFiles/edit_cache.dir
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/dlang.sqlite/CMakeFiles/rebuild_cache.dir
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/dlang.sqlite/CMakeFiles/list_install_components.dir
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/dlang.sqlite/CMakeFiles/install.dir
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/dlang.sqlite/CMakeFiles/install/local.dir
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-build/CMakeFiles/SQLite3.dir
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-build/CMakeFiles/edit_cache.dir
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-build/CMakeFiles/rebuild_cache.dir
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-build/CMakeFiles/list_install_components.dir
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-build/CMakeFiles/install.dir
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-build/CMakeFiles/install/local.dir
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# This file is generated by cmake for dependency checking of the CMakeCache.txt file
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
# CMAKE generated file: DO NOT EDIT!
|
||||||
|
# Generated by "Ninja" Generator, CMake Version 4.3
|
||||||
|
|
||||||
|
# This file contains all the rules used to get the outputs files
|
||||||
|
# built from the input files.
|
||||||
|
# It is included in the main 'build.ninja'.
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# Project: dlang.sqlite
|
||||||
|
# Configurations: Release
|
||||||
|
# =============================================================================
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# localized /showIncludes string
|
||||||
|
|
||||||
|
msvc_deps_prefix = Note: including file:
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Rule for running custom commands.
|
||||||
|
|
||||||
|
rule CUSTOM_COMMAND
|
||||||
|
command = $COMMAND
|
||||||
|
description = $DESC
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Rule for generating CXX dependencies.
|
||||||
|
|
||||||
|
rule CXX_SCAN__dlang.2esqlite_Release
|
||||||
|
deps = msvc
|
||||||
|
command = C:\PROGRA~1\MICROS~1\18\COMMUN~1\VC\Tools\MSVC\1451~1.362\bin\Hostx64\x64\cl.exe $DEFINES $INCLUDES $FLAGS $in -nologo -TP -showIncludes -scanDependencies $DYNDEP_INTERMEDIATE_FILE -Fo$OBJ_FILE
|
||||||
|
description = Scanning $in for CXX dependencies
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Rule to generate ninja dyndep files for CXX.
|
||||||
|
|
||||||
|
rule CXX_DYNDEP__dlang.2esqlite_Release
|
||||||
|
command = "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E cmake_ninja_dyndep --tdi=dlang.sqlite\CMakeFiles\dlang.sqlite.dir\CXXDependInfo.json --lang=CXX --modmapfmt=msvc --dd=$out @$out.rsp
|
||||||
|
description = Generating CXX dyndep file $out
|
||||||
|
rspfile = $out.rsp
|
||||||
|
rspfile_content = $in
|
||||||
|
restat = 1
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Rule for compiling CXX files.
|
||||||
|
|
||||||
|
rule CXX_COMPILER__dlang.2esqlite_scanned_Release
|
||||||
|
deps = msvc
|
||||||
|
command = ${LAUNCHER}${CODE_CHECK}C:\PROGRA~1\MICROS~1\18\COMMUN~1\VC\Tools\MSVC\1451~1.362\bin\Hostx64\x64\cl.exe /nologo /TP $DEFINES $INCLUDES $FLAGS /showIncludes @$DYNDEP_MODULE_MAP_FILE /Fo$out /Fd$TARGET_COMPILE_PDB /FS -c $in
|
||||||
|
description = Building CXX object $out
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Rule for compiling CXX files.
|
||||||
|
|
||||||
|
rule CXX_COMPILER__dlang.2esqlite_unscanned_Release
|
||||||
|
deps = msvc
|
||||||
|
command = ${LAUNCHER}${CODE_CHECK}C:\PROGRA~1\MICROS~1\18\COMMUN~1\VC\Tools\MSVC\1451~1.362\bin\Hostx64\x64\cl.exe /nologo /TP $DEFINES $INCLUDES $FLAGS /showIncludes /Fo$out /Fd$TARGET_COMPILE_PDB /FS -c $in
|
||||||
|
description = Building CXX object $out
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Rule for linking CXX shared library.
|
||||||
|
|
||||||
|
rule CXX_SHARED_LIBRARY_LINKER__dlang.2esqlite_Release
|
||||||
|
command = C:\Windows\system32\cmd.exe /C "$PRE_LINK && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_dll --msvc-ver=1951 --intdir=$OBJECT_DIR --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100261~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100261~1.0\x64\mt.exe --manifests $MANIFESTS -- C:\PROGRA~1\MICROS~1\18\COMMUN~1\VC\Tools\MSVC\1451~1.362\bin\Hostx64\x64\link.exe /nologo $in /out:$TARGET_FILE /implib:$TARGET_IMPLIB /pdb:$TARGET_PDB /dll /version:0.0 $LINK_FLAGS $LINK_PATH $LINK_LIBRARIES && $POST_BUILD"
|
||||||
|
description = Linking CXX shared library $TARGET_FILE
|
||||||
|
restat = $RESTAT
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Rule for compiling C files.
|
||||||
|
|
||||||
|
rule C_COMPILER__SQLite3_unscanned_Release
|
||||||
|
deps = msvc
|
||||||
|
command = ${LAUNCHER}${CODE_CHECK}C:\PROGRA~1\MICROS~1\18\COMMUN~1\VC\Tools\MSVC\1451~1.362\bin\Hostx64\x64\cl.exe /nologo $DEFINES $INCLUDES $FLAGS /showIncludes /Fo$out /Fd$TARGET_COMPILE_PDB /FS -c $in
|
||||||
|
description = Building C object $out
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Rule for linking C static library.
|
||||||
|
|
||||||
|
rule C_STATIC_LIBRARY_LINKER__SQLite3_Release
|
||||||
|
command = C:\Windows\system32\cmd.exe /C "$PRE_LINK && C:\PROGRA~1\MICROS~1\18\COMMUN~1\VC\Tools\MSVC\1451~1.362\bin\Hostx64\x64\lib.exe /nologo $LINK_FLAGS /out:$TARGET_FILE $in && $POST_BUILD"
|
||||||
|
description = Linking C static library $TARGET_FILE
|
||||||
|
restat = $RESTAT
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Rule for re-running cmake.
|
||||||
|
|
||||||
|
rule RERUN_CMAKE
|
||||||
|
command = "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --regenerate-during-build -SC:\Users\Damian\Desktop\dlang-sqlite -BC:\Users\Damian\Desktop\dlang-sqlite\out\build\x64-release
|
||||||
|
description = Re-running CMake...
|
||||||
|
generator = 1
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Rule for cleaning all built files.
|
||||||
|
|
||||||
|
rule CLEAN
|
||||||
|
command = C:\PROGRA~1\MICROS~1\18\COMMUN~1\Common7\IDE\COMMON~1\MICROS~1\CMake\Ninja\ninja.exe $FILE_ARG -t clean $TARGETS
|
||||||
|
description = Cleaning all built files...
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Rule for printing all primary targets available.
|
||||||
|
|
||||||
|
rule HELP
|
||||||
|
command = C:\PROGRA~1\MICROS~1\18\COMMUN~1\Common7\IDE\COMMON~1\MICROS~1\CMake\Ninja\ninja.exe -t targets
|
||||||
|
description = All primary targets available:
|
||||||
|
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
#----------------------------------------------------------------
|
||||||
|
# Generated CMake target import file for configuration "Release".
|
||||||
|
#----------------------------------------------------------------
|
||||||
|
|
||||||
|
# Commands may need to know the format version.
|
||||||
|
set(CMAKE_IMPORT_FILE_VERSION 1)
|
||||||
|
|
||||||
|
# Import target "SQLite::SQLite3" for configuration "Release"
|
||||||
|
set_property(TARGET SQLite::SQLite3 APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||||
|
set_target_properties(SQLite::SQLite3 PROPERTIES
|
||||||
|
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
|
||||||
|
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/sqlite3.lib"
|
||||||
|
)
|
||||||
|
|
||||||
|
list(APPEND _cmake_import_check_targets SQLite::SQLite3 )
|
||||||
|
list(APPEND _cmake_import_check_files_for_SQLite::SQLite3 "${_IMPORT_PREFIX}/lib/sqlite3.lib" )
|
||||||
|
|
||||||
|
# Commands beyond this point should not need to know the version.
|
||||||
|
set(CMAKE_IMPORT_FILE_VERSION)
|
||||||
+107
@@ -0,0 +1,107 @@
|
|||||||
|
# Generated by CMake
|
||||||
|
|
||||||
|
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
|
||||||
|
message(FATAL_ERROR "CMake >= 2.8.12 required")
|
||||||
|
endif()
|
||||||
|
if(CMAKE_VERSION VERSION_LESS "2.8.12")
|
||||||
|
message(FATAL_ERROR "CMake >= 2.8.12 required")
|
||||||
|
endif()
|
||||||
|
cmake_policy(PUSH)
|
||||||
|
cmake_policy(VERSION 2.8.12...4.1)
|
||||||
|
#----------------------------------------------------------------
|
||||||
|
# Generated CMake target import file.
|
||||||
|
#----------------------------------------------------------------
|
||||||
|
|
||||||
|
# Commands may need to know the format version.
|
||||||
|
set(CMAKE_IMPORT_FILE_VERSION 1)
|
||||||
|
|
||||||
|
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
|
||||||
|
set(_cmake_targets_defined "")
|
||||||
|
set(_cmake_targets_not_defined "")
|
||||||
|
set(_cmake_expected_targets "")
|
||||||
|
foreach(_cmake_expected_target IN ITEMS SQLite::SQLite3)
|
||||||
|
list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
|
||||||
|
if(TARGET "${_cmake_expected_target}")
|
||||||
|
list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
|
||||||
|
else()
|
||||||
|
list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
unset(_cmake_expected_target)
|
||||||
|
if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
|
||||||
|
unset(_cmake_targets_defined)
|
||||||
|
unset(_cmake_targets_not_defined)
|
||||||
|
unset(_cmake_expected_targets)
|
||||||
|
unset(CMAKE_IMPORT_FILE_VERSION)
|
||||||
|
cmake_policy(POP)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
if(NOT _cmake_targets_defined STREQUAL "")
|
||||||
|
string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
|
||||||
|
string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
|
||||||
|
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
|
||||||
|
endif()
|
||||||
|
unset(_cmake_targets_defined)
|
||||||
|
unset(_cmake_targets_not_defined)
|
||||||
|
unset(_cmake_expected_targets)
|
||||||
|
|
||||||
|
|
||||||
|
# Compute the installation prefix relative to this file.
|
||||||
|
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||||
|
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
||||||
|
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
||||||
|
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
||||||
|
if(_IMPORT_PREFIX STREQUAL "/")
|
||||||
|
set(_IMPORT_PREFIX "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Create imported target SQLite::SQLite3
|
||||||
|
add_library(SQLite::SQLite3 STATIC IMPORTED)
|
||||||
|
|
||||||
|
set_target_properties(SQLite::SQLite3 PROPERTIES
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
|
||||||
|
INTERFACE_LINK_LIBRARIES "\$<\$<BOOL:OFF>:dl>;\$<\$<OR:\$<BOOL:OFF>,\$<BOOL:OFF>>:m>"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Load information for each installed configuration.
|
||||||
|
file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/sqlite3-targets-*.cmake")
|
||||||
|
foreach(_cmake_config_file IN LISTS _cmake_config_files)
|
||||||
|
include("${_cmake_config_file}")
|
||||||
|
endforeach()
|
||||||
|
unset(_cmake_config_file)
|
||||||
|
unset(_cmake_config_files)
|
||||||
|
|
||||||
|
# Cleanup temporary variables.
|
||||||
|
set(_IMPORT_PREFIX)
|
||||||
|
|
||||||
|
# Loop over all imported files and verify that they actually exist
|
||||||
|
foreach(_cmake_target IN LISTS _cmake_import_check_targets)
|
||||||
|
if(CMAKE_VERSION VERSION_LESS "3.28"
|
||||||
|
OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target}
|
||||||
|
OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}")
|
||||||
|
foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
|
||||||
|
if(NOT EXISTS "${_cmake_file}")
|
||||||
|
message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
|
||||||
|
\"${_cmake_file}\"
|
||||||
|
but this file does not exist. Possible reasons include:
|
||||||
|
* The file was deleted, renamed, or moved to another location.
|
||||||
|
* An install or uninstall procedure did not complete successfully.
|
||||||
|
* The installation package was faulty and contained
|
||||||
|
\"${CMAKE_CURRENT_LIST_FILE}\"
|
||||||
|
but not all the files it references.
|
||||||
|
")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
unset(_cmake_file)
|
||||||
|
unset("_cmake_import_check_files_for_${_cmake_target}")
|
||||||
|
endforeach()
|
||||||
|
unset(_cmake_target)
|
||||||
|
unset(_cmake_import_check_targets)
|
||||||
|
|
||||||
|
# This file does not depend on other imported targets which have
|
||||||
|
# been exported from the same project but in a separate export set.
|
||||||
|
|
||||||
|
# Commands beyond this point should not need to know the version.
|
||||||
|
set(CMAKE_IMPORT_FILE_VERSION)
|
||||||
|
cmake_policy(POP)
|
||||||
BIN
Binary file not shown.
@@ -0,0 +1,81 @@
|
|||||||
|
# Install script for directory: C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-src
|
||||||
|
|
||||||
|
# Set the install prefix
|
||||||
|
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||||
|
set(CMAKE_INSTALL_PREFIX "C:/Users/Damian/Desktop/dlang-sqlite/out/install/x64-release")
|
||||||
|
endif()
|
||||||
|
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||||
|
|
||||||
|
# Set the install configuration name.
|
||||||
|
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
|
||||||
|
if(BUILD_TYPE)
|
||||||
|
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
|
||||||
|
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
|
||||||
|
else()
|
||||||
|
set(CMAKE_INSTALL_CONFIG_NAME "Release")
|
||||||
|
endif()
|
||||||
|
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Set the component getting installed.
|
||||||
|
if(NOT CMAKE_INSTALL_COMPONENT)
|
||||||
|
if(COMPONENT)
|
||||||
|
message(STATUS "Install component: \"${COMPONENT}\"")
|
||||||
|
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
|
||||||
|
else()
|
||||||
|
set(CMAKE_INSTALL_COMPONENT)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Is this installation the result of a crosscompile?
|
||||||
|
if(NOT DEFINED CMAKE_CROSSCOMPILING)
|
||||||
|
set(CMAKE_CROSSCOMPILING "FALSE")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
|
||||||
|
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE STATIC_LIBRARY FILES "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-build/sqlite3.lib")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
|
||||||
|
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/include" TYPE FILE FILES
|
||||||
|
"C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-src/sqlite3.h"
|
||||||
|
"C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3_ext-src/sqlite3ext.h"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
|
||||||
|
if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/cmake/sqlite3/sqlite3-targets.cmake")
|
||||||
|
file(DIFFERENT _cmake_export_file_changed FILES
|
||||||
|
"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/cmake/sqlite3/sqlite3-targets.cmake"
|
||||||
|
"C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-build/CMakeFiles/Export/0f80ad8c5b36acbf13c387a14f25b4b2/sqlite3-targets.cmake")
|
||||||
|
if(_cmake_export_file_changed)
|
||||||
|
file(GLOB _cmake_old_config_files "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/cmake/sqlite3/sqlite3-targets-*.cmake")
|
||||||
|
if(_cmake_old_config_files)
|
||||||
|
string(REPLACE ";" ", " _cmake_old_config_files_text "${_cmake_old_config_files}")
|
||||||
|
message(STATUS "Old export file \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/cmake/sqlite3/sqlite3-targets.cmake\" will be replaced. Removing files [${_cmake_old_config_files_text}].")
|
||||||
|
unset(_cmake_old_config_files_text)
|
||||||
|
file(REMOVE ${_cmake_old_config_files})
|
||||||
|
endif()
|
||||||
|
unset(_cmake_old_config_files)
|
||||||
|
endif()
|
||||||
|
unset(_cmake_export_file_changed)
|
||||||
|
endif()
|
||||||
|
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/sqlite3" TYPE FILE FILES "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-build/CMakeFiles/Export/0f80ad8c5b36acbf13c387a14f25b4b2/sqlite3-targets.cmake")
|
||||||
|
if(CMAKE_INSTALL_CONFIG_NAME MATCHES "^([Rr][Ee][Ll][Ee][Aa][Ss][Ee])$")
|
||||||
|
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/sqlite3" TYPE FILE FILES "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-build/CMakeFiles/Export/0f80ad8c5b36acbf13c387a14f25b4b2/sqlite3-targets-release.cmake")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
|
||||||
|
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/sqlite3" TYPE FILE FILES
|
||||||
|
"C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-build/sqlite3-config-version.cmake"
|
||||||
|
"C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-src/sqlite3-config.cmake"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
|
||||||
|
"${CMAKE_INSTALL_MANIFEST_FILES}")
|
||||||
|
if(CMAKE_INSTALL_LOCAL_ONLY)
|
||||||
|
file(WRITE "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-build/install_local_manifest.txt"
|
||||||
|
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
|
||||||
|
endif()
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
# This is a basic version file for the Config-mode of find_package().
|
||||||
|
# It is used by write_basic_package_version_file() as input file for configure_file()
|
||||||
|
# to create a version-file which can be installed along a config.cmake file.
|
||||||
|
#
|
||||||
|
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
|
||||||
|
# the requested version string are exactly the same and it sets
|
||||||
|
# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version.
|
||||||
|
# The variable CVF_VERSION must be set before calling configure_file().
|
||||||
|
|
||||||
|
set(PACKAGE_VERSION "3.49.1")
|
||||||
|
|
||||||
|
if (PACKAGE_FIND_VERSION_RANGE)
|
||||||
|
# Package version must be in the requested version range
|
||||||
|
if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN)
|
||||||
|
OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX)
|
||||||
|
OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX)))
|
||||||
|
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||||
|
else()
|
||||||
|
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
|
||||||
|
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||||
|
else()
|
||||||
|
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||||
|
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
|
||||||
|
set(PACKAGE_VERSION_EXACT TRUE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
|
||||||
|
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
|
||||||
|
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8")
|
||||||
|
math(EXPR installedBits "8 * 8")
|
||||||
|
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
|
||||||
|
set(PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||||
|
endif()
|
||||||
Binary file not shown.
Submodule
+1
Submodule out/build/x64-release/_deps/sqlite3-src added at 42e4aad2da.
@@ -0,0 +1,21 @@
|
|||||||
|
# ninja log v7
|
||||||
|
4 36 8134995642472695 sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-mkdir 593f298c6a5ab53c
|
||||||
|
4 36 8134995642472695 C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-mkdir 593f298c6a5ab53c
|
||||||
|
36 1405 8134995656162747 sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-download b5bb8b3582bc3845
|
||||||
|
36 1405 8134995656162747 C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-download b5bb8b3582bc3845
|
||||||
|
1405 1466 8134995656202741 sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-update 7216f671540d78a
|
||||||
|
1405 1466 8134995656202741 C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-update 7216f671540d78a
|
||||||
|
1466 1494 8134995657052726 sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-patch da747ecd2fa02886
|
||||||
|
1466 1494 8134995657052726 C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-patch da747ecd2fa02886
|
||||||
|
1494 1522 8134995657332763 sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-configure d6dc3bc2d31aac24
|
||||||
|
1494 1522 8134995657332763 C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-configure d6dc3bc2d31aac24
|
||||||
|
1523 1552 8134995657632741 sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-build 7080cba5a9e1d438
|
||||||
|
1523 1552 8134995657632741 C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-build 7080cba5a9e1d438
|
||||||
|
1552 1581 8134995657922735 sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-install 87e532b917c6787c
|
||||||
|
1552 1581 8134995657922735 C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-install 87e532b917c6787c
|
||||||
|
1581 1609 8134995658202726 sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-test 65b832d8ff346ef
|
||||||
|
1581 1609 8134995658202726 C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-test 65b832d8ff346ef
|
||||||
|
1609 1649 8134995658602727 CMakeFiles/sqlite3-populate-complete 4cca2990af996035
|
||||||
|
1609 1649 8134995658602727 sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-done 4cca2990af996035
|
||||||
|
1609 1649 8134995658602727 C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/CMakeFiles/sqlite3-populate-complete 4cca2990af996035
|
||||||
|
1609 1649 8134995658602727 C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-done 4cca2990af996035
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
# This is the CMakeCache file.
|
||||||
|
# For build in directory: c:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild
|
||||||
|
# It was generated by CMake: C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe
|
||||||
|
# You can edit this file to change values found and used by cmake.
|
||||||
|
# If you do not want to change any of the values, simply exit the editor.
|
||||||
|
# If you do want to change a value, simply edit, save, and exit the editor.
|
||||||
|
# The syntax for the file is as follows:
|
||||||
|
# KEY:TYPE=VALUE
|
||||||
|
# KEY is the name of a variable in the cache.
|
||||||
|
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
|
||||||
|
# VALUE is the current value for the KEY.
|
||||||
|
|
||||||
|
########################
|
||||||
|
# EXTERNAL cache entries
|
||||||
|
########################
|
||||||
|
|
||||||
|
//Enable/Disable output of build database during the build.
|
||||||
|
CMAKE_EXPORT_BUILD_DATABASE:BOOL=
|
||||||
|
|
||||||
|
//Enable/Disable output of compile commands during generation.
|
||||||
|
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=
|
||||||
|
|
||||||
|
//Value Computed by CMake.
|
||||||
|
CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/CMakeFiles/pkgRedirects
|
||||||
|
|
||||||
|
//Install path prefix, prepended onto install directories.
|
||||||
|
CMAKE_INSTALL_PREFIX:PATH=C:/Program Files (x86)/sqlite3-populate
|
||||||
|
|
||||||
|
//No help, variable specified on the command line.
|
||||||
|
CMAKE_MAKE_PROGRAM:FILEPATH=C:/PROGRA~1/MICROS~1/18/COMMUN~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
CMAKE_PROJECT_COMPAT_VERSION:STATIC=
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
CMAKE_PROJECT_DESCRIPTION:STATIC=
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
CMAKE_PROJECT_HOMEPAGE_URL:STATIC=
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
CMAKE_PROJECT_NAME:STATIC=sqlite3-populate
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
CMAKE_PROJECT_SPDX_LICENSE:STATIC=
|
||||||
|
|
||||||
|
//If set, runtime paths are not added when installing shared libraries,
|
||||||
|
// but are added when building.
|
||||||
|
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
|
||||||
|
|
||||||
|
//If set, runtime paths are not added when using shared libraries.
|
||||||
|
CMAKE_SKIP_RPATH:BOOL=NO
|
||||||
|
|
||||||
|
//If this value is on, makefiles will be generated without the
|
||||||
|
// .SILENT directive, and all commands will be echoed to the console
|
||||||
|
// during the make. This is useful for debugging only. With Visual
|
||||||
|
// Studio IDE projects all commands are done without /nologo.
|
||||||
|
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
sqlite3-populate_BINARY_DIR:STATIC=C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
sqlite3-populate_IS_TOP_LEVEL:STATIC=ON
|
||||||
|
|
||||||
|
//Value Computed by CMake
|
||||||
|
sqlite3-populate_SOURCE_DIR:STATIC=C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild
|
||||||
|
|
||||||
|
|
||||||
|
########################
|
||||||
|
# INTERNAL cache entries
|
||||||
|
########################
|
||||||
|
|
||||||
|
//This is the directory where this CMakeCache.txt was created
|
||||||
|
CMAKE_CACHEFILE_DIR:INTERNAL=c:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild
|
||||||
|
//Major version of cmake used to create the current loaded cache
|
||||||
|
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=4
|
||||||
|
//Minor version of cmake used to create the current loaded cache
|
||||||
|
CMAKE_CACHE_MINOR_VERSION:INTERNAL=3
|
||||||
|
//Patch version of cmake used to create the current loaded cache
|
||||||
|
CMAKE_CACHE_PATCH_VERSION:INTERNAL=1
|
||||||
|
//Path to CMake executable.
|
||||||
|
CMAKE_COMMAND:INTERNAL=C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe
|
||||||
|
//Path to cpack program executable.
|
||||||
|
CMAKE_CPACK_COMMAND:INTERNAL=C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cpack.exe
|
||||||
|
//Path to ctest program executable.
|
||||||
|
CMAKE_CTEST_COMMAND:INTERNAL=C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/ctest.exe
|
||||||
|
//ADVANCED property for variable: CMAKE_EXPORT_BUILD_DATABASE
|
||||||
|
CMAKE_EXPORT_BUILD_DATABASE-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS
|
||||||
|
CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1
|
||||||
|
//Name of external makefile project generator.
|
||||||
|
CMAKE_EXTRA_GENERATOR:INTERNAL=
|
||||||
|
//Name of generator.
|
||||||
|
CMAKE_GENERATOR:INTERNAL=Ninja
|
||||||
|
//Generator instance identifier.
|
||||||
|
CMAKE_GENERATOR_INSTANCE:INTERNAL=
|
||||||
|
//Name of generator platform.
|
||||||
|
CMAKE_GENERATOR_PLATFORM:INTERNAL=
|
||||||
|
//Name of generator toolset.
|
||||||
|
CMAKE_GENERATOR_TOOLSET:INTERNAL=
|
||||||
|
//Source directory with the top level CMakeLists.txt file for this
|
||||||
|
// project
|
||||||
|
CMAKE_HOME_DIRECTORY:INTERNAL=C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild
|
||||||
|
//Name of CMakeLists files to read
|
||||||
|
CMAKE_LIST_FILE_NAME:INTERNAL=CMakeLists.txt
|
||||||
|
//number of local generators
|
||||||
|
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
|
||||||
|
//Platform information initialized
|
||||||
|
CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1
|
||||||
|
//Path to CMake installation.
|
||||||
|
CMAKE_ROOT:INTERNAL=C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-4.3
|
||||||
|
//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
|
||||||
|
CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_SKIP_RPATH
|
||||||
|
CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
|
||||||
|
//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
|
||||||
|
CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
|
||||||
|
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
set(CMAKE_HOST_SYSTEM "Windows-10.0.19045")
|
||||||
|
set(CMAKE_HOST_SYSTEM_NAME "Windows")
|
||||||
|
set(CMAKE_HOST_SYSTEM_VERSION "10.0.19045")
|
||||||
|
set(CMAKE_HOST_SYSTEM_PROCESSOR "AMD64")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set(CMAKE_SYSTEM "Windows-10.0.19045")
|
||||||
|
set(CMAKE_SYSTEM_NAME "Windows")
|
||||||
|
set(CMAKE_SYSTEM_VERSION "10.0.19045")
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR "AMD64")
|
||||||
|
|
||||||
|
set(CMAKE_CROSSCOMPILING "FALSE")
|
||||||
|
|
||||||
|
set(CMAKE_SYSTEM_LOADED 1)
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
---
|
||||||
|
events:
|
||||||
|
-
|
||||||
|
kind: "message-v1"
|
||||||
|
backtrace:
|
||||||
|
- "C:/Program Files/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-4.3/Modules/CMakeDetermineSystem.cmake:212 (message)"
|
||||||
|
- "CMakeLists.txt:16 (project)"
|
||||||
|
message: |
|
||||||
|
The system is: Windows - 10.0.19045 - AMD64
|
||||||
|
...
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"InstallScripts" :
|
||||||
|
[
|
||||||
|
"C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/cmake_install.cmake"
|
||||||
|
],
|
||||||
|
"Parallel" : false
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/CMakeFiles/sqlite3-populate.dir
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/CMakeFiles/edit_cache.dir
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/CMakeFiles/rebuild_cache.dir
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# This file is generated by cmake for dependency checking of the CMakeCache.txt file
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# CMAKE generated file: DO NOT EDIT!
|
||||||
|
# Generated by "Ninja" Generator, CMake Version 4.3
|
||||||
|
|
||||||
|
# This file contains all the rules used to get the outputs files
|
||||||
|
# built from the input files.
|
||||||
|
# It is included in the main 'build.ninja'.
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# Project: sqlite3-populate
|
||||||
|
# Configurations:
|
||||||
|
# =============================================================================
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Rule for running custom commands.
|
||||||
|
|
||||||
|
rule CUSTOM_COMMAND
|
||||||
|
command = $COMMAND
|
||||||
|
description = $DESC
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Rule for re-running cmake.
|
||||||
|
|
||||||
|
rule RERUN_CMAKE
|
||||||
|
command = "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --regenerate-during-build -SC:\Users\Damian\Desktop\dlang-sqlite\out\build\x64-release\_deps\sqlite3-subbuild -BC:\Users\Damian\Desktop\dlang-sqlite\out\build\x64-release\_deps\sqlite3-subbuild
|
||||||
|
description = Re-running CMake...
|
||||||
|
generator = 1
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Rule for cleaning all built files.
|
||||||
|
|
||||||
|
rule CLEAN
|
||||||
|
command = C:\PROGRA~1\MICROS~1\18\COMMUN~1\Common7\IDE\COMMON~1\MICROS~1\CMake\Ninja\ninja.exe $FILE_ARG -t clean $TARGETS
|
||||||
|
description = Cleaning all built files...
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Rule for printing all primary targets available.
|
||||||
|
|
||||||
|
rule HELP
|
||||||
|
command = C:\PROGRA~1\MICROS~1\18\COMMUN~1\Common7\IDE\COMMON~1\MICROS~1\CMake\Ninja\ninja.exe -t targets
|
||||||
|
description = All primary targets available:
|
||||||
|
|
||||||
Whitespace-only changes.
+46
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"sources" :
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"file" : "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/CMakeFiles/sqlite3-populate"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file" : "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/CMakeFiles/sqlite3-populate.rule"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file" : "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/CMakeFiles/sqlite3-populate-complete.rule"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file" : "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-build.rule"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file" : "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-configure.rule"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file" : "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-download.rule"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file" : "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-install.rule"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file" : "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-mkdir.rule"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file" : "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-patch.rule"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file" : "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-test.rule"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file" : "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-update.rule"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"target" :
|
||||||
|
{
|
||||||
|
"labels" :
|
||||||
|
[
|
||||||
|
"sqlite3-populate"
|
||||||
|
],
|
||||||
|
"name" : "sqlite3-populate"
|
||||||
|
}
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
# Target labels
|
||||||
|
sqlite3-populate
|
||||||
|
# Source files and their labels
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/CMakeFiles/sqlite3-populate
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/CMakeFiles/sqlite3-populate.rule
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/CMakeFiles/sqlite3-populate-complete.rule
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-build.rule
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-configure.rule
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-download.rule
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-install.rule
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-mkdir.rule
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-patch.rule
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-test.rule
|
||||||
|
C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-update.rule
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||||
|
# file LICENSE.rst or https://cmake.org/licensing for details.
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 4.3.1-msvc1)
|
||||||
|
|
||||||
|
# Reject any attempt to use a toolchain file. We must not use one because
|
||||||
|
# we could be downloading it here. If the CMAKE_TOOLCHAIN_FILE environment
|
||||||
|
# variable is set, the cache variable will have been initialized from it.
|
||||||
|
unset(CMAKE_TOOLCHAIN_FILE CACHE)
|
||||||
|
unset(ENV{CMAKE_TOOLCHAIN_FILE})
|
||||||
|
|
||||||
|
# We name the project and the target for the ExternalProject_Add() call
|
||||||
|
# to something that will highlight to the user what we are working on if
|
||||||
|
# something goes wrong and an error message is produced.
|
||||||
|
|
||||||
|
project(sqlite3-populate NONE)
|
||||||
|
|
||||||
|
|
||||||
|
# Pass through things we've already detected in the main project to avoid
|
||||||
|
# paying the cost of redetecting them again in ExternalProject_Add()
|
||||||
|
set(GIT_EXECUTABLE [==[C:/Program Files/Git/cmd/git.exe]==])
|
||||||
|
set(Git_VERSION [==[2.55.0.windows.5]==])
|
||||||
|
set_property(GLOBAL PROPERTY _CMAKE_FindGit_GIT_EXECUTABLE_VERSION
|
||||||
|
[==[C:/Program Files/Git/cmd/git.exe;2.55.0.windows.5]==]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
include(ExternalProject)
|
||||||
|
ExternalProject_Add(sqlite3-populate
|
||||||
|
"UPDATE_DISCONNECTED" "False" "GIT_REPOSITORY" "https://github.com/sjinks/sqlite3-cmake.git" "EXTERNALPROJECT_INTERNAL_ARGUMENT_SEPARATOR" "GIT_TAG" "v3.49.1"
|
||||||
|
SOURCE_DIR "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-src"
|
||||||
|
BINARY_DIR "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-build"
|
||||||
|
CONFIGURE_COMMAND ""
|
||||||
|
BUILD_COMMAND ""
|
||||||
|
INSTALL_COMMAND ""
|
||||||
|
TEST_COMMAND ""
|
||||||
|
USES_TERMINAL_DOWNLOAD YES
|
||||||
|
USES_TERMINAL_UPDATE YES
|
||||||
|
USES_TERMINAL_PATCH YES
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,208 @@
|
|||||||
|
# CMAKE generated file: DO NOT EDIT!
|
||||||
|
# Generated by "Ninja" Generator, CMake Version 4.3
|
||||||
|
|
||||||
|
# This file contains all the build statements describing the
|
||||||
|
# compilation DAG.
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# Write statements declared in CMakeLists.txt:
|
||||||
|
#
|
||||||
|
# Which is the root file.
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# Project: sqlite3-populate
|
||||||
|
# Configurations:
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Minimal version of Ninja required by this file
|
||||||
|
|
||||||
|
ninja_required_version = 1.5
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# Include auxiliary files.
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Include rules file.
|
||||||
|
|
||||||
|
include CMakeFiles\rules.ninja
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Logical path to working directory; prefix for absolute paths.
|
||||||
|
|
||||||
|
cmake_ninja_workdir = C$:\Users\Damian\Desktop\dlang-sqlite\out\build\x64-release\_deps\sqlite3-subbuild\
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Utility command for sqlite3-populate
|
||||||
|
|
||||||
|
build sqlite3-populate: phony CMakeFiles\sqlite3-populate CMakeFiles\sqlite3-populate-complete sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-done sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-build sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-configure sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-download sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-install sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-mkdir sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-patch sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-test sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-update
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Utility command for edit_cache
|
||||||
|
|
||||||
|
build CMakeFiles\edit_cache.util: CUSTOM_COMMAND
|
||||||
|
COMMAND = C:\Windows\system32\cmd.exe /C "cd /D C:\Users\Damian\Desktop\dlang-sqlite\out\build\x64-release\_deps\sqlite3-subbuild && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E echo "No interactive CMake dialog available.""
|
||||||
|
DESC = No interactive CMake dialog available...
|
||||||
|
restat = 1
|
||||||
|
|
||||||
|
build edit_cache: phony CMakeFiles\edit_cache.util
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Utility command for rebuild_cache
|
||||||
|
|
||||||
|
build CMakeFiles\rebuild_cache.util: CUSTOM_COMMAND
|
||||||
|
COMMAND = C:\Windows\system32\cmd.exe /C "cd /D C:\Users\Damian\Desktop\dlang-sqlite\out\build\x64-release\_deps\sqlite3-subbuild && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --regenerate-during-build -SC:\Users\Damian\Desktop\dlang-sqlite\out\build\x64-release\_deps\sqlite3-subbuild -BC:\Users\Damian\Desktop\dlang-sqlite\out\build\x64-release\_deps\sqlite3-subbuild"
|
||||||
|
DESC = Running CMake to regenerate build system...
|
||||||
|
pool = console
|
||||||
|
restat = 1
|
||||||
|
|
||||||
|
build rebuild_cache: phony CMakeFiles\rebuild_cache.util
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Phony custom command for CMakeFiles\sqlite3-populate
|
||||||
|
|
||||||
|
build CMakeFiles\sqlite3-populate | ${cmake_ninja_workdir}CMakeFiles\sqlite3-populate: phony CMakeFiles\sqlite3-populate-complete
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Custom command for CMakeFiles\sqlite3-populate-complete
|
||||||
|
|
||||||
|
build CMakeFiles\sqlite3-populate-complete sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-done | ${cmake_ninja_workdir}CMakeFiles\sqlite3-populate-complete ${cmake_ninja_workdir}sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-done: CUSTOM_COMMAND sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-install sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-mkdir sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-download sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-update sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-patch sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-configure sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-build sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-install sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-test
|
||||||
|
COMMAND = C:\Windows\system32\cmd.exe /C "cd /D C:\Users\Damian\Desktop\dlang-sqlite\out\build\x64-release\_deps\sqlite3-subbuild && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E make_directory C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/CMakeFiles && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E touch C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/CMakeFiles/sqlite3-populate-complete && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E touch C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-done"
|
||||||
|
DESC = Completed 'sqlite3-populate'
|
||||||
|
restat = 1
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Custom command for sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-build
|
||||||
|
|
||||||
|
build sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-build | ${cmake_ninja_workdir}sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-build: CUSTOM_COMMAND sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-configure
|
||||||
|
COMMAND = C:\Windows\system32\cmd.exe /C "cd /D C:\Users\Damian\Desktop\dlang-sqlite\out\build\x64-release\_deps\sqlite3-build && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E echo_append && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E touch C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-build"
|
||||||
|
DESC = No build step for 'sqlite3-populate'
|
||||||
|
restat = 1
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Custom command for sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-configure
|
||||||
|
|
||||||
|
build sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-configure | ${cmake_ninja_workdir}sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-configure: CUSTOM_COMMAND sqlite3-populate-prefix\tmp\sqlite3-populate-cfgcmd.txt sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-patch
|
||||||
|
COMMAND = C:\Windows\system32\cmd.exe /C "cd /D C:\Users\Damian\Desktop\dlang-sqlite\out\build\x64-release\_deps\sqlite3-build && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E echo_append && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E touch C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-configure"
|
||||||
|
DESC = No configure step for 'sqlite3-populate'
|
||||||
|
restat = 1
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Custom command for sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-download
|
||||||
|
|
||||||
|
build sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-download | ${cmake_ninja_workdir}sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-download: CUSTOM_COMMAND sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-gitinfo.txt sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-mkdir
|
||||||
|
COMMAND = C:\Windows\system32\cmd.exe /C "cd /D C:\Users\Damian\Desktop\dlang-sqlite\out\build\x64-release\_deps && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE -P C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/tmp/sqlite3-populate-gitclone.cmake && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E touch C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-download"
|
||||||
|
DESC = Performing download step (git clone) for 'sqlite3-populate'
|
||||||
|
pool = console
|
||||||
|
restat = 1
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Custom command for sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-install
|
||||||
|
|
||||||
|
build sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-install | ${cmake_ninja_workdir}sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-install: CUSTOM_COMMAND sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-build
|
||||||
|
COMMAND = C:\Windows\system32\cmd.exe /C "cd /D C:\Users\Damian\Desktop\dlang-sqlite\out\build\x64-release\_deps\sqlite3-build && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E echo_append && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E touch C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-install"
|
||||||
|
DESC = No install step for 'sqlite3-populate'
|
||||||
|
restat = 1
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Custom command for sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-mkdir
|
||||||
|
|
||||||
|
build sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-mkdir | ${cmake_ninja_workdir}sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-mkdir: CUSTOM_COMMAND
|
||||||
|
COMMAND = C:\Windows\system32\cmd.exe /C "cd /D C:\Users\Damian\Desktop\dlang-sqlite\out\build\x64-release\_deps\sqlite3-subbuild && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -Dcfgdir= -P C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/tmp/sqlite3-populate-mkdirs.cmake && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E touch C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-mkdir"
|
||||||
|
DESC = Creating directories for 'sqlite3-populate'
|
||||||
|
restat = 1
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Custom command for sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-patch
|
||||||
|
|
||||||
|
build sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-patch | ${cmake_ninja_workdir}sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-patch: CUSTOM_COMMAND sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-patch-info.txt sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-update
|
||||||
|
COMMAND = C:\Windows\system32\cmd.exe /C "cd /D C:\Users\Damian\Desktop\dlang-sqlite\out\build\x64-release\_deps\sqlite3-subbuild && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E echo_append && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E touch C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-patch"
|
||||||
|
DESC = No patch step for 'sqlite3-populate'
|
||||||
|
pool = console
|
||||||
|
restat = 1
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Custom command for sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-test
|
||||||
|
|
||||||
|
build sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-test | ${cmake_ninja_workdir}sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-test: CUSTOM_COMMAND sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-install
|
||||||
|
COMMAND = C:\Windows\system32\cmd.exe /C "cd /D C:\Users\Damian\Desktop\dlang-sqlite\out\build\x64-release\_deps\sqlite3-build && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E echo_append && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E touch C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/src/sqlite3-populate-stamp/sqlite3-populate-test"
|
||||||
|
DESC = No test step for 'sqlite3-populate'
|
||||||
|
restat = 1
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Custom command for sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-update
|
||||||
|
|
||||||
|
build sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-update | ${cmake_ninja_workdir}sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-update: CUSTOM_COMMAND sqlite3-populate-prefix\tmp\sqlite3-populate-gitupdate.cmake sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-update-info.txt sqlite3-populate-prefix\src\sqlite3-populate-stamp\sqlite3-populate-download
|
||||||
|
COMMAND = C:\Windows\system32\cmd.exe /C "cd /D C:\Users\Damian\Desktop\dlang-sqlite\out\build\x64-release\_deps\sqlite3-src && "C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -Dcan_fetch=YES -DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE -P C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/sqlite3-populate-prefix/tmp/sqlite3-populate-gitupdate.cmake"
|
||||||
|
DESC = Performing update step for 'sqlite3-populate'
|
||||||
|
pool = console
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# Target aliases.
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# Folder targets.
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Folder: C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild
|
||||||
|
|
||||||
|
build codegen: phony
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Folder: C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild
|
||||||
|
|
||||||
|
build all: phony sqlite3-populate
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# Built-in targets
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Re-run CMake if any of its inputs changed.
|
||||||
|
|
||||||
|
build build.ninja C$:\Users\Damian\Desktop\dlang-sqlite\out\build\x64-release\_deps\sqlite3-subbuild\cmake_install.cmake: RERUN_CMAKE | C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\CMakeDetermineSystem.cmake C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\CMakeGenericSystem.cmake C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\CMakeInitializeConfigs.cmake C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\CMakeSystem.cmake.in C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\CMakeSystemSpecificInformation.cmake C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\CMakeSystemSpecificInitialize.cmake C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\ExternalProject.cmake C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\ExternalProject\PatchInfo.txt.in C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\ExternalProject\RepositoryInfo.txt.in C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\ExternalProject\UpdateInfo.txt.in C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\ExternalProject\cfgcmd.txt.in C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\ExternalProject\gitclone.cmake.in C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\ExternalProject\gitupdate.cmake.in C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\ExternalProject\mkdirs.cmake.in C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\ExternalProject\shared_internal_commands.cmake C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\Platform\Windows-Initialize.cmake C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\Platform\Windows.cmake C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\Platform\WindowsPaths.cmake CMakeCache.txt CMakeFiles\4.3.1-msvc1\CMakeSystem.cmake CMakeLists.txt sqlite3-populate-prefix\tmp\sqlite3-populate-mkdirs.cmake
|
||||||
|
pool = console
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# A missing CMake input file is not an error.
|
||||||
|
|
||||||
|
build C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\CMakeDetermineSystem.cmake C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\CMakeGenericSystem.cmake C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\CMakeInitializeConfigs.cmake C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\CMakeSystem.cmake.in C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\CMakeSystemSpecificInformation.cmake C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\CMakeSystemSpecificInitialize.cmake C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\ExternalProject.cmake C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\ExternalProject\PatchInfo.txt.in C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\ExternalProject\RepositoryInfo.txt.in C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\ExternalProject\UpdateInfo.txt.in C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\ExternalProject\cfgcmd.txt.in C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\ExternalProject\gitclone.cmake.in C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\ExternalProject\gitupdate.cmake.in C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\ExternalProject\mkdirs.cmake.in C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\ExternalProject\shared_internal_commands.cmake C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\Platform\Windows-Initialize.cmake C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\Platform\Windows.cmake C$:\Program$ Files\Microsoft$ Visual$ Studio\18\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-4.3\Modules\Platform\WindowsPaths.cmake CMakeCache.txt CMakeFiles\4.3.1-msvc1\CMakeSystem.cmake CMakeLists.txt sqlite3-populate-prefix\tmp\sqlite3-populate-mkdirs.cmake: phony
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Clean all the built files.
|
||||||
|
|
||||||
|
build clean: CLEAN
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Print all primary targets available.
|
||||||
|
|
||||||
|
build help: HELP
|
||||||
|
|
||||||
|
|
||||||
|
#############################################
|
||||||
|
# Make the all target the default.
|
||||||
|
|
||||||
|
default all
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
# Install script for directory: C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild
|
||||||
|
|
||||||
|
# Set the install prefix
|
||||||
|
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||||
|
set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/sqlite3-populate")
|
||||||
|
endif()
|
||||||
|
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||||
|
|
||||||
|
# Set the install configuration name.
|
||||||
|
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
|
||||||
|
if(BUILD_TYPE)
|
||||||
|
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
|
||||||
|
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
|
||||||
|
else()
|
||||||
|
set(CMAKE_INSTALL_CONFIG_NAME "")
|
||||||
|
endif()
|
||||||
|
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Set the component getting installed.
|
||||||
|
if(NOT CMAKE_INSTALL_COMPONENT)
|
||||||
|
if(COMPONENT)
|
||||||
|
message(STATUS "Install component: \"${COMPONENT}\"")
|
||||||
|
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
|
||||||
|
else()
|
||||||
|
set(CMAKE_INSTALL_COMPONENT)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Is this installation the result of a crosscompile?
|
||||||
|
if(NOT DEFINED CMAKE_CROSSCOMPILING)
|
||||||
|
set(CMAKE_CROSSCOMPILING "FALSE")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
|
||||||
|
"${CMAKE_INSTALL_MANIFEST_FILES}")
|
||||||
|
if(CMAKE_INSTALL_LOCAL_ONLY)
|
||||||
|
file(WRITE "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/install_local_manifest.txt"
|
||||||
|
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
|
||||||
|
endif()
|
||||||
|
if(CMAKE_INSTALL_COMPONENT)
|
||||||
|
if(CMAKE_INSTALL_COMPONENT MATCHES "^[a-zA-Z0-9_.+-]+$")
|
||||||
|
set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
|
||||||
|
else()
|
||||||
|
string(MD5 CMAKE_INST_COMP_HASH "${CMAKE_INSTALL_COMPONENT}")
|
||||||
|
set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INST_COMP_HASH}.txt")
|
||||||
|
unset(CMAKE_INST_COMP_HASH)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
|
||||||
|
file(WRITE "C:/Users/Damian/Desktop/dlang-sqlite/out/build/x64-release/_deps/sqlite3-subbuild/${CMAKE_INSTALL_MANIFEST}"
|
||||||
|
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
|
||||||
|
endif()
|
||||||
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Loaded 100 of 160 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user