Browse Source

Удалил Clang-Tools (#3172)

1vanK 2 years ago
parent
commit
209d251d9a

+ 0 - 10
Docs/GettingStarted.dox

@@ -348,16 +348,6 @@ If "URHO3D_DOCS" or "URHO3D_DOCS_QUIET" build option is set then a normal build
 
 The additional prerequisite for documentation build is Doxygen. Also Graphviz (optional) if you wish to generate graphical diagrams in the documentation. MSVC users on Windows host system may install HTML Help Workshop (optional) in order to get the compressed help file (*.chm).  When optional tool is not available in the host system, the corresponding build process is skipped accordingly. The internal host tools to dump the \ref ScriptAPI "AngelScript API" for the default \ref Script "scripting" subsystem and the \ref LuaScriptAPI "LuaScript API" (when the LuaScript subsystem is also enabled) are being built at the same time when all the native tools are built. When the build tree is being configured not to build any host tools then the 'doc' target will simply instruct Doxygen to process the existing API dump files that are already pre-generated in the repository.
 
-\section Building_Clang_tools Clang-tools build (EXPERIMENTAL)
-
-If "URHO3D_CLANG_TOOLS" build option is set then CMake would generate a special build tree for the purpose of developing the Clang-tools. Before doing this, the development software package of LLVM/Clang version 3.9.0 must be already installed in the host system. Alternatively, you can download LLVM/Clang source files from Clang's SVN repo, build and install it into the host system. If it is not installed in a system-wide installation location then use the LLVM_CLANG_ROOT environment variable to point to the root path of this custom location (the root is the parent directory containing the bin, lib, include and share subdirectories). You may want to follow the [Clang's Getting Started instruction](http://clang.llvm.org/get_started.html) to guide you through this.
-
-Perhaps the easiest way to get Clang installed is by using Emscripten-SDK. If you have already built Emscripten-SDK in your host system then you can also use the SDK to install the Fastcomp/Clang by navigating to the Fastcomp/Clang build tree (e.g. emsdk_portable/clang/fastcomp/build_master_64) and issuing a 'make install' command. However, Emscripten-SDK does not automatically checkout "extra Clang tools", so before issuing a 'make install' you may want to take a step back to manually checkout the "extra Clang tools" into the corresponding subdirectory in the Fastcomp/Clang source tree (e.g. emsdk_portable/clang/fastcomp/src/tools/clang/tools/extra), then rebuild and install as usual. Using Fastcomp/Clang is fine for our purpose because we are only interested in using Clang as 3rd-party library instead of as compiler.
-
-A special note to Linux users, install the development software package for 'libedit' when you want full command line interface features like command history and command editing in clang-query tool. Install it before generating any of the LLVM/Clang or Fastcomp/Clang build tree.
-
-Check the Source/Clang-Tools/CMakeLists.txt to get the list of targets currently available or under development. Normal build targets won't work properly in this special build tree. See also https://github.com/urho3d/Urho3D/issues/887 to find out more about the current development plan and leave a comment there if you would like to help to contribute the development.
-
 \section Building_Shaders Compiling Direct3D shaders
 
 When building for Direct3D9 with the Windows 8 SDK (Visual Studio 2012+), copy d3dcompiler_46.dll from "C:\Program Files (x86)\Windows Kits\8.0\bin\x86" to build tree's "bin" directory so that Urho3D executables will run correctly. When building for Direct3D11, copy d3dcompiler_47.dll from "C:\Program Files (x86)\Windows Kits\8.1\bin\x86" to the "bin" directory. In both cases, if compiling Urho3D as 64-bit, copy from the "bin\x64" directory instead.

+ 0 - 1
Docs/Urho3D.dox

@@ -88,7 +88,6 @@ Urho3D uses the following third-party libraries:
 - Lua 5.1 (https://www.lua.org)
 - LuaJIT 2.1.0+ (http://www.luajit.org)
 - LZ4 1.7.5 (https://github.com/lz4/lz4)
-- Mustache 1.0 (https://mustache.github.io, https://github.com/kainjow/Mustache)
 - nanodbc 2.12.4+ (https://lexicalunit.github.io/nanodbc)
 - Open Asset Import Library 4.1.0 (http://assimp.sourceforge.net)
 - pugixml 1.12+ (http://pugixml.org)

+ 0 - 4
Source/CMakeLists.txt

@@ -52,10 +52,6 @@ endif ()
 add_subdirectory (ThirdParty)
 add_subdirectory (Urho3D)
 
-if (URHO3D_CLANG_TOOLS)
-    add_subdirectory (Clang-Tools)
-endif ()
-
 # In order to get clean module segregation, always exclude player/samples from AAR
 if (NOT ANDROID)
     add_subdirectory (Tools)

+ 0 - 177
Source/Clang-Tools/Annotator/Annotator.cpp

@@ -1,177 +0,0 @@
-// Copyright (c) 2008-2023 the Urho3D project
-// License: MIT
-
-#include <clang/ASTMatchers/ASTMatchFinder.h>
-#include <clang/Tooling/CommonOptionsParser.h>
-#include <clang/Tooling/Refactoring.h>
-
-#include <unordered_map>
-#include <unordered_set>
-
-using namespace clang;
-using namespace clang::ast_matchers;
-using namespace clang::driver;
-using namespace clang::tooling;
-using namespace llvm;
-
-static cl::extrahelp commonHelp(CommonOptionsParser::HelpMessage);
-static cl::extrahelp moreHelp(
-    "\tFor example, to run Annotator on all files in a subtree of the\n"
-    "\tsource tree, use:\n"
-    "\n"
-    "\t  find path/in/substree -name '*.cpp'|xargs Annotator -p build/path\n"
-    "\n"
-    "\tNote, that path/in/subtree and current directory should follow the\n"
-    "\trules described above.\n"
-    "\n"
-    "Most probably you want to invoke 'annotate' built-in target instead of invoking this tool\n"
-    "directly. The 'annotate' target invokes this tool in a right context prepared by build system.\n"
-    "\n"
-);
-
-static cl::OptionCategory annotatorCategory("Annotator options");
-
-// ClangTool only takes a reference to the array list without owning it, so we need to keep the filtered list ourselves
-class PathFilter
-{
-public:
-    template <typename Fn> PathFilter(const std::vector<std::string> sourcePaths, Fn fn)
-    {
-        std::copy_if(sourcePaths.begin(), sourcePaths.end(), std::back_inserter(pathList_), fn);
-    }
-
-    std::vector<std::string> GetPathList() {
-        return pathList_;
-    }
-
-private:
-    std::vector<std::string> pathList_;
-};
-
-struct Data
-{
-    std::unordered_set<std::string> exposedSymbols_;
-    std::unordered_set<std::string> annotatedSymbols_;
-};
-
-static const std::string categories_[] = {"class", "enum"};
-static std::unordered_map<std::string, Data> categoryData_;
-
-class ExtractCallback : public MatchFinder::MatchCallback
-{
-public :
-    virtual void run(const MatchFinder::MatchResult& result)
-    {
-        for (auto& i: categories_)
-        {
-            auto symbol = result.Nodes.getNodeAs<StringLiteral>(i);
-            if (symbol)
-                categoryData_[i].exposedSymbols_.insert(symbol->getString());
-        }
-    }
-
-    virtual void onStartOfTranslationUnit()
-    {
-        static unsigned count = sizeof("Extracting") / sizeof(char) - 1;
-        outs() << '.' << (++count % 100 ? "" : "\n");   // Sending a heart beat
-    }
-};
-
-class AnnotateCallback : public MatchFinder::MatchCallback
-{
-public :
-    AnnotateCallback(Replacements& replacements) :
-        replacements_(replacements)
-    {
-    }
-
-    virtual void run(const MatchFinder::MatchResult& result)
-    {
-        for (auto& i: categories_)
-        {
-            auto symbol = result.Nodes.getNodeAs<NamedDecl>(i);
-            if (symbol)
-            {
-                auto& data = categoryData_[i];
-                if (data.annotatedSymbols_.find(symbol->getName()) == data.annotatedSymbols_.end() &&
-                    data.exposedSymbols_.find(symbol->getName()) == data.exposedSymbols_.end())
-                {
-                    replacements_.insert(Replacement(*result.SourceManager, symbol->getLocation(), 0, "NONSCRIPTABLE "));
-                    data.annotatedSymbols_.insert(symbol->getName());
-                }
-            }
-        }
-    }
-
-    virtual void onStartOfTranslationUnit()
-    {
-        static unsigned count = sizeof("Annotating") / sizeof(char) - 1;
-        outs() << '.' << (++count % 100 ? "" : "\n");
-    }
-
-private:
-    Replacements& replacements_;
-};
-
-int main(int argc, const char** argv)
-{
-    // Parse the arguments and pass them to the the internal sub-tools
-    CommonOptionsParser optionsParser(argc, argv, annotatorCategory);
-    PathFilter bindingPathFilter
-        (optionsParser.getSourcePathList(), [](const std::string& path) { return path.find("API.cpp") != std::string::npos; });
-    PathFilter nonBindingPathFilter
-        (optionsParser.getSourcePathList(), [](const std::string& path) { return path.find("API.cpp") == std::string::npos; });
-    ClangTool bindingExtractor(optionsParser.getCompilations(), bindingPathFilter.GetPathList());
-    RefactoringTool annotator(optionsParser.getCompilations(), nonBindingPathFilter.GetPathList());
-
-    // Setup finder to match against AST nodes from existing AngelScript binding source files
-    ExtractCallback extractCallback;
-    MatchFinder bindingFinder;
-    // Find exposed classes (they are registered through RegisterObjectType(), RegisterRefCounted(), RegisterObject(), etc)
-    bindingFinder.addMatcher(
-        memberCallExpr(
-            callee(
-                methodDecl(hasName("RegisterObjectType"))),
-            hasArgument(0, stringLiteral().bind("class"))), &extractCallback);
-    bindingFinder.addMatcher(
-        callExpr(
-            hasDeclaration(
-                functionDecl(hasParameter(1, hasName("className")))),
-            hasArgument(1, stringLiteral().bind("class"))), &extractCallback);
-    // Find exposed enums
-    bindingFinder.addMatcher(
-        memberCallExpr(
-            callee(
-                methodDecl(hasName("RegisterEnum"))),
-            hasArgument(0, stringLiteral().bind("enum"))), &extractCallback);
-
-    // Setup finder to match against AST nodes for annotating Urho3D library source files
-    AnnotateCallback annotateCallback(annotator.getReplacements());
-    MatchFinder annotateFinder;
-    // Find exported class declarations with Urho3D namespace
-    annotateFinder.addMatcher(
-        recordDecl(
-            unless(hasAttr(attr::Annotate)),
-#ifndef _MSC_VER
-            hasAttr(attr::Visibility),
-#else
-            hasAttr(attr::DLLExport),
-#endif
-            matchesName("^::Urho3D::")).bind("class"), &annotateCallback);
-    // Find enum declarations with Urho3D namespace
-    annotateFinder.addMatcher(
-        enumDecl(
-            unless(hasAttr(attr::Annotate)),
-            matchesName("^::Urho3D::")).bind("enum"), &annotateCallback);
-
-    // Unbuffered stdout stream to keep the Travis-CI's log flowing and thus prevent it from killing a potentially long running job
-    outs().SetUnbuffered();
-
-    // Success when both sub-tools are run successfully
-    return (outs() << "Extracting", true) &&
-           bindingExtractor.run(newFrontendActionFactory(&bindingFinder).get()) == EXIT_SUCCESS &&
-           (outs() << "\nAnnotating", true) &&
-           annotator.runAndSave(newFrontendActionFactory(&annotateFinder).get()) == EXIT_SUCCESS &&
-           (outs() << "\n", true) ?
-        EXIT_SUCCESS : EXIT_FAILURE;
-}

+ 0 - 11
Source/Clang-Tools/Annotator/CMakeLists.txt

@@ -1,11 +0,0 @@
-# Copyright (c) 2008-2023 the Urho3D project
-# License: MIT
-
-# Define target name
-set (TARGET_NAME Annotator)
-
-# Define source files
-define_source_files ()
-
-# Setup target
-setup_executable (TOOL NODEPS)

+ 0 - 110
Source/Clang-Tools/AutoBinder/AutoBinder.cpp

@@ -1,110 +0,0 @@
-// Copyright (c) 2008-2023 the Urho3D project
-// License: MIT
-
-#include <clang/ASTMatchers/ASTMatchFinder.h>
-#include <clang/Driver/Options.h>
-#include <clang/Tooling/CommonOptionsParser.h>
-#include <clang/Tooling/Tooling.h>
-
-#include <Mustache/mustache.hpp>
-
-#include <unordered_set>
-
-using namespace clang;
-using namespace clang::ast_matchers;
-using namespace clang::driver;
-using namespace clang::tooling;
-using namespace llvm;
-
-static cl::extrahelp commonHelp(CommonOptionsParser::HelpMessage);
-static cl::extrahelp moreHelp(
-    "\tFor example, to run AutoBinder on all files in a subtree of the\n"
-    "\tsource tree, use:\n"
-    "\n"
-    "\t  find path/in/substree -name '*.cpp'|xargs AutoBinder -p build/path \\\n"
-    "\t  -t template/path -o output/path -s script0 -s script1\n"
-    "\n"
-    "\tNote, that path/in/subtree and current directory should follow the\n"
-    "\trules described above.\n"
-    "\n"
-    "Most probably you want to invoke 'autobinder' built-in target instead of invoking this tool\n"
-    "directly. The 'autobinder' target invokes this tool in a right context prepared by build system.\n"
-    "\n"
-);
-
-static cl::OptionCategory autobinderCategory("AutoBinder options");
-static std::unique_ptr<opt::OptTable> options(createDriverOptTable());
-static cl::opt<std::string> templatePath("t", cl::desc("Template path"), cl::cat(autobinderCategory));
-static cl::opt<std::string> outputPath("o", cl::desc("Output path"), cl::cat(autobinderCategory));
-static cl::list<std::string> scripts("s", cl::desc("Script subsystems"), cl::cat(autobinderCategory));
-
-struct Data
-{
-    std::unordered_set<std::string> symbols_;
-};
-
-static const std::string categories_[] = {"class", "enum"};
-static std::unordered_map<std::string, Data> categoryData_;
-
-class ExtractCallback : public MatchFinder::MatchCallback
-{
-public :
-    virtual void run(const MatchFinder::MatchResult& result)
-    {
-        for (auto& i: categories_)
-        {
-            auto symbol = result.Nodes.getNodeAs<StringLiteral>(i);
-            if (symbol)
-                categoryData_[i].symbols_.insert(symbol->getString());
-        }
-    }
-
-    virtual void onStartOfTranslationUnit()
-    {
-        static unsigned count = sizeof("Extracting") / sizeof(char) - 1;
-        outs() << '.' << (++count % 100 ? "" : "\n");   // Sending a heart beat
-    }
-};
-
-static int BindingGenerator()
-{
-    // TODO: WIP
-    return EXIT_SUCCESS;
-}
-
-int main(int argc, const char** argv)
-{
-    // Parse the arguments and pass them to the the internal sub-tools
-    CommonOptionsParser optionsParser(argc, argv, autobinderCategory);
-    ClangTool bindingExtractor(optionsParser.getCompilations(), optionsParser.getSourcePathList());
-
-    // Setup finder to match against AST nodes from Urho3D library source files
-    ExtractCallback extractCallback;
-    MatchFinder bindingFinder;
-    // Find exported class declarations with Urho3D namespace
-    bindingFinder.addMatcher(
-        recordDecl(
-            unless(hasAttr(attr::Annotate)),
-#ifndef _MSC_VER
-            hasAttr(attr::Visibility),
-#else
-            hasAttr(attr::DLLExport),
-#endif
-            matchesName("^::Urho3D::")).bind("class"), &extractCallback);
-    // Find enum declarations with Urho3D namespace
-    bindingFinder.addMatcher(
-        enumDecl(
-            unless(hasAttr(attr::Annotate)),
-            matchesName("^::Urho3D::")).bind("enum"), &extractCallback);
-
-    // Unbuffered stdout stream to keep the Travis-CI's log flowing and thus prevent it from killing a potentially long running job
-    outs().SetUnbuffered();
-
-    // Success when both sub-tools are run successfully
-    return (outs() << "Extracting", true) &&
-           bindingExtractor.run(newFrontendActionFactory(&bindingFinder).get()) == EXIT_SUCCESS &&
-           (outs() << "\nBinding", true) &&
-           BindingGenerator() == EXIT_SUCCESS &&
-           (outs() << "\n", true) ?
-        EXIT_SUCCESS : EXIT_FAILURE;
-}

+ 0 - 16
Source/Clang-Tools/AutoBinder/CMakeLists.txt

@@ -1,16 +0,0 @@
-# Copyright (c) 2008-2023 the Urho3D project
-# License: MIT
-
-# Define target name
-set (TARGET_NAME AutoBinder)
-
-# Define source files
-define_source_files ()
-
-# Define dependency libs
-add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR}/../../ThirdParty/Mustache Mustache)
-
-# Setup target
-setup_executable (TOOL NODEPS)
-install (DIRECTORY Templates DESTINATION ${DEST_RUNTIME_DIR})
-add_dependencies (${TARGET_NAME} Mustache)

+ 0 - 19
Source/Clang-Tools/AutoBinder/Templates/AngelScript/source.mustache

@@ -1,19 +0,0 @@
-// Copyright (c) 2008-2023 the Urho3D project
-// License: MIT
-
-#include "../Precompiled.h"
-
-namespace Urho3D
-{
-
-static void RegisterEnums(asIScriptEngine* engine)
-{
-   // TODO: Render the string template for enums here
-}
-
-void RegisterAngelScriptAPI(asIScriptEngine* engine)
-{
-    RegisterEnums(engine);
-}
-
-}

+ 0 - 112
Source/Clang-Tools/CMakeLists.txt

@@ -1,112 +0,0 @@
-# Copyright (c) 2008-2023 the Urho3D project
-# License: MIT
-
-if (CMAKE_PROJECT_NAME STREQUAL Urho3D)
-    # Set project name
-    project (Urho3D-Clang-Tools)
-
-    # All Clang-tools must be natively built and output to bin/tool/clang subdir to differentiate them from the rest
-    set_output_directories (${CMAKE_BINARY_DIR}/bin/tool/clang RUNTIME PDB)
-else ()
-    # Set CMake minimum version
-    cmake_minimum_required (VERSION 3.10.2)
-
-    # Set project name
-    project (Urho3D-ExternalProject-${URHO3D_CLANG_TOOLS})
-
-    # Set CMake modules search path
-    set (CMAKE_MODULE_PATH ${BAKED_CMAKE_SOURCE_DIR}/cmake/Modules)
-
-    # Include UrhoCommon.cmake module after setting project name
-    include (UrhoCommon)
-
-    # Setup SDK-like include dir in the build tree for building the Clang-tools
-    file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${DEST_INCLUDE_DIR}/ThirdParty)
-endif ()
-
-# LLVM/Clang is assumed to be installed in a system-wide location when not explicitly defined using env-var
-if (DEFINED ENV{LLVM_CLANG_ROOT})
-    set (CMAKE_SYSROOT $ENV{LLVM_CLANG_ROOT})
-endif ()
-execute_process (COMMAND ${LLVM_CONFIG} --bindir OUTPUT_VARIABLE LLVM_BINDIR OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
-
-# No exception and no RTTI
-if (MSVC)
-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHs-c- /GR-")
-else ()
-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
-endif ()
-
-# Define common dependency libs
-set (LIBS clangTooling clangFrontend clangDriver clangParse clangSerialization clangSema clangEdit clangAnalysis clangToolingCore
-        clangRewrite clangLex clangASTMatchers clangAST clangBasic
-        LLVMBitReader LLVMMC LLVMMCParser LLVMOption LLVMSupport)
-execute_process (COMMAND ${LLVM_CONFIG} --system-libs OUTPUT_VARIABLE LLVM_SYSLIBS OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
-string (REGEX REPLACE " *-l" ";" LLVM_SYSLIBS "${LLVM_SYSLIBS}")   # Stringify against empty output variable
-list (APPEND LIBS ${LLVM_SYSLIBS})
-set (INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${DEST_INCLUDE_DIR}/ThirdParty)
-
-# Clang-tools can be built in two ways: on the fly in normal build one at a time or build all of them in a special Clang-tools build tree (for development)
-if (CMAKE_PROJECT_NAME MATCHES ExternalProject)
-    # Externally build the Clang-tool for actual use in a normal build
-    add_subdirectory (${URHO3D_CLANG_TOOLS})
-else ()
-    # Define source files for the tools
-    get_target_property (SOURCES Urho3D SOURCES)
-    string (REGEX REPLACE "[^;]+\\.h" "" SOURCES "${SOURCES}")   # Stringify to preserve the semicolons
-    string (REGEX REPLACE "[^;]+generated[^;]+\\.cpp" "" SOURCES "${SOURCES}")
-    file (GLOB BINDING_SOURCES RELATIVE ${CMAKE_SOURCE_DIR}/Source/Urho3D ${CMAKE_SOURCE_DIR}/Source/Urho3D/Script/*API.cpp)
-    string (REGEX REPLACE "[^;]+API\\.cpp" "" ANNOTATED_SOURCES "${SOURCES}")
-
-    # List of tools
-    add_subdirectory (Annotator)
-    add_subdirectory (AutoBinder)
-
-    # List of targets
-    if (EXISTS ${LLVM_BINDIR}/clang-query)  # This tool is from clang-tools-extra repository which user may have not installed
-        add_custom_target (ast-query
-            COMMAND ${CMAKE_COMMAND} -E echo "Building AST for query, please be patient..."
-            COMMAND ${LLVM_BINDIR}/clang-query -p ${CMAKE_BINARY_DIR} $$option ${SOURCES}
-            WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/Source/Urho3D
-            COMMENT "Executing clang-query on Urho3D library source files")
-    endif ()
-    add_custom_target (ast
-        COMMAND ${CMAKE_COMMAND} -E echo "Usage: option=-help make ast"
-        COMMAND ${LLVM_BINDIR}/clang-check -p ${CMAKE_BINARY_DIR} $$option ${SOURCES}
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/Source/Urho3D
-        COMMENT "Executing clang-check on Urho3D library source files")
-    add_custom_target (binding-ast
-        COMMAND ${CMAKE_COMMAND} -E echo "Usage: option=-help make binding-ast"
-        COMMAND ${LLVM_BINDIR}/clang-check -p ${CMAKE_BINARY_DIR} $$option ${BINDING_SOURCES}
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/Source/Urho3D
-        COMMENT "Executing clang-check on (existing) AngelScript API bindings source files")
-    add_custom_target (annotate
-        COMMAND ${CMAKE_BINARY_DIR}/bin/tool/clang/Annotator -p ${CMAKE_BINARY_DIR} ${SOURCES}
-        DEPENDS Annotator
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/Source/Urho3D
-        COMMENT "Annotating Urho3D library source files")
-    add_custom_target (autobinder
-        COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/Source/Urho3D/generated
-        COMMAND ${CMAKE_BINARY_DIR}/bin/tool/clang/AutoBinder -p ${CMAKE_BINARY_DIR} -t ${CMAKE_CURRENT_SOURCE_DIR}/AutoBinder/Templates -o ${CMAKE_BINARY_DIR}/Source/Urho3D/generated -s AngelScript -s LuaScript -s JavaScript ${ANNOTATED_SOURCES}
-        DEPENDS AutoBinder
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/Source/Urho3D
-        COMMENT "Auto-binding for all script subsystems")
-    add_custom_target (autobinder-angelscript
-        COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/Source/Urho3D/generated
-        COMMAND ${CMAKE_BINARY_DIR}/bin/tool/clang/AutoBinder -p ${CMAKE_BINARY_DIR} -t ${CMAKE_CURRENT_SOURCE_DIR}/AutoBinder/Templates -o ${CMAKE_BINARY_DIR}/Source/Urho3D/generated -s AngelScript ${ANNOTATED_SOURCES}
-        DEPENDS AutoBinder
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/Source/Urho3D
-        COMMENT "Auto-binding for AngelScript")
-    add_custom_target (autobinder-luascript
-        COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/Source/Urho3D/generated
-        COMMAND ${CMAKE_BINARY_DIR}/bin/tool/clang/AutoBinder -p ${CMAKE_BINARY_DIR} -t ${CMAKE_CURRENT_SOURCE_DIR}/AutoBinder/Templates -o ${CMAKE_BINARY_DIR}/Source/Urho3D/generated -s LuaScript ${ANNOTATED_SOURCES}
-        DEPENDS AutoBinder
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/Source/Urho3D
-        COMMENT "Auto-binding for LuaScript")
-    add_custom_target (autobinder-javascript
-        COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/Source/Urho3D/generated
-        COMMAND ${CMAKE_BINARY_DIR}/bin/tool/clang/AutoBinder -p ${CMAKE_BINARY_DIR} -t ${CMAKE_CURRENT_SOURCE_DIR}/AutoBinder/Templates -o ${CMAKE_BINARY_DIR}/Source/Urho3D/generated -s JavaScript ${ANNOTATED_SOURCES}
-        DEPENDS AutoBinder
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/Source/Urho3D
-        COMMENT "Auto-binding for JavaScript")
-endif ()

+ 0 - 12
Source/ThirdParty/Mustache/CMakeLists.txt

@@ -1,12 +0,0 @@
-# Copyright (c) 2008-2023 the Urho3D project
-# License: MIT
-
-# Define target name
-set (TARGET_NAME Mustache)
-
-# Setup target
-add_custom_target (${TARGET_NAME} ALL)   # Dummy target just so that its post-build step can install headers to the build tree
-set (STATIC_LIBRARY_TARGETS ${STATIC_LIBRARY_TARGETS} ${TARGET_NAME} PARENT_SCOPE)
-
-# Install headers for building the Urho3D library
-install_header_files (DIRECTORY ./ DESTINATION ${DEST_INCLUDE_DIR}/ThirdParty/Mustache FILES_MATCHING PATTERN *.hpp USE_FILE_SYMLINK BUILD_TREE_ONLY)

+ 0 - 25
Source/ThirdParty/Mustache/LICENSE

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

+ 0 - 836
Source/ThirdParty/Mustache/mustache.hpp

@@ -1,836 +0,0 @@
-//
-// Copyright 2015 Kevin Wojniak
-//
-// Boost Software License - Version 1.0 - August 17th, 2003
-//
-// Permission is hereby granted, free of charge, to any person or organization
-// obtaining a copy of the software and accompanying documentation covered by
-// this license (the "Software") to use, reproduce, display, distribute,
-// execute, and transmit the Software, and to prepare derivative works of the
-// Software, and to permit third-parties to whom the Software is furnished to
-// do so, all subject to the following:
-//
-// The copyright notices in the Software and this entire statement, including
-// the above license grant, this restriction and the following disclaimer,
-// must be included in all copies of the Software, in whole or in part, and
-// all derivative works of the Software, unless such copies or derivative
-// works are solely in the form of machine-executable object code generated by
-// a source language processor.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-// DEALINGS IN THE SOFTWARE.
-//
-
-#ifndef MUSTACHE_HPP
-#define MUSTACHE_HPP
-
-#include <iostream>
-#include <sstream>
-#include <vector>
-#include <functional>
-#include <unordered_map>
-#include <memory>
-
-namespace Mustache {
-
-template <typename StringType>
-StringType trim(const StringType& s) {
-    auto it = s.begin();
-    while (it != s.end() && isspace(static_cast<int>(*it))) {
-        it++;
-    }
-    auto rit = s.rbegin();
-    while (rit.base() != it && isspace(*rit)) {
-        rit++;
-    }
-    return {it, rit.base()};
-}
-
-template <typename StringType>
-StringType escape(const StringType& s) {
-    StringType ret;
-    ret.reserve(s.size()*2);
-    for (const auto ch : s) {
-        switch (static_cast<char>(ch)) {
-            case '&':
-                ret.append("&amp;");
-                break;
-            case '<':
-                ret.append("&lt;");
-                break;
-            case '>':
-                ret.append("&gt;");
-                break;
-            case '\"':
-                ret.append("&quot;");
-                break;
-            case '\'':
-                ret.append("&apos;");
-                break;
-            default:
-                ret.append(1, ch);
-                break;
-        }
-    }
-    return ret;
-}
-
-template <typename StringType>
-class Data {
-public:
-    enum class Type {
-        Object,
-        String,
-        List,
-        True,
-        False,
-        Partial,
-        Lambda,
-        Invalid,
-    };
-    
-    using ObjectType = std::unordered_map<StringType, Data>;
-    using ListType = std::vector<Data>;
-    using PartialType = std::function<StringType()>;
-    using LambdaType = std::function<Data(const StringType&)>;
-    
-    // Construction
-    Data() : Data(Type::Object) {
-    }
-    Data(const StringType& string) : type_{Type::String} {
-        str_.reset(new StringType(string));
-    }
-    Data(const typename StringType::value_type* string) : type_{Type::String} {
-        str_.reset(new StringType(string));
-    }
-    Data(const ListType& list) : type_{Type::List} {
-        list_.reset(new ListType(list));
-    }
-    Data(Type type) : type_{type} {
-        switch (type_) {
-            case Type::Object:
-                obj_.reset(new ObjectType);
-                break;
-            case Type::String:
-                str_.reset(new StringType);
-                break;
-            case Type::List:
-                list_.reset(new ListType);
-                break;
-            default:
-                break;
-        }
-    }
-    Data(const StringType& name, const Data& var) : Data{} {
-        set(name, var);
-    }
-    Data(const PartialType& partial) : type_{Type::Partial} {
-        partial_.reset(new PartialType(partial));
-    }
-    Data(const LambdaType& lambda) : type_{Type::Lambda} {
-        lambda_.reset(new LambdaType(lambda));
-    }
-    static Data List() {
-        return {Data::Type::List};
-    }
-    
-    // Copying
-    Data(const Data& data) : type_(data.type_) {
-        if (data.obj_) {
-            obj_.reset(new ObjectType(*data.obj_));
-        } else if (data.str_) {
-            str_.reset(new StringType(*data.str_));
-        } else if (data.list_) {
-            list_.reset(new ListType(*data.list_));
-        } else if (data.partial_) {
-            partial_.reset(new PartialType(*data.partial_));
-        } else if (data.lambda_) {
-            lambda_.reset(new LambdaType(*data.lambda_));
-        }
-    }
-    
-    // Assignment
-    Data& operator= (const Data& data) {
-        if (&data != this) {
-            type_ = data.type_;
-            obj_.reset();
-            str_.reset();
-            list_.reset();
-            partial_.reset();
-            lambda_.reset();
-            if (data.obj_) {
-                obj_.reset(new ObjectType(*data.obj_));
-            } else if (data.str_) {
-                str_.reset(new StringType(*data.str_));
-            } else if (data.list_) {
-                list_.reset(new ListType(*data.list_));
-            } else if (data.partial_) {
-                partial_.reset(new PartialType(*data.partial_));
-            } else if (data.lambda_) {
-                lambda_.reset(new LambdaType(*data.lambda_));
-            }
-        }
-        return *this;
-    }
-
-    // Move
-    Data(Data&& data) : type_{data.type_} {
-        if (data.obj_) {
-            obj_ = std::move(data.obj_);
-        } else if (data.str_) {
-            str_ = std::move(data.str_);
-        } else if (data.list_) {
-            list_ = std::move(data.list_);
-        } else if (data.partial_) {
-            partial_ = std::move(data.partial_);
-        } else if (data.lambda_) {
-            lambda_ = std::move(data.lambda_);
-        }
-        data.type_ = Data::Type::Invalid;
-    }
-    Data& operator= (Data&& data) {
-        if (this != &data) {
-            obj_.reset();
-            str_.reset();
-            list_.reset();
-            partial_.reset();
-            lambda_.reset();
-            if (data.obj_) {
-                obj_ = std::move(data.obj_);
-            } else if (data.str_) {
-                str_ = std::move(data.str_);
-            } else if (data.list_) {
-                list_ = std::move(data.list_);
-            } else if (data.partial_) {
-                partial_ = std::move(data.partial_);
-            } else if (data.lambda_) {
-                lambda_ = std::move(data.lambda_);
-            }
-            type_ = data.type_;
-            data.type_ = Data::Type::Invalid;
-        }
-        return *this;
-    }
-    
-    // Type info
-    Type type() const {
-        return type_;
-    }
-    bool isObject() const {
-        return type_ == Type::Object;
-    }
-    bool isString() const {
-        return type_ == Type::String;
-    }
-    bool isList() const {
-        return type_ == Type::List;
-    }
-    bool isBool() const {
-        return type_ == Type::True || type_ == Type::False;
-    }
-    bool isTrue() const {
-        return type_ == Type::True;
-    }
-    bool isFalse() const {
-        return type_ == Type::False;
-    }
-    bool isPartial() const {
-        return type_ == Type::Partial;
-    }
-    bool isLambda() const {
-        return type_ == Type::Lambda;
-    }
-    
-    // Object data
-    void set(const StringType& name, const Data& var) {
-        if (isObject()) {
-            obj_->insert(std::pair<StringType,Data>{name, var});
-        }
-    }
-    bool exists(const StringType& name) const {
-        if (isObject() && obj_->find(name) == obj_->end()) {
-            return true;
-        }
-        return false;
-    }
-    const Data* get(const StringType& name) const {
-        if (!isObject()) {
-            return nullptr;
-        }
-        const auto& it = obj_->find(name);
-        if (it == obj_->end()) {
-            return nullptr;
-        }
-        return &it->second;
-    }
-    
-    // List data
-    void push_back(const Data& var) {
-        if (isList()) {
-            list_->push_back(var);
-        }
-    }
-    const ListType& list() const {
-        return *list_;
-    }
-    bool isEmptyList() const {
-        return isList() && list_->empty();
-    }
-    bool isNonEmptyList() const {
-        return isList() && !list_->empty();
-    }
-    Data& operator<< (const Data& data) {
-        push_back(data);
-        return *this;
-    }
-    
-    // String data
-    const StringType& stringValue() const {
-        return *str_;
-    }
-    
-    Data& operator[] (const StringType& key) {
-        return (*obj_)[key];
-    }
-    
-    const PartialType& partial() const {
-        return (*partial_);
-    }
-    
-    const LambdaType& lambda() const {
-        return (*lambda_);
-    }
-    
-    Data<StringType> callLambda(const StringType& text) const {
-        return (*lambda_)(text);
-    }
-
-private:
-    Type type_;
-    std::unique_ptr<ObjectType> obj_;
-    std::unique_ptr<StringType> str_;
-    std::unique_ptr<ListType> list_;
-    std::unique_ptr<PartialType> partial_;
-    std::unique_ptr<LambdaType> lambda_;
-};
-
-template <typename StringType>
-class Mustache {
-public:
-    Mustache(const StringType& input) {
-        Context ctx;
-        parse(input, ctx);
-    }
-    
-    bool isValid() const {
-        return errorMessage_.empty();
-    }
-
-    const StringType& errorMessage() const {
-        return errorMessage_;
-    }
-    
-    template <typename StreamType>
-	StreamType& render(const Data<StringType>& data, StreamType& stream) {
-		render(data, [&stream](const StringType& str) {
-			stream << str;
-		});
-		return stream;
-    }
-    
-    StringType render(const Data<StringType>& data) {
-        std::basic_ostringstream<typename StringType::value_type> ss;
-        return render(data, ss).str();
-    }
-
-	using RenderHandler = std::function<void(const StringType&)>;
-	void render(const Data<StringType>& data, const RenderHandler& handler) {
-        Context ctx{&data};
-		render(handler, ctx);
-	}
-
-private:
-    using StringSizeType = typename StringType::size_type;
-    
-    class DelimiterSet {
-    public:
-        StringType begin;
-        StringType end;
-        DelimiterSet() {
-            reset();
-        }
-        DelimiterSet(const StringType& b, const StringType& e) : begin(b), end(e) {}
-        bool isDefault() const { return begin == defaultBegin() && end == defaultEnd(); }
-        void reset() {
-            begin = defaultBegin();
-            end = defaultEnd();
-        }
-        static StringType defaultBegin() {
-            return StringType(2, '{');
-        }
-        static StringType defaultEnd() {
-            return StringType(2, '}');
-        }
-    };
-    
-    class Tag {
-    public:
-        enum class Type {
-            Invalid,
-            Variable,
-            UnescapedVariable,
-            SectionBegin,
-            SectionEnd,
-            SectionBeginInverted,
-            Comment,
-            Partial,
-            SetDelimiter,
-        };
-        StringType name;
-        Type type = Type::Invalid;
-        std::shared_ptr<StringType> sectionText;
-        std::shared_ptr<DelimiterSet> delimiterSet;
-        bool isSectionBegin() const {
-            return type == Type::SectionBegin || type == Type::SectionBeginInverted;
-        }
-        bool isSectionEnd() const {
-            return type == Type::SectionEnd;
-        }
-    };
-    
-    class Component {
-    public:
-        StringType text;
-        Tag tag;
-        std::vector<Component> children;
-        StringSizeType position = StringType::npos;
-        bool isText() const {
-            return tag.type == Tag::Type::Invalid;
-        }
-        bool isTag() const {
-            return tag.type != Tag::Type::Invalid;
-        }
-        Component() {}
-        Component(const StringType& t, StringSizeType p) : text(t), position(p) {}
-    };
-    
-    class Context {
-    public:
-        using DataType = Data<StringType>;
-
-        Context(const DataType* data) {
-            push(data);
-        }
-
-        Context() {
-        }
-
-        void push(const DataType* data) {
-            items_.insert(items_.begin(), data);
-        }
-
-        void pop() {
-            items_.erase(items_.begin());
-        }
-        
-        static std::vector<StringType> split(const StringType& s, char delim) {
-            std::vector<StringType> elems;
-            std::stringstream ss(s);
-            std::string item;
-            while (std::getline(ss, item, delim)) {
-                elems.push_back(item);
-            }
-            return elems;
-        }
-
-        const DataType* get(const StringType& name) const {
-            // process {{.}} name
-            if (name.size() == 1 && name.at(0) == '.') {
-                return items_.front();
-            }
-            // process {{a.b.c}} name
-            if (name.find('.', 1) != StringType::npos) {
-                const DataType* var{items_.front()};
-                for (const auto& n : split(name, '.')) {
-                    var = var->get(n);
-                    if (!var) {
-                        return nullptr;
-                    }
-                }
-                return var;
-            }
-            // process normal name
-            for (const auto& item : items_) {
-                const auto var = item->get(name);
-                if (var) {
-                    return var;
-                }
-            }
-            return nullptr;
-        }
-
-        Context(const Context&) = delete;
-        Context& operator= (const Context&) = delete;
-        
-        DelimiterSet delimiterSet;
-
-    private:
-        std::vector<const DataType*> items_;
-    };
-
-    class ContextPusher {
-    public:
-        ContextPusher(Context& ctx, const Data<StringType>* data) : ctx_(ctx) {
-            ctx.push(data);
-        }
-        ~ContextPusher() {
-            ctx_.pop();
-        }
-        ContextPusher(const ContextPusher&) = delete;
-        ContextPusher& operator= (const ContextPusher&) = delete;
-    private:
-        Context& ctx_;
-    };
-    
-    Mustache(const StringType& input, Context& ctx) {
-        parse(input, ctx);
-    }
-
-    void parse(const StringType& input, Context& ctx) {
-        using streamstring = std::basic_ostringstream<typename StringType::value_type>;
-        
-        const StringType braceDelimiterEndUnescaped(3, '}');
-        const StringSizeType inputSize{input.size()};
-        
-        bool currentDelimiterIsBrace{ctx.delimiterSet.isDefault()};
-        
-        std::vector<Component*> sections{&rootComponent_};
-        std::vector<StringSizeType> sectionStarts;
-        
-        StringSizeType inputPosition{0};
-        while (inputPosition != inputSize) {
-            
-            // Find the next tag start delimiter
-            const StringSizeType tagLocationStart{input.find(ctx.delimiterSet.begin, inputPosition)};
-            if (tagLocationStart == StringType::npos) {
-                // No tag found. Add the remaining text.
-                const Component comp{{input, inputPosition, inputSize - inputPosition}, inputPosition};
-                sections.back()->children.push_back(comp);
-                break;
-            } else if (tagLocationStart != inputPosition) {
-                // Tag found, add text up to this tag.
-                const Component comp{{input, inputPosition, tagLocationStart - inputPosition}, inputPosition};
-                sections.back()->children.push_back(comp);
-            }
-            
-            // Find the next tag end delimiter
-            StringSizeType tagContentsLocation{tagLocationStart + ctx.delimiterSet.begin.size()};
-            const bool tagIsUnescapedVar{currentDelimiterIsBrace && tagLocationStart != (inputSize - 2) && input.at(tagContentsLocation) == ctx.delimiterSet.begin.at(0)};
-            const StringType& currentTagDelimiterEnd{tagIsUnescapedVar ? braceDelimiterEndUnescaped : ctx.delimiterSet.end};
-            const auto currentTagDelimiterEndSize = currentTagDelimiterEnd.size();
-            if (tagIsUnescapedVar) {
-                ++tagContentsLocation;
-            }
-            StringSizeType tagLocationEnd{input.find(currentTagDelimiterEnd, tagContentsLocation)};
-            if (tagLocationEnd == StringType::npos) {
-                streamstring ss;
-                ss << "Unclosed tag at " << tagLocationStart;
-                errorMessage_.assign(ss.str());
-                return;
-            }
-            
-            // Parse tag
-            const StringType tagContents{trim(StringType{input, tagContentsLocation, tagLocationEnd - tagContentsLocation})};
-            Component comp;
-            if (!tagContents.empty() && tagContents[0] == '=') {
-                if (!parseSetDelimiterTag(tagContents, ctx.delimiterSet)) {
-                    streamstring ss;
-                    ss << "Invalid set delimiter tag at " << tagLocationStart;
-                    errorMessage_.assign(ss.str());
-                    return;
-                }
-                currentDelimiterIsBrace = ctx.delimiterSet.isDefault();
-                comp.tag.type = Tag::Type::SetDelimiter;
-                comp.tag.delimiterSet.reset(new DelimiterSet(ctx.delimiterSet));
-            }
-            if (comp.tag.type != Tag::Type::SetDelimiter) {
-                parseTagContents(tagIsUnescapedVar, tagContents, comp.tag);
-            }
-            comp.position = tagLocationStart;
-            sections.back()->children.push_back(comp);
-            
-            // Start next search after this tag
-            inputPosition = tagLocationEnd + currentTagDelimiterEndSize;
-
-            // Push or pop sections
-            if (comp.tag.isSectionBegin()) {
-                sections.push_back(&sections.back()->children.back());
-                sectionStarts.push_back(inputPosition);
-            } else if (comp.tag.isSectionEnd()) {
-                if (sections.size() == 1) {
-                    streamstring ss;
-                    ss << "Unopened section \"" << comp.tag.name << "\" at " << comp.position;
-                    errorMessage_.assign(ss.str());
-                    return;
-                }
-                sections.back()->tag.sectionText.reset(new StringType(input.substr(sectionStarts.back(), tagLocationStart - sectionStarts.back())));
-                sections.pop_back();
-                sectionStarts.pop_back();
-            }
-        }
-        
-        // Check for sections without an ending tag
-        walk([this](Component& comp, int) -> WalkControl {
-            if (!comp.tag.isSectionBegin()) {
-                return WalkControl::Continue;
-            }
-            if (comp.children.empty() || !comp.children.back().tag.isSectionEnd() || comp.children.back().tag.name != comp.tag.name) {
-                streamstring ss;
-                ss << "Unclosed section \"" << comp.tag.name << "\" at " << comp.position;
-                errorMessage_.assign(ss.str());
-                return WalkControl::Stop;
-            }
-            comp.children.pop_back(); // remove now useless end section component
-            return WalkControl::Continue;
-        });
-        if (!errorMessage_.empty()) {
-            return;
-        }
-    }
-    
-    enum class WalkControl {
-        Continue,
-        Stop,
-        Skip,
-    };
-    using WalkCallback = std::function<WalkControl(Component&, int)>;
-    
-    void walk(const WalkCallback& callback) const {
-        walkChildren(callback, rootComponent_);
-    }
-
-    void walkChildren(const WalkCallback& callback, const Component& comp) const {
-        for (auto childComp : comp.children) {
-            if (walkComponent(callback, childComp) != WalkControl::Continue) {
-                break;
-            }
-        }
-    }
-    
-    WalkControl walkComponent(const WalkCallback& callback, Component& comp, int depth = 0) const {
-        WalkControl control{callback(comp, depth)};
-        if (control == WalkControl::Stop) {
-            return control;
-        } else if (control == WalkControl::Skip) {
-            return WalkControl::Continue;
-        }
-        ++depth;
-        for (auto childComp : comp.children) {
-            control = walkComponent(callback, childComp, depth);
-            if (control == WalkControl::Stop) {
-                return control;
-            } else if (control == WalkControl::Skip) {
-                control = WalkControl::Continue;
-                break;
-            }
-        }
-        --depth;
-        return control;
-    }
-    
-    bool parseSetDelimiterTag(const StringType& contents, DelimiterSet& delimiterSet) {
-        // Smallest legal tag is "=X X="
-        if (contents.size() < 5) {
-            return false;
-        }
-        if (contents.back() != '=') {
-            return false;
-        }
-        const auto contentsSubstr = trim(contents.substr(1, contents.size() - 2));
-        const auto spacepos = contentsSubstr.find(' ');
-        if (spacepos == StringType::npos) {
-            return false;
-        }
-        const auto nonspace = contentsSubstr.find_first_not_of(' ', spacepos + 1);
-        if (nonspace == StringType::npos) {
-            return false;
-        }
-        delimiterSet.begin = contentsSubstr.substr(0, spacepos);
-        delimiterSet.end = contentsSubstr.substr(nonspace, contentsSubstr.size() - nonspace);
-        return true;
-    }
-    
-    void parseTagContents(bool isUnescapedVar, const StringType& contents, Tag& tag) {
-        if (isUnescapedVar) {
-            tag.type = Tag::Type::UnescapedVariable;
-            tag.name = contents;
-        } else if (contents.empty()) {
-            tag.type = Tag::Type::Variable;
-            tag.name.clear();
-        } else {
-            switch (static_cast<char>(contents.at(0))) {
-                case '#':
-                    tag.type = Tag::Type::SectionBegin;
-                    break;
-                case '^':
-                    tag.type = Tag::Type::SectionBeginInverted;
-                    break;
-                case '/':
-                    tag.type = Tag::Type::SectionEnd;
-                    break;
-                case '>':
-                    tag.type = Tag::Type::Partial;
-                    break;
-                case '&':
-                    tag.type = Tag::Type::UnescapedVariable;
-                    break;
-                case '!':
-                    tag.type = Tag::Type::Comment;
-                    break;
-                default:
-                    tag.type = Tag::Type::Variable;
-                    break;
-            }
-            if (tag.type == Tag::Type::Variable) {
-                tag.name = contents;
-            } else {
-                StringType name{contents};
-                name.erase(name.begin());
-                tag.name = trim(name);
-            }
-        }
-    }
-    
-    void render(const RenderHandler& handler, Context& ctx) {
-        walk([&handler, &ctx, this](Component& comp, int) -> WalkControl {
-            return renderComponent(handler, ctx, comp);
-        });
-    }
-    
-    StringType render(Context& ctx) {
-        std::basic_ostringstream<typename StringType::value_type> ss;
-		render([&ss](const StringType& str) {
-			ss << str;
-		}, ctx);
-		return ss.str();
-    }
-    
-    WalkControl renderComponent(const RenderHandler& handler, Context& ctx, Component& comp) {
-        if (comp.isText()) {
-            handler(comp.text);
-            return WalkControl::Continue;
-        }
-        
-        const Tag& tag{comp.tag};
-        const Data<StringType>* var = nullptr;
-        switch (tag.type) {
-            case Tag::Type::Variable:
-            case Tag::Type::UnescapedVariable:
-                if ((var = ctx.get(tag.name)) != nullptr) {
-                    if (!renderVariable(handler, var, ctx, tag.type == Tag::Type::Variable)) {
-                        return WalkControl::Stop;
-                    }
-                }
-                break;
-            case Tag::Type::SectionBegin:
-                if ((var = ctx.get(tag.name)) != nullptr) {
-                    if (var->isLambda()) {
-                        if (!renderLambda(handler, var, ctx, false, *comp.tag.sectionText, true)) {
-                            return WalkControl::Stop;
-                        }
-                    } else if (!var->isFalse() && !var->isEmptyList()) {
-                        renderSection(handler, ctx, comp, var);
-                    }
-                }
-                return WalkControl::Skip;
-            case Tag::Type::SectionBeginInverted:
-                if ((var = ctx.get(tag.name)) == nullptr || var->isFalse() || var->isEmptyList()) {
-                    renderSection(handler, ctx, comp, var);
-                }
-                return WalkControl::Skip;
-            case Tag::Type::Partial:
-                if ((var = ctx.get(tag.name)) != nullptr && var->isPartial()) {
-                    const auto partial = var->partial();
-                    Mustache tmpl{partial()};
-                    if (!tmpl.isValid()) {
-                        errorMessage_ = tmpl.errorMessage();
-                    } else {
-                        tmpl.render(handler, ctx);
-                        if (!tmpl.isValid()) {
-                            errorMessage_ = tmpl.errorMessage();
-                        }
-                    }
-                    if (!tmpl.isValid()) {
-                        return WalkControl::Stop;
-                    }
-                }
-                break;
-            case Tag::Type::SetDelimiter:
-                ctx.delimiterSet = *comp.tag.delimiterSet;
-                break;
-            default:
-                break;
-        }
-        
-        return WalkControl::Continue;
-    }
-    
-    bool renderLambda(const RenderHandler& handler, const Data<StringType>* var, Context& ctx, bool escaped, const StringType& text, bool parseWithSameContext) {
-        const auto lambdaResult = var->callLambda(text);
-        if (!lambdaResult.isString()) {
-            return true;
-        }
-        Mustache tmpl = parseWithSameContext ? Mustache{lambdaResult.stringValue(), ctx} : Mustache{lambdaResult.stringValue()};
-        if (!tmpl.isValid()) {
-            errorMessage_ = tmpl.errorMessage();
-        } else {
-            const StringType str{tmpl.render(ctx)};
-            if (!tmpl.isValid()) {
-                errorMessage_ = tmpl.errorMessage();
-            } else {
-                handler(escaped ? escape(str) : str);
-            }
-        }
-        return tmpl.isValid();
-    }
-    
-    bool renderVariable(const RenderHandler& handler, const Data<StringType>* var, Context& ctx, bool escaped) {
-        if (var->isString()) {
-            const auto varstr = var->stringValue();
-			handler(escaped ? escape(varstr) : varstr);
-        } else if (var->isLambda()) {
-            return renderLambda(handler, var, ctx, escaped, {}, false);
-        }
-        return true;
-    }
-
-    void renderSection(const RenderHandler& handler, Context& ctx, Component& incomp, const Data<StringType>* var) {
-        const auto callback = [&handler, &ctx, this](Component& comp, int) -> WalkControl {
-            return renderComponent(handler, ctx, comp);
-        };
-        if (var && var->isNonEmptyList()) {
-            for (const auto& item : var->list()) {
-                const ContextPusher ctxpusher{ctx, &item};
-                walkChildren(callback, incomp);
-            }
-        } else if (var && var->isObject()) {
-            const ContextPusher ctxpusher{ctx, var};
-            walkChildren(callback, incomp);
-        } else {
-            walkChildren(callback, incomp);
-        }
-    }
-
-private:
-    StringType errorMessage_;
-    Component rootComponent_;
-};
-
-} // namespace
-
-#endif // MUSTACHE_HPP

+ 0 - 1
Source/ThirdParty/Mustache/urho3d_notes.md

@@ -1 +0,0 @@
-<https://github.com/kainjow/Mustache>

+ 0 - 48
Source/Urho3D/CMakeLists.txt

@@ -35,19 +35,6 @@ elseif (MINGW)
     endif ()
 endif ()
 
-# Generate JSON compilation database format specification
-if (URHO3D_CLANG_TOOLS OR URHO3D_BINDINGS)
-    set (CMAKE_EXPORT_COMPILE_COMMANDS 1)
-    # Clang assumes all their tools to be installed in a relative path to their libs but this is not the case for our own Clang-tools
-    # Clang has a hard-coded way to search for their headers (see http://clang.llvm.org/docs/LibTooling.html#builtin-includes)
-    # In order for our Clang-tools to work correctly we need to make this Clang's assumption to be true
-    execute_process (COMMAND ${LLVM_CONFIG} --version OUTPUT_VARIABLE LLVM_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
-    string (REGEX REPLACE "([.0123456789]+).*" \\1 LLVM_VERSION "${LLVM_VERSION}")      # Stringify against empty output variable
-    execute_process (COMMAND ${LLVM_CONFIG} --libdir OUTPUT_VARIABLE LLVM_LIBDIR OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
-    execute_process (COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin/tool/lib/clang/${LLVM_VERSION})
-    create_symlink (${LLVM_LIBDIR}/clang/${LLVM_VERSION}/include ${CMAKE_BINARY_DIR}/bin/tool/lib/clang/${LLVM_VERSION}/include FALLBACK_TO_COPY)
-endif ()
-
 # Save keep the preprocessor macros (for using the Urho3D library) for later use in generating Urho3D.pc file
 get_directory_property (URHO3D_COMPILE_DEFINITIONS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMPILE_DEFINITIONS)
 
@@ -237,37 +224,6 @@ add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/librevision.h
     COMMENT "")     # Suppress the comment as the header file may or may not be re-generated
 source_group ("Source Files\\Generated" FILES ${CMAKE_CURRENT_BINARY_DIR}/librevision.h)
 
-# Use the AutoBinder tool to generate source files for binding script subsystems
-if (URHO3D_BINDINGS)
-    # Build the Clang-tools as external project (even when we are not cross-compiling because it needs C++11 standard on) for auto-binding generation
-    include (ExternalProject)
-    if (IOS OR TVOS)
-        # When cross-compiling for iOS/tvOS the host environment has been altered by xcodebuild for the said platform, the following fix is required to reset the host environment before spawning another process to configure/generate project file for external project
-        set (ALTERNATE_COMMAND CMAKE_COMMAND /usr/bin/env -i PATH=$ENV{PATH} CC=${SAVED_CC} CXX=${SAVED_CXX} CI=$ENV{CI} ${CMAKE_COMMAND})
-    else ()
-        set (ALTERNATE_COMMAND CMAKE_COMMAND ${CMAKE_COMMAND} -E env CC=${SAVED_CC} CXX=${SAVED_CXX} CI=$ENV{CI} ${CMAKE_COMMAND})
-    endif ()
-    ExternalProject_Add (AutoBinder
-        SOURCE_DIR ${CMAKE_SOURCE_DIR}/Source/Clang-Tools
-        CMAKE_ARGS -D URHO3D_CLANG_TOOLS=AutoBinder -D URHO3D_DEPLOYMENT_TARGET=generic -D DEST_RUNTIME_DIR=${CMAKE_BINARY_DIR}/bin/tool/clang -D DEST_INCLUDE_DIR=${DEST_INCLUDE_DIR} -D BAKED_CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR} -D CMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
-        ${ALTERNATE_COMMAND})
-    add_make_clean_files (${CMAKE_BINARY_DIR}/bin/tool/clang/AutoBinder)
-    file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generated/generated)
-    foreach (SCRIPT AngelScript LuaScript JavaScript)
-        string (TOUPPER URHO3D_${SCRIPT} OPT)
-        if (${OPT})
-            list (APPEND SCRIPT_SUBSYSTEMS -s ${SCRIPT})
-            list (APPEND GEN_CPP_FILES ${CMAKE_CURRENT_BINARY_DIR}/generated/${SCRIPT}API.cpp)
-        endif ()
-    endforeach ()
-    string (REGEX REPLACE "[^;]+API\\.cpp" "" ANNOTATED_SOURCES "${CPP_FILES}")    # Stringify to preserve the semicolons
-    add_custom_command (OUTPUT ${GEN_CPP_FILES}
-        COMMAND ${CMAKE_BINARY_DIR}/bin/tool/clang/AutoBinder -p ${CMAKE_BINARY_DIR} -t ${CMAKE_BINARY_DIR}/bin/tool/clang/Templates -o ${CMAKE_CURRENT_BINARY_DIR}/generated ${SCRIPT_SUBSYSTEMS} ${ANNOTATED_SOURCES}
-        COMMAND ${CMAKE_COMMAND} -E touch ${GEN_CPP_FILES}   # TODO: fake the output - WIP
-        DEPENDS AutoBinder ${H_FILES}
-        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-        COMMENT "Generating source files for binding script subsystems")
-endif ()
 if (URHO3D_LUA)
     # The host tool must be built natively
     if (CMAKE_CROSSCOMPILING OR URHO3D_LUAJIT)
@@ -365,10 +321,6 @@ endif()
 if (MSVC)
     set (APPENDIX "\n#pragma warning(disable: 4251)\n#pragma warning(disable: 4275)\n\n#if _MSC_VER < 1900\n#define strtoll _strtoi64\n#define strtoull _strtoui64\n#endif\n")
 endif ()
-if (URHO3D_CLANG_TOOLS)
-    set (ANNOTATE_NONSCRIPTABLE "__attribute__((annotate(\"nonscriptable\")))")
-endif ()
-set (APPENDIX "${APPENDIX}\n#define NONSCRIPTABLE ${ANNOTATE_NONSCRIPTABLE}\n\n")
 foreach (DEFINE URHO3D_STATIC_DEFINE URHO3D_OPENGL URHO3D_D3D11 URHO3D_SSE URHO3D_DATABASE_ODBC URHO3D_DATABASE_SQLITE URHO3D_LUAJIT URHO3D_TESTING CLANG_PRE_STANDARD)
     if (${DEFINE})
         set (APPENDIX "${APPENDIX}#define ${DEFINE}\n")

+ 0 - 35
cmake/Modules/UrhoCommon.cmake

@@ -201,10 +201,7 @@ if (CMAKE_PROJECT_NAME STREQUAL Urho3D)
     option (URHO3D_PLAYER "Build Urho3D script player" TRUE)
     option (URHO3D_SAMPLES "Build sample applications" TRUE)
     option (URHO3D_UPDATE_SOURCE_TREE "Enable commands to copy back some of the generated build artifacts from build tree to source tree to facilitate devs to push them as part of a commit (for library devs with push right only)")
-    option (URHO3D_BINDINGS "Enable API binding generation support for script subsystems")
     option (URHO3D_GENERATEBINDINGS "Regenerate bindings for scripting languages")
-    cmake_dependent_option (URHO3D_CLANG_TOOLS "Build Clang tools (native on host system only)" FALSE "NOT CMAKE_CROSSCOMPILING" FALSE)
-    mark_as_advanced (URHO3D_UPDATE_SOURCE_TREE URHO3D_BINDINGS URHO3D_CLANG_TOOLS)
     cmake_dependent_option (URHO3D_TOOLS "Build tools (native, RPI, and ARM on Linux only)" TRUE "NOT IOS AND NOT TVOS AND NOT ANDROID AND NOT WEB" FALSE)
     cmake_dependent_option (URHO3D_EXTRAS "Build extras (native, RPI, and ARM on Linux only)" FALSE "NOT IOS AND NOT TVOS AND NOT ANDROID AND NOT WEB" FALSE)
     option (URHO3D_DOCS "Generate documentation as part of normal build")
@@ -383,38 +380,6 @@ endif ()
 # Union all the sysroot variables into one so it can be referred to generically later
 set (SYSROOT ${CMAKE_SYSROOT} ${MINGW_SYSROOT} ${IOS_SYSROOT} ${TVOS_SYSROOT} CACHE INTERNAL "Path to system root of the cross-compiling target")  # SYSROOT is empty for native build
 
-# Clang tools building
-if (URHO3D_CLANG_TOOLS OR URHO3D_BINDINGS)
-    # Ensure LLVM/Clang is installed
-    find_program (LLVM_CONFIG NAMES llvm-config llvm-config-64 llvm-config-32 HINTS $ENV{LLVM_CLANG_ROOT}/bin DOC "LLVM config tool" NO_CMAKE_FIND_ROOT_PATH)
-    if (NOT LLVM_CONFIG)
-        message (FATAL_ERROR "Could not find LLVM/Clang installation")
-    endif ()
-endif ()
-if (URHO3D_CLANG_TOOLS)
-    set (URHO3D_PCH 0)
-    set (URHO3D_LIB_TYPE SHARED)
-    # Set build options that would maximise the AST of Urho3D library
-    foreach (OPT
-            URHO3D_ANGELSCRIPT
-            URHO3D_DATABASE_SQLITE
-            URHO3D_FILEWATCHER
-            URHO3D_IK
-            URHO3D_LOGGING
-            URHO3D_LUA
-            URHO3D_NAVIGATION
-            URHO3D_NETWORK
-            URHO3D_PHYSICS
-            URHO3D_PHYSICS2D
-            URHO3D_PROFILING
-            URHO3D_URHO2D)
-        set (${OPT} 1)
-    endforeach ()
-    foreach (OPT URHO3D_TESTING URHO3D_LUAJIT URHO3D_DATABASE_ODBC URHO3D_TRACY_PROFILING)
-        set (${OPT} 0)
-    endforeach ()
-endif ()
-
 #if (URHO3D_GENERATEBINDINGS)
     # Ensure the script subsystems are enabled at the very least
 #    set (URHO3D_ANGELSCRIPT 1)

+ 0 - 25
licenses/mustache/LICENSE

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