From 8f14aaa13fbde44cbee840ecc777f5323e0dab04 Mon Sep 17 00:00:00 2001 From: pf Date: Sun, 19 Jul 2020 18:10:08 +0100 Subject: [PATCH] [JSON] as per Nlohmann's suggestion, moved the macro builder code to third_party directory --- tools/NlohmannMacroBuilder/.dep.inc | 5 - tools/NlohmannMacroBuilder/Makefile | 128 ----------------- tools/NlohmannMacroBuilder/main.cpp | 85 ----------- .../nbproject/Makefile-Release.mk | 83 ----------- .../nbproject/Makefile-impl.mk | 133 ------------------ .../nbproject/Makefile-variables.mk | 27 ---- .../nbproject/Package-Release.bash | 76 ---------- .../nbproject/configurations.xml | 47 ------- .../nbproject/project.xml | 24 ---- 9 files changed, 608 deletions(-) delete mode 100644 tools/NlohmannMacroBuilder/.dep.inc delete mode 100644 tools/NlohmannMacroBuilder/Makefile delete mode 100644 tools/NlohmannMacroBuilder/main.cpp delete mode 100644 tools/NlohmannMacroBuilder/nbproject/Makefile-Release.mk delete mode 100644 tools/NlohmannMacroBuilder/nbproject/Makefile-impl.mk delete mode 100644 tools/NlohmannMacroBuilder/nbproject/Makefile-variables.mk delete mode 100644 tools/NlohmannMacroBuilder/nbproject/Package-Release.bash delete mode 100644 tools/NlohmannMacroBuilder/nbproject/configurations.xml delete mode 100644 tools/NlohmannMacroBuilder/nbproject/project.xml diff --git a/tools/NlohmannMacroBuilder/.dep.inc b/tools/NlohmannMacroBuilder/.dep.inc deleted file mode 100644 index 38ba445ca..000000000 --- a/tools/NlohmannMacroBuilder/.dep.inc +++ /dev/null @@ -1,5 +0,0 @@ -# This code depends on make tool being used -DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES} ${TESTOBJECTFILES})) -ifneq (${DEPFILES},) -include ${DEPFILES} -endif diff --git a/tools/NlohmannMacroBuilder/Makefile b/tools/NlohmannMacroBuilder/Makefile deleted file mode 100644 index 05de621e8..000000000 --- a/tools/NlohmannMacroBuilder/Makefile +++ /dev/null @@ -1,128 +0,0 @@ -# -# There exist several targets which are by default empty and which can be -# used for execution of your targets. These targets are usually executed -# before and after some main targets. They are: -# -# .build-pre: called before 'build' target -# .build-post: called after 'build' target -# .clean-pre: called before 'clean' target -# .clean-post: called after 'clean' target -# .clobber-pre: called before 'clobber' target -# .clobber-post: called after 'clobber' target -# .all-pre: called before 'all' target -# .all-post: called after 'all' target -# .help-pre: called before 'help' target -# .help-post: called after 'help' target -# -# Targets beginning with '.' are not intended to be called on their own. -# -# Main targets can be executed directly, and they are: -# -# build build a specific configuration -# clean remove built files from a configuration -# clobber remove all built files -# all build all configurations -# help print help mesage -# -# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and -# .help-impl are implemented in nbproject/makefile-impl.mk. -# -# Available make variables: -# -# CND_BASEDIR base directory for relative paths -# CND_DISTDIR default top distribution directory (build artifacts) -# CND_BUILDDIR default top build directory (object files, ...) -# CONF name of current configuration -# CND_PLATFORM_${CONF} platform name (current configuration) -# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration) -# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration) -# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration) -# CND_PACKAGE_DIR_${CONF} directory of package (current configuration) -# CND_PACKAGE_NAME_${CONF} name of package (current configuration) -# CND_PACKAGE_PATH_${CONF} path to package (current configuration) -# -# NOCDDL - - -# Environment -MKDIR=mkdir -CP=cp -CCADMIN=CCadmin - - -# build -build: .build-post - -.build-pre: -# Add your pre 'build' code here... - -.build-post: .build-impl -# Add your post 'build' code here... - - -# clean -clean: .clean-post - -.clean-pre: -# Add your pre 'clean' code here... - -.clean-post: .clean-impl -# Add your post 'clean' code here... - - -# clobber -clobber: .clobber-post - -.clobber-pre: -# Add your pre 'clobber' code here... - -.clobber-post: .clobber-impl -# Add your post 'clobber' code here... - - -# all -all: .all-post - -.all-pre: -# Add your pre 'all' code here... - -.all-post: .all-impl -# Add your post 'all' code here... - - -# build tests -build-tests: .build-tests-post - -.build-tests-pre: -# Add your pre 'build-tests' code here... - -.build-tests-post: .build-tests-impl -# Add your post 'build-tests' code here... - - -# run tests -test: .test-post - -.test-pre: build-tests -# Add your pre 'test' code here... - -.test-post: .test-impl -# Add your post 'test' code here... - - -# help -help: .help-post - -.help-pre: -# Add your pre 'help' code here... - -.help-post: .help-impl -# Add your post 'help' code here... - - - -# include project implementation makefile -include nbproject/Makefile-impl.mk - -# include project make variables -include nbproject/Makefile-variables.mk diff --git a/tools/NlohmannMacroBuilder/main.cpp b/tools/NlohmannMacroBuilder/main.cpp deleted file mode 100644 index 7866b5865..000000000 --- a/tools/NlohmannMacroBuilder/main.cpp +++ /dev/null @@ -1,85 +0,0 @@ -#include -#include -#include -#include "../../single_include/nlohmann/json.hpp" - -using namespace std; - -void build_code(int max_args) -{ - stringstream ss; - ss << "#define NLOHMANN_JSON_EXPAND( x ) x" << endl; - ss << "#define NLOHMANN_JSON_GET_MACRO("; - for (int i = 0 ; i < max_args ; i++) - ss << "_" << i + 1 << ", "; - ss << "NAME,...) NAME" << endl; - - ss << "#define NLOHMANN_JSON_PASTE(...) NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_GET_MACRO(__VA_ARGS__, \\" << endl; - for (int i = max_args ; i > 1 ; i--) - ss << "NLOHMANN_JSON_PASTE" << i << ", \\" << endl; - ss << "NLOHMANN_JSON_PASTE1)(__VA_ARGS__))" << endl; - - ss << "#define NLOHMANN_JSON_PASTE2(func, v1) func(v1)" << endl; - for (int i = 3 ; i <= max_args ; i++) - { - ss << "#define NLOHMANN_JSON_PASTE" << i << "(func, "; - for (int j = 1 ; j < i -1 ; j++) - ss << "v" << j << ", "; - ss << "v" << i-1 << ") NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE" << i-1 << "(func, "; - for (int j = 2 ; j < i-1 ; j++) - ss << "v" << j << ", "; - ss << "v" << i-1 << ")" << endl; - } - - cout << ss.str() << endl; -} - -struct example_struct -{ - int a; - int b; - int c; - int d; - int e; - int f; - int g; - int h; - int i; - int j; - int k; - int l; - int m; - int n; - int o; - int p; - int q; - int r; - int s; - int t; - int u; - int v; - int w; - int x; - int y; - int z; - NLOHMANN_DEFINE_TYPE_INTRUSIVE(example_struct, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) -}; - -void test_code() -{ - example_struct a; - nlohmann::json j = a; - cout << j << endl; -} -/* - * - */ -int main(int argc, char** argv) -{ - int max_args = 64; - build_code(max_args); -// test_code(); - - return 0; -} - diff --git a/tools/NlohmannMacroBuilder/nbproject/Makefile-Release.mk b/tools/NlohmannMacroBuilder/nbproject/Makefile-Release.mk deleted file mode 100644 index c904f9924..000000000 --- a/tools/NlohmannMacroBuilder/nbproject/Makefile-Release.mk +++ /dev/null @@ -1,83 +0,0 @@ -# -# Generated Makefile - do not edit! -# -# Edit the Makefile in the project folder instead (../Makefile). Each target -# has a -pre and a -post target defined where you can add customized code. -# -# This makefile implements configuration specific macros and targets. - - -# Environment -MKDIR=mkdir -CP=cp -GREP=grep -NM=nm -CCADMIN=CCadmin -RANLIB=ranlib -CC=gcc -CCC=g++ -CXX=g++ -FC=gfortran -AS=as - -# Macros -CND_PLATFORM=GNU-Linux -CND_DLIB_EXT=so -CND_CONF=Release -CND_DISTDIR=dist -CND_BUILDDIR=build - -# Include project Makefile -include Makefile - -# Object Directory -OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM} - -# Object Files -OBJECTFILES= \ - ${OBJECTDIR}/main.o - - -# C Compiler Flags -CFLAGS= - -# CC Compiler Flags -CCFLAGS= -CXXFLAGS= - -# Fortran Compiler Flags -FFLAGS= - -# Assembler Flags -ASFLAGS= - -# Link Libraries and Options -LDLIBSOPTIONS= - -# Build Targets -.build-conf: ${BUILD_SUBPROJECTS} - "${MAKE}" -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/nlohmannmacrobuilder - -${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/nlohmannmacrobuilder: ${OBJECTFILES} - ${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM} - ${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/nlohmannmacrobuilder ${OBJECTFILES} ${LDLIBSOPTIONS} - -${OBJECTDIR}/main.o: main.cpp - ${MKDIR} -p ${OBJECTDIR} - ${RM} "$@.d" - $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/main.o main.cpp - -# Subprojects -.build-subprojects: - -# Clean Targets -.clean-conf: ${CLEAN_SUBPROJECTS} - ${RM} -r ${CND_BUILDDIR}/${CND_CONF} - -# Subprojects -.clean-subprojects: - -# Enable dependency checking -.dep.inc: .depcheck-impl - -include .dep.inc diff --git a/tools/NlohmannMacroBuilder/nbproject/Makefile-impl.mk b/tools/NlohmannMacroBuilder/nbproject/Makefile-impl.mk deleted file mode 100644 index b7ee0a01c..000000000 --- a/tools/NlohmannMacroBuilder/nbproject/Makefile-impl.mk +++ /dev/null @@ -1,133 +0,0 @@ -# -# Generated Makefile - do not edit! -# -# Edit the Makefile in the project folder instead (../Makefile). Each target -# has a pre- and a post- target defined where you can add customization code. -# -# This makefile implements macros and targets common to all configurations. -# -# NOCDDL - - -# Building and Cleaning subprojects are done by default, but can be controlled with the SUB -# macro. If SUB=no, subprojects will not be built or cleaned. The following macro -# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf -# and .clean-reqprojects-conf unless SUB has the value 'no' -SUB_no=NO -SUBPROJECTS=${SUB_${SUB}} -BUILD_SUBPROJECTS_=.build-subprojects -BUILD_SUBPROJECTS_NO= -BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}} -CLEAN_SUBPROJECTS_=.clean-subprojects -CLEAN_SUBPROJECTS_NO= -CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}} - - -# Project Name -PROJECTNAME=NlohmannMacroBuilder - -# Active Configuration -DEFAULTCONF=Release -CONF=${DEFAULTCONF} - -# All Configurations -ALLCONFS=Release - - -# build -.build-impl: .build-pre .validate-impl .depcheck-impl - @#echo "=> Running $@... Configuration=$(CONF)" - "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf - - -# clean -.clean-impl: .clean-pre .validate-impl .depcheck-impl - @#echo "=> Running $@... Configuration=$(CONF)" - "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf - - -# clobber -.clobber-impl: .clobber-pre .depcheck-impl - @#echo "=> Running $@..." - for CONF in ${ALLCONFS}; \ - do \ - "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf; \ - done - -# all -.all-impl: .all-pre .depcheck-impl - @#echo "=> Running $@..." - for CONF in ${ALLCONFS}; \ - do \ - "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf; \ - done - -# build tests -.build-tests-impl: .build-impl .build-tests-pre - @#echo "=> Running $@... Configuration=$(CONF)" - "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-tests-conf - -# run tests -.test-impl: .build-tests-impl .test-pre - @#echo "=> Running $@... Configuration=$(CONF)" - "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .test-conf - -# dependency checking support -.depcheck-impl: - @echo "# This code depends on make tool being used" >.dep.inc - @if [ -n "${MAKE_VERSION}" ]; then \ - echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES} \$${TESTOBJECTFILES}))" >>.dep.inc; \ - echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \ - echo "include \$${DEPFILES}" >>.dep.inc; \ - echo "endif" >>.dep.inc; \ - else \ - echo ".KEEP_STATE:" >>.dep.inc; \ - echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \ - fi - -# configuration validation -.validate-impl: - @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ - then \ - echo ""; \ - echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \ - echo "See 'make help' for details."; \ - echo "Current directory: " `pwd`; \ - echo ""; \ - fi - @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ - then \ - exit 1; \ - fi - - -# help -.help-impl: .help-pre - @echo "This makefile supports the following configurations:" - @echo " ${ALLCONFS}" - @echo "" - @echo "and the following targets:" - @echo " build (default target)" - @echo " clean" - @echo " clobber" - @echo " all" - @echo " help" - @echo "" - @echo "Makefile Usage:" - @echo " make [CONF=] [SUB=no] build" - @echo " make [CONF=] [SUB=no] clean" - @echo " make [SUB=no] clobber" - @echo " make [SUB=no] all" - @echo " make help" - @echo "" - @echo "Target 'build' will build a specific configuration and, unless 'SUB=no'," - @echo " also build subprojects." - @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no'," - @echo " also clean subprojects." - @echo "Target 'clobber' will remove all built files from all configurations and," - @echo " unless 'SUB=no', also from subprojects." - @echo "Target 'all' will will build all configurations and, unless 'SUB=no'," - @echo " also build subprojects." - @echo "Target 'help' prints this message." - @echo "" - diff --git a/tools/NlohmannMacroBuilder/nbproject/Makefile-variables.mk b/tools/NlohmannMacroBuilder/nbproject/Makefile-variables.mk deleted file mode 100644 index 72bae472f..000000000 --- a/tools/NlohmannMacroBuilder/nbproject/Makefile-variables.mk +++ /dev/null @@ -1,27 +0,0 @@ -# -# Generated - do not edit! -# -# NOCDDL -# -CND_BASEDIR=`pwd` -CND_BUILDDIR=build -CND_DISTDIR=dist -# Release configuration -CND_PLATFORM_Release=GNU-Linux -CND_ARTIFACT_DIR_Release=dist/Release/GNU-Linux -CND_ARTIFACT_NAME_Release=nlohmannmacrobuilder -CND_ARTIFACT_PATH_Release=dist/Release/GNU-Linux/nlohmannmacrobuilder -CND_PACKAGE_DIR_Release=dist/Release/GNU-Linux/package -CND_PACKAGE_NAME_Release=nlohmannmacrobuilder.tar -CND_PACKAGE_PATH_Release=dist/Release/GNU-Linux/package/nlohmannmacrobuilder.tar -# -# include compiler specific variables -# -# dmake command -ROOT:sh = test -f nbproject/private/Makefile-variables.mk || \ - (mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk) -# -# gmake command -.PHONY: $(shell test -f nbproject/private/Makefile-variables.mk || (mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk)) -# -include nbproject/private/Makefile-variables.mk diff --git a/tools/NlohmannMacroBuilder/nbproject/Package-Release.bash b/tools/NlohmannMacroBuilder/nbproject/Package-Release.bash deleted file mode 100644 index f544b16e3..000000000 --- a/tools/NlohmannMacroBuilder/nbproject/Package-Release.bash +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash -x - -# -# Generated - do not edit! -# - -# Macros -TOP=`pwd` -CND_PLATFORM=GNU-Linux -CND_CONF=Release -CND_DISTDIR=dist -CND_BUILDDIR=build -CND_DLIB_EXT=so -NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging -TMPDIRNAME=tmp-packaging -OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/nlohmannmacrobuilder -OUTPUT_BASENAME=nlohmannmacrobuilder -PACKAGE_TOP_DIR=nlohmannmacrobuilder/ - -# Functions -function checkReturnCode -{ - rc=$? - if [ $rc != 0 ] - then - exit $rc - fi -} -function makeDirectory -# $1 directory path -# $2 permission (optional) -{ - mkdir -p "$1" - checkReturnCode - if [ "$2" != "" ] - then - chmod $2 "$1" - checkReturnCode - fi -} -function copyFileToTmpDir -# $1 from-file path -# $2 to-file path -# $3 permission -{ - cp "$1" "$2" - checkReturnCode - if [ "$3" != "" ] - then - chmod $3 "$2" - checkReturnCode - fi -} - -# Setup -cd "${TOP}" -mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package -rm -rf ${NBTMPDIR} -mkdir -p ${NBTMPDIR} - -# Copy files and create directories and links -cd "${TOP}" -makeDirectory "${NBTMPDIR}/nlohmannmacrobuilder/bin" -copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 - - -# Generate tar file -cd "${TOP}" -rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/nlohmannmacrobuilder.tar -cd ${NBTMPDIR} -tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/nlohmannmacrobuilder.tar * -checkReturnCode - -# Cleanup -cd "${TOP}" -rm -rf ${NBTMPDIR} diff --git a/tools/NlohmannMacroBuilder/nbproject/configurations.xml b/tools/NlohmannMacroBuilder/nbproject/configurations.xml deleted file mode 100644 index eae4014eb..000000000 --- a/tools/NlohmannMacroBuilder/nbproject/configurations.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - main.cpp - - - - - Makefile - - - Makefile - - - - default - true - false - - - - 5 - - - 5 - - - 5 - - - 5 - - - - - - - diff --git a/tools/NlohmannMacroBuilder/nbproject/project.xml b/tools/NlohmannMacroBuilder/nbproject/project.xml deleted file mode 100644 index 706d9bc01..000000000 --- a/tools/NlohmannMacroBuilder/nbproject/project.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - org.netbeans.modules.cnd.makeproject - - - NlohmannMacroBuilder - - cpp - - UTF-8 - - - - - Release - 1 - - - - false - - - -