From dc3630b1714633fbb457699db3abc04c1fdf1b3c Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sat, 18 Jul 2020 12:42:54 +0200 Subject: [PATCH] Cleanup cmake file. --- .../AngelScript/AngelScriptResolver.cpp | 1 + CMakeLists.txt | 79 +++++++------------ CmakeConanSetup.cmake | 22 ++++++ .../scriptarray/scriptarray.h | 3 + .../scriptbuilder/scriptbuilder.h | 8 +- .../scripthandle/scripthandle.cpp | 2 +- .../scripthandle/scripthandle.h | 3 + .../scripthelper/scripthelper.h | 3 + .../scriptstdstring/scriptstdstring.h | 3 + src/Battling/Library/DamageLibrary.cpp | 7 +- src/Battling/PkmnScript.hpp | 4 + .../AngelScript/AngelScriptResolver.cpp | 7 +- .../AngelScript/AngelScriptResolver.hpp | 5 +- .../AngelScript/AngelScriptScript.hpp | 5 ++ .../AngelScript/AngelScriptTypeInfo.hpp | 3 + .../AngelScript/ContextPool.hpp | 3 + .../TypeRegistry/BasicScriptClass.hpp | 4 + .../Battling/RegisterBattleClass.hpp | 3 + .../Battling/RegisterBattleLibrary.hpp | 4 + .../Battling/RegisterExecutingAttack.hpp | 4 +- .../Battling/RegisterPokemonClass.hpp | 4 + .../Battling/RegisterTurnChoices.hpp | 4 + .../AngelScript/TypeRegistry/ConstString.hpp | 4 + .../AngelScript/TypeRegistry/HelperFile.hpp | 2 +- .../Library/RegisterEffectParameter.hpp | 4 + .../Library/RegisterGrowthRateTypes.hpp | 3 + .../Library/RegisterItemTypes.hpp | 3 + .../Library/RegisterMoveTypes.hpp | 3 + .../Library/RegisterSpeciesTypes.hpp | 3 + .../Library/RegisterStaticLibraryTypes.hpp | 4 + .../Library/RegisterTypeLibrary.hpp | 3 + 31 files changed, 141 insertions(+), 69 deletions(-) create mode 100644 CmakeConanSetup.cmake diff --git a/CInterface/AngelScript/AngelScriptResolver.cpp b/CInterface/AngelScript/AngelScriptResolver.cpp index bdfe304..383e9bd 100644 --- a/CInterface/AngelScript/AngelScriptResolver.cpp +++ b/CInterface/AngelScript/AngelScriptResolver.cpp @@ -1,3 +1,4 @@ + #include "../../src/ScriptResolving/AngelScript/AngelScriptResolver.hpp" #include "../Core.hpp" diff --git a/CMakeLists.txt b/CMakeLists.txt index f6b7cf0..b34a1ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,23 +1,21 @@ cmake_minimum_required(VERSION 3.13) - -# Make warnings trigger errors. -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror") - project(pkmnLib) +# Enable all warnings, and make them error when occurring. +add_compile_options(-Wall -Wextra -Werror) +# We like new stuff, so set the c++ standard to c++20. set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -if (NOT SCRIPT_PROVIDER) - message(WARNING "Script provider was not set, using angelscript as default.") - set(SCRIPT_PROVIDER "angelscript") - ADD_DEFINITIONS(-D ANGELSCRIPT=1) -endif() +option(WINDOWS "Whether the build target is Windows or not." OFF) +option(SHARED "Whether we should build a shared library, instead of a static one." OFF) +option(TESTS "Whether the test executable should be build as well." OFF) +option(STATICC "Whether gcc and stdc++ should be linked statically to the library." OFF) +set(SCRIPT_PROVIDER "angelscript" CACHE STRING "Which script provider to use.") if (WINDOWS) SET(CMAKE_SYSTEM_NAME Windows) ADD_DEFINITIONS(-D WINDOWS=1) -endif(WINDOWS) +endif (WINDOWS) message(STATUS "Using: \t C ${CMAKE_C_COMPILER} @@ -25,37 +23,20 @@ message(STATUS "Using: \t CXX ABI ${CMAKE_CXX_COMPILER_ABI} \t C++ Version ${CMAKE_CXX_STANDARD}") - -if (NOT EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) - message(WARNING "The file conanbuildinfo.cmake doesn't exist, running conan install.") - string(REPLACE "." ";" VERSION_LIST "${CMAKE_C_COMPILER_VERSION}") - list(GET VERSION_LIST 0 VERSION) - list(GET VERSION_LIST 1 MINOR) - if (NOT MINOR MATCHES 0) - SET(VERSION ${VERSION}.${MINOR}) - endif () - set(CONAN_STATIC_C False) - if (STATICC) - set(CONAN_STATIC_C True) - endif (STATICC) - - if (NOT WINDOWS) - execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build outdated - -s compiler=clang -s compiler.libcxx=libstdc++11 -s compiler.version=${VERSION} -o *:staticC=${CONAN_STATIC_C} -o AngelScript:link_std_statically=True) - else () - execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build outdated - -s compiler=gcc -s compiler.libcxx=libstdc++11 -s compiler.version=${VERSION} -s os=Windows -o *:staticC=${CONAN_STATIC_C} -o AngelScript:link_std_statically=True) - endif () -endif () -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +include(CmakeConanSetup.cmake) +SetupConan() message(STATUS "Using Conan Libs:") foreach (_conanLib ${CONAN_LIBS}) message(STATUS "\t ${_conanLib}") -endforeach() +endforeach () + +# Set whether we want a static or shared library. +set(LIBTYPE STATIC) +if (SHARED) + set(LIBTYPE SHARED) +endif (SHARED) -# Create Core library with files in src/Core SET(FILE_SOURCE "src/Battling/*.cpp" "src/Battling/*.hpp" @@ -78,22 +59,19 @@ if (SCRIPT_PROVIDER STREQUAL "angelscript") ) ADD_DEFINITIONS(-D AS_USE_ACCESSORS=1) endif() -message(STATUS "${FILE_SOURCE}") + file(GLOB_RECURSE CORE_SRC_FILES ${FILE_SOURCE}) - -add_library(pkmnLib SHARED ${CORE_SRC_FILES}) - -foreach (_variableName ${CONAN_LIBS}) - message(STATUS "Lib: ${_variableName}") -endforeach() +add_library(pkmnLib ${LIBTYPE} ${CORE_SRC_FILES}) SET(_LINKS CreatureLibLibrary CreatureLibBattling Arbutils) SET(_TESTLINKS pkmnLib CreatureLibLibrary CreatureLibBattling Arbutils) if (SCRIPT_PROVIDER STREQUAL "angelscript") - SET(_LINKS angelscript ${_LINKS} ) - SET(_TESTLINKS angelscript ${_TESTLINKS} ) -endif() + message(STATUS "Using Angelscript as script provider.") + ADD_DEFINITIONS(-D ANGELSCRIPT=1) + SET(_LINKS angelscript ${_LINKS}) + SET(_TESTLINKS angelscript ${_TESTLINKS}) +endif () if (WINDOWS) message(STATUS "Using Windows build.") @@ -104,17 +82,14 @@ endif (WINDOWS) if (STATICC) message(STATUS "Linking C library statically") SET(_LINKS ${_LINKS} -static-libgcc -static-libstdc++) - if (NOT DEFINED CONAN_EXPORTED) - SET(_TESTLINKS ${_TESTLINKS} -static-libgcc -static-libstdc++) - endif() endif() target_link_libraries(pkmnLib PUBLIC ${_LINKS}) -if (NOT DEFINED CONAN_EXPORTED) +if (TESTS) # Create Test executable file(GLOB_RECURSE TEST_FILES "tests/*.cpp" "tests/*.hpp") - add_executable(pkmnLibTests ${TEST_FILES} extern/catch.hpp) + add_executable(pkmnLibTests ${TEST_FILES} extern/catch.hpp) message(STATUS "${_TESTLINKS}") target_link_libraries(pkmnLibTests PUBLIC ${_TESTLINKS}) diff --git a/CmakeConanSetup.cmake b/CmakeConanSetup.cmake new file mode 100644 index 0000000..b20a02b --- /dev/null +++ b/CmakeConanSetup.cmake @@ -0,0 +1,22 @@ +function(SetupConan) + # If conan isn't set up yet, we need to install the dependencies. + if (NOT EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) + message(WARNING "The file conanbuildinfo.cmake doesn't exist, running conan install.") + + # If we're linking C statically, we also want to do so for our dependencies. + set(CONAN_STATIC_C False) + if (STATICC) + set(CONAN_STATIC_C True) + endif (STATICC) + + if (NOT WINDOWS) + execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build outdated + -s compiler=clang -s compiler.libcxx=libstdc++11 -s compiler.version=${VERSION} -o *:staticC=${CONAN_STATIC_C} -o AngelScript:link_std_statically=True) + else () + execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build outdated + -s compiler=gcc -s compiler.libcxx=libstdc++11 -s compiler.version=${VERSION} -s os=Windows -o *:staticC=${CONAN_STATIC_C} -o AngelScript:link_std_statically=True) + endif () + endif () + include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) + conan_basic_setup() +endfunction() \ No newline at end of file diff --git a/extern/angelscript_addons/scriptarray/scriptarray.h b/extern/angelscript_addons/scriptarray/scriptarray.h index 41b34dd..bf6f35b 100644 --- a/extern/angelscript_addons/scriptarray/scriptarray.h +++ b/extern/angelscript_addons/scriptarray/scriptarray.h @@ -3,7 +3,10 @@ #ifndef ANGELSCRIPT_H // Avoid having to inform include path if header is already include before +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop #endif // Sometimes it may be desired to use the same method names as used by C++ STL. diff --git a/extern/angelscript_addons/scriptbuilder/scriptbuilder.h b/extern/angelscript_addons/scriptbuilder/scriptbuilder.h index 0862270..199cbea 100644 --- a/extern/angelscript_addons/scriptbuilder/scriptbuilder.h +++ b/extern/angelscript_addons/scriptbuilder/scriptbuilder.h @@ -14,21 +14,21 @@ // TODO: Implement flags for turning on/off include directives and conditional programming - - //--------------------------- // Declaration // #ifndef ANGELSCRIPT_H // Avoid having to inform include path if header is already include before +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop #endif - #if defined(_MSC_VER) && _MSC_VER <= 1200 // disable the annoying warnings on MSVC 6 -#pragma warning (disable:4786) +#pragma warning(disable : 4786) #endif #include diff --git a/extern/angelscript_addons/scripthandle/scripthandle.cpp b/extern/angelscript_addons/scripthandle/scripthandle.cpp index 6deee87..f4de29a 100644 --- a/extern/angelscript_addons/scripthandle/scripthandle.cpp +++ b/extern/angelscript_addons/scripthandle/scripthandle.cpp @@ -191,7 +191,7 @@ void CScriptHandle::EnumReferences(asIScriptEngine* inEngine) { inEngine->GCEnumCallback(m_type); } -void CScriptHandle::ReleaseReferences(asIScriptEngine* inEngine) { +void CScriptHandle::ReleaseReferences(asIScriptEngine*) { // Simply clear the content to release the references Set(0, 0); } diff --git a/extern/angelscript_addons/scripthandle/scripthandle.h b/extern/angelscript_addons/scripthandle/scripthandle.h index 7adf1b7..c9cbbcd 100644 --- a/extern/angelscript_addons/scripthandle/scripthandle.h +++ b/extern/angelscript_addons/scripthandle/scripthandle.h @@ -3,7 +3,10 @@ #ifndef ANGELSCRIPT_H // Avoid having to inform include path if header is already include before +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop #endif diff --git a/extern/angelscript_addons/scripthelper/scripthelper.h b/extern/angelscript_addons/scripthelper/scripthelper.h index dc3e0b8..06aa3e9 100644 --- a/extern/angelscript_addons/scripthelper/scripthelper.h +++ b/extern/angelscript_addons/scripthelper/scripthelper.h @@ -6,7 +6,10 @@ #ifndef ANGELSCRIPT_H // Avoid having to inform include path if header is already include before +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop #endif diff --git a/extern/angelscript_addons/scriptstdstring/scriptstdstring.h b/extern/angelscript_addons/scriptstdstring/scriptstdstring.h index 0960beb..461c280 100644 --- a/extern/angelscript_addons/scriptstdstring/scriptstdstring.h +++ b/extern/angelscript_addons/scriptstdstring/scriptstdstring.h @@ -13,7 +13,10 @@ #ifndef ANGELSCRIPT_H // Avoid having to inform include path if header is already include before +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop #endif #include diff --git a/src/Battling/Library/DamageLibrary.cpp b/src/Battling/Library/DamageLibrary.cpp index fb14503..f6ebf9f 100644 --- a/src/Battling/Library/DamageLibrary.cpp +++ b/src/Battling/Library/DamageLibrary.cpp @@ -18,14 +18,15 @@ uint32_t PkmnLib::Battling::DamageLibrary::GetDamage(CreatureLib::Battling::Exec return damage; } uint8_t PkmnLib::Battling::DamageLibrary::GetBasePower(CreatureLib::Battling::ExecutingAttack* attack, - CreatureLib::Battling::Creature* target, uint8_t hitIndex, - const HitData& hitData) const { + [[maybe_unused]] CreatureLib::Battling::Creature* target, + [[maybe_unused]] uint8_t hitIndex, + [[maybe_unused]] const HitData& hitData) const { auto bp = attack->GetAttack()->GetAttack()->GetBasePower(); // HOOK: modify base power. return bp; } float PkmnLib::Battling::DamageLibrary::GetStatModifier(CreatureLib::Battling::ExecutingAttack* attack, - CreatureLib::Battling::Creature* target, uint8_t hitIndex, + CreatureLib::Battling::Creature* target, uint8_t, const HitData& hitData) const { auto user = attack->GetUser(); // HOOK: allow overriding for which users stat we use. diff --git a/src/Battling/PkmnScript.hpp b/src/Battling/PkmnScript.hpp index b81ae94..5d3988a 100644 --- a/src/Battling/PkmnScript.hpp +++ b/src/Battling/PkmnScript.hpp @@ -2,6 +2,9 @@ #define PKMNLIB_PKMNSCRIPT_HPP #include +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" + namespace PkmnLib::Battling { class PkmnScript : public CreatureLib::Battling::Script { public: @@ -19,5 +22,6 @@ namespace PkmnLib::Battling { CreatureLib::Battling::Creature* winningMon, bool* shareExperience){}; }; } +#pragma clang diagnostic pop #endif // PKMNLIB_PKMNSCRIPT_HPP diff --git a/src/ScriptResolving/AngelScript/AngelScriptResolver.cpp b/src/ScriptResolving/AngelScript/AngelScriptResolver.cpp index 681d1b9..156120f 100644 --- a/src/ScriptResolving/AngelScript/AngelScriptResolver.cpp +++ b/src/ScriptResolving/AngelScript/AngelScriptResolver.cpp @@ -115,7 +115,7 @@ void AngelScriptResolver::RegisterTypes() { BasicScriptClass::Register(_engine); } -void AngelScriptResolver::MessageCallback(const asSMessageInfo* msg, void* param) { +void AngelScriptResolver::MessageCallback(const asSMessageInfo* msg, void*) { const char* type = "ERR "; if (msg->type == asMSGTYPE_WARNING) type = "WARN"; @@ -265,7 +265,7 @@ void AngelScriptResolver::LoadByteCodeFromFile(const char* file) { // Begin loading the type database auto types = stream->ReadTypes(); - InitializeByteCode(stream, types); + InitializeByteCode(types); Assert(fclose(rFile) == 0); delete stream; } @@ -297,11 +297,10 @@ void AngelScriptResolver::LoadByteCodeFromMemory(uint8_t* byte, size_t size) { // Begin loading the type database auto types = stream->ReadTypes(); - InitializeByteCode(stream, types); + InitializeByteCode(types); delete stream; } void AngelScriptResolver::InitializeByteCode( - asIBinaryStream* stream, const ArbUt::Dictionary>& types) { auto typeCount = _mainModule->GetObjectTypeCount(); diff --git a/src/ScriptResolving/AngelScript/AngelScriptResolver.hpp b/src/ScriptResolving/AngelScript/AngelScriptResolver.hpp index 621f03c..20597e3 100644 --- a/src/ScriptResolving/AngelScript/AngelScriptResolver.hpp +++ b/src/ScriptResolving/AngelScript/AngelScriptResolver.hpp @@ -25,8 +25,7 @@ private: void RegisterTypes(); void - InitializeByteCode(asIBinaryStream* stream, - const ArbUt::Dictionary>& types); + InitializeByteCode(const ArbUt::Dictionary>& types); public: ~AngelScriptResolver() override { @@ -64,7 +63,7 @@ public: int r = _engine->RegisterObjectMethod(type, decl, asFunctionPtr(func), asCALL_CDECL_OBJFIRST); Assert(r >= 0); } - void RegisterGlobalMethod(const char* decl, void*(func)(void*)) { + void RegisterGlobalMethod(const char*, void*(func)(void*)) { auto r = _engine->RegisterGlobalFunction("decl", asFunctionPtr(func), asCALL_CDECL); Assert(r >= 0); } diff --git a/src/ScriptResolving/AngelScript/AngelScriptScript.hpp b/src/ScriptResolving/AngelScript/AngelScriptScript.hpp index 9c806d7..8aba3a3 100644 --- a/src/ScriptResolving/AngelScript/AngelScriptScript.hpp +++ b/src/ScriptResolving/AngelScript/AngelScriptScript.hpp @@ -3,7 +3,12 @@ #include #define ANGELSCRIPT_DLL_LIBRARY_IMPORT #include + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop + #include #include "../../../extern/angelscript_addons/scriptarray/scriptarray.h" #include "../../Battling/PkmnScript.hpp" diff --git a/src/ScriptResolving/AngelScript/AngelScriptTypeInfo.hpp b/src/ScriptResolving/AngelScript/AngelScriptTypeInfo.hpp index b2d6940..51806c3 100644 --- a/src/ScriptResolving/AngelScript/AngelScriptTypeInfo.hpp +++ b/src/ScriptResolving/AngelScript/AngelScriptTypeInfo.hpp @@ -5,7 +5,10 @@ #include #include #include +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop #include #include #include diff --git a/src/ScriptResolving/AngelScript/ContextPool.hpp b/src/ScriptResolving/AngelScript/ContextPool.hpp index 3653aee..68afb51 100644 --- a/src/ScriptResolving/AngelScript/ContextPool.hpp +++ b/src/ScriptResolving/AngelScript/ContextPool.hpp @@ -1,7 +1,10 @@ #ifndef PKMNLIB_CONTEXTPOOL_HPP #define PKMNLIB_CONTEXTPOOL_HPP +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop #include class ContextPool { diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/BasicScriptClass.hpp b/src/ScriptResolving/AngelScript/TypeRegistry/BasicScriptClass.hpp index 4033748..014b80a 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/BasicScriptClass.hpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/BasicScriptClass.hpp @@ -1,7 +1,11 @@ #ifndef PKMNLIB_BASICSCRIPTCLASS_HPP #define PKMNLIB_BASICSCRIPTCLASS_HPP +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop + class BasicScriptClass { public: static void Register(asIScriptEngine* engine); diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterBattleClass.hpp b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterBattleClass.hpp index bfa991e..331718d 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterBattleClass.hpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterBattleClass.hpp @@ -1,7 +1,10 @@ #ifndef PKMNLIB_REGISTERBATTLECLASS_HPP #define PKMNLIB_REGISTERBATTLECLASS_HPP +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop class RegisterBattleClass { static void RegisterChoiceQueue(asIScriptEngine* engine); static void RegisterBattle(asIScriptEngine* engine); diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterBattleLibrary.hpp b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterBattleLibrary.hpp index a8c0759..da8f0fe 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterBattleLibrary.hpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterBattleLibrary.hpp @@ -1,7 +1,11 @@ #ifndef PKMNLIB_REGISTERBATTLELIBRARY_HPP #define PKMNLIB_REGISTERBATTLELIBRARY_HPP +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop + class RegisterBattleLibrary { static void RegisterDamageLibrary(asIScriptEngine* engine); static void RegisterLibrary(asIScriptEngine* engine); diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterExecutingAttack.hpp b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterExecutingAttack.hpp index 3099730..d640884 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterExecutingAttack.hpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterExecutingAttack.hpp @@ -1,7 +1,9 @@ #ifndef PKMNLIB_REGISTEREXECUTINGATTACK_HPP #define PKMNLIB_REGISTEREXECUTINGATTACK_HPP - +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop class RegisterExecutingAttack { static void RegisterHitData(asIScriptEngine* engine); diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterPokemonClass.hpp b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterPokemonClass.hpp index c6b1607..1daed66 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterPokemonClass.hpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterPokemonClass.hpp @@ -1,7 +1,11 @@ #ifndef PKMNLIB_REGISTERPOKEMONCLASS_HPP #define PKMNLIB_REGISTERPOKEMONCLASS_HPP +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop + class RegisterPokemonClass { static void RegisterDamageSource(asIScriptEngine* engine); static void RegisterMoveLearnMethod(asIScriptEngine* engine); diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterTurnChoices.hpp b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterTurnChoices.hpp index 1fa69f0..d6db193 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterTurnChoices.hpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterTurnChoices.hpp @@ -1,7 +1,11 @@ #ifndef PKMNLIB_REGISTERTURNCHOICES_HPP #define PKMNLIB_REGISTERTURNCHOICES_HPP +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop + class RegisterTurnChoices { static void RegisterTurnChoiceKindEnum(asIScriptEngine* engine); static void RegisterBaseTurnChoice(asIScriptEngine* engine); diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/ConstString.hpp b/src/ScriptResolving/AngelScript/TypeRegistry/ConstString.hpp index 6b59fd7..915a503 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/ConstString.hpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/ConstString.hpp @@ -1,7 +1,11 @@ #ifndef PKMNLIB_CONSTSTRING_HPP #define PKMNLIB_CONSTSTRING_HPP #include +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop + class ConstStringRegister { public: static void Register(asIScriptEngine* engine); diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/HelperFile.hpp b/src/ScriptResolving/AngelScript/TypeRegistry/HelperFile.hpp index 83d0ac7..463f086 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/HelperFile.hpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/HelperFile.hpp @@ -1,4 +1,4 @@ #define BORROWED_PTR_GETTER_FUNC(o, returns, funcName) \ static returns* funcName##Wrapper(o* obj) { return obj->funcName().GetRaw(); } #define UNIQUE_PTR_GETTER_FUNC(o, returns, funcName) \ - static returns* funcName##Wrapper(o* obj) { return obj->funcName().get(); } + static returns* funcName##Wrapper(o* obj) { return obj->funcName().get(); } \ No newline at end of file diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterEffectParameter.hpp b/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterEffectParameter.hpp index 2d6bd50..516252f 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterEffectParameter.hpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterEffectParameter.hpp @@ -1,7 +1,11 @@ #ifndef PKMNLIB_REGISTEREFFECTPARAMETER_HPP #define PKMNLIB_REGISTEREFFECTPARAMETER_HPP +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop + class RegisterEffectParameter { public: static void Register(asIScriptEngine* engine); diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterGrowthRateTypes.hpp b/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterGrowthRateTypes.hpp index 097233f..5ae1ae8 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterGrowthRateTypes.hpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterGrowthRateTypes.hpp @@ -1,6 +1,9 @@ #ifndef PKMNLIB_REGISTERGROWTHRATETYPES_HPP #define PKMNLIB_REGISTERGROWTHRATETYPES_HPP +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop class RegisterGrowthRateTypes { static void RegisterGrowthRateType(asIScriptEngine* engine); diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterItemTypes.hpp b/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterItemTypes.hpp index d98aa6b..db6c935 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterItemTypes.hpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterItemTypes.hpp @@ -1,6 +1,9 @@ #ifndef PKMNLIB_REGISTERITEMTYPES_HPP #define PKMNLIB_REGISTERITEMTYPES_HPP +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop class RegisterItemTypes { static void RegisterItemCategoryEnum(asIScriptEngine* engine); diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterMoveTypes.hpp b/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterMoveTypes.hpp index 2e11fff..b133365 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterMoveTypes.hpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterMoveTypes.hpp @@ -1,6 +1,9 @@ #ifndef PKMNLIB_REGISTERMOVETYPES_HPP #define PKMNLIB_REGISTERMOVETYPES_HPP +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop class RegisterMoveTypes { static void RegisterMoveCategory(asIScriptEngine* engine); diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterSpeciesTypes.hpp b/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterSpeciesTypes.hpp index 834b0ac..1a36435 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterSpeciesTypes.hpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterSpeciesTypes.hpp @@ -1,6 +1,9 @@ #ifndef PKMNLIB_REGISTERSPECIESTYPES_HPP #define PKMNLIB_REGISTERSPECIESTYPES_HPP +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop class RegisterSpeciesTypes { public: diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterStaticLibraryTypes.hpp b/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterStaticLibraryTypes.hpp index 52431f2..a9822f9 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterStaticLibraryTypes.hpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterStaticLibraryTypes.hpp @@ -1,7 +1,11 @@ #ifndef PKMNLIB_REGISTERSTATICLIBRARYTYPES_HPP #define PKMNLIB_REGISTERSTATICLIBRARYTYPES_HPP +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop + class RegisterStaticLibraryTypes { static void RegisterLibrarySettingsType(asIScriptEngine* engine); static void RegisterLibraryType(asIScriptEngine* engine); diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterTypeLibrary.hpp b/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterTypeLibrary.hpp index 7cd88bd..36ec8b4 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterTypeLibrary.hpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/Library/RegisterTypeLibrary.hpp @@ -1,6 +1,9 @@ #ifndef PKMNLIB_REGISTERTYPELIBRARY_HPP #define PKMNLIB_REGISTERTYPELIBRARY_HPP +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" #include +#pragma clang diagnostic pop class RegisterTypeLibrary { static void RegisterTypeLibraryType(asIScriptEngine* engine);