From d28734f4df55d6fcdb30c929a4a87b19791a1992 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Mon, 17 Aug 2015 12:15:23 -1000 Subject: [PATCH] DataSpecRegistry now generated by CMake --- hecl/.gitignore | 2 ++ hecl/CMakeLists.txt | 2 ++ ...{DataSpecRegistry.hpp => DataSpecRegistry.hpp.in} | 12 ++---------- 3 files changed, 6 insertions(+), 10 deletions(-) create mode 100644 hecl/.gitignore rename hecl/{DataSpecRegistry.hpp => DataSpecRegistry.hpp.in} (54%) diff --git a/hecl/.gitignore b/hecl/.gitignore new file mode 100644 index 000000000..3de5fc0e2 --- /dev/null +++ b/hecl/.gitignore @@ -0,0 +1,2 @@ +DataSpecRegistry.hpp + diff --git a/hecl/CMakeLists.txt b/hecl/CMakeLists.txt index 774a5c49b..d8b122712 100644 --- a/hecl/CMakeLists.txt +++ b/hecl/CMakeLists.txt @@ -9,6 +9,8 @@ else() endif() endif() +configure_file(DataSpecRegistry.hpp.in ${CMAKE_CURRENT_SOURCE_DIR}/DataSpecRegistry.hpp @ONLY) + list(APPEND HECL_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/blender) set(HECL_INCLUDE_DIR ${HECL_INCLUDE_DIR} PARENT_SCOPE) set(ATHENA_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extern/Athena/include) diff --git a/hecl/DataSpecRegistry.hpp b/hecl/DataSpecRegistry.hpp.in similarity index 54% rename from hecl/DataSpecRegistry.hpp rename to hecl/DataSpecRegistry.hpp.in index aad5fb26b..73044d07d 100644 --- a/hecl/DataSpecRegistry.hpp +++ b/hecl/DataSpecRegistry.hpp.in @@ -17,18 +17,10 @@ std::vector DATA_SPEC_REGISTRY; } } -/* RetroCommon specs */ -namespace Retro -{ - extern HECL::Database::DataSpecEntry SpecEntMP1; - extern HECL::Database::DataSpecEntry SpecEntMP2; - extern HECL::Database::DataSpecEntry SpecEntMP3; -} +@HECL_DATASPEC_DECLS@ /* Please Call Me! */ void HECLRegisterDataSpecs() { - HECL::Database::DATA_SPEC_REGISTRY.push_back(&Retro::SpecEntMP1); - HECL::Database::DATA_SPEC_REGISTRY.push_back(&Retro::SpecEntMP2); - HECL::Database::DATA_SPEC_REGISTRY.push_back(&Retro::SpecEntMP3); +@HECL_DATASPEC_PUSHES@ }