From 12d74097675f8f0f0d553d2ab9494818b3c5671c Mon Sep 17 00:00:00 2001 From: JackCarterSmith Date: Mon, 22 Aug 2022 22:50:34 +0200 Subject: [PATCH] More clean up Issue with duplicate include/define --- CMakeLists.txt | 2 +- Jenkinsfile | 157 +++++++++++------------ LICENSE-glew.txt => LICENSE-glew | 0 RSPModelLib/CMakeLists.txt | 2 +- RSPModelLib/include/RSPModel.h | 6 +- RSPModelLib/include/RSPModel_datatypes.h | 16 ++- RSPModelLib/include/RSPModel_errordefs.h | 6 +- RSPModelLib/src/hob_parser.h | 6 +- doc/Doxyfile | 2 +- 9 files changed, 103 insertions(+), 94 deletions(-) rename LICENSE-glew.txt => LICENSE-glew (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 01f939f..a30a565 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ if(DEFINED ENV{CI}) # Jenkins CI integration mode project(rse-model VERSION $ENV{CI_VERSION}.$ENV{CI_BUILD_NUMBER} DESCRIPTION "RogueSquadron Extractor - Model" LANGUAGES C) set(RSE_MODEL_NAME $ENV{CI_OUTPUT_NAME}) else() # Standalone project mode, should not be used for release. - project(rse-model VERSION 2.0.0 DESCRIPTION "RogueSquadron Extractor - Model" LANGUAGES C) + project(rse-model VERSION 2.1.0 DESCRIPTION "RogueSquadron Extractor - Model" LANGUAGES C) set(RSE_MODEL_NAME RSEModel) endif() set(RSP_MODEL_LIB_NAME RSPModel${PROJECT_VERSION_MAJOR}${PROJECT_VERSION_MINOR}) diff --git a/Jenkinsfile b/Jenkinsfile index f2abc2d..f8e4cc0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,80 +1,79 @@ pipeline { - agent any - options { - skipDefaultCheckout(true) - } - environment { - CI_OUTPUT_NAME = "RSEModel" - CI_VERSION = "2.0.0" - CI_BUILD_NUMBER = "$BUILD_NUMBER" - } - stages { - stage('Prepare') { - steps { - cleanWs() - rtConanClient(id: "conan", userHome: "/home/jackcartersmith") - } - } - stage('Build') { - steps { - parallel( - linux: { - dir("linux") { - checkout([$class: 'GitSCM', branches: [[name: '**']], browser: [$class: 'GiteaBrowser', repoUrl: 'https://git.jcsmith.fr/JCS-Prod/RSE-Model'], extensions: [], userRemoteConfigs: [[credentialsId: 'jenkins-ssh', url: 'ssh://git@git.jcsmith.fr:2322/JCS-Prod/RSE-Model.git']]]) - sh 'git submodule update --init --recursive' - dir("build") { - rtConanRun(clientId: "conan", command: "install .. --build=missing") - } - cmakeBuild buildDir: 'build', installation: 'latest', steps: [[args: 'all']] - } - }, - windows: { - dir("windows") { - checkout([$class: 'GitSCM', branches: [[name: '**']], browser: [$class: 'GiteaBrowser', repoUrl: 'https://git.jcsmith.fr/JCS-Prod/RSE-Model'], extensions: [], userRemoteConfigs: [[credentialsId: 'jenkins-ssh', url: 'ssh://git@git.jcsmith.fr:2322/JCS-Prod/RSE-Model.git']]]) - sh 'git submodule update --init --recursive' - dir("build") { - rtConanRun(clientId: "conan", command: "install .. --profile=windows --build=missing") - } - cmakeBuild buildDir: 'build', cmakeArgs: '-DGNU_HOST=x86_64-w64-mingw32 -DCMAKE_TOOLCHAIN_FILE=../cmake/mingw_cross_toolchain.cmake', installation: 'latest', steps: [[args: 'all']] - } - } - ) - } - } - stage('Deploy') { - steps { - dir("zip_linux") { - sh 'cp -R ../linux/build/bin ../linux/build/lib ../linux/RSPModelLib/include .' - } - dir("zip_win") { - sh 'cp -R ../windows/build/bin ../windows/build/lib ../windows/RSPModelLib/include .' - } - zip archive: false, dir: 'zip_linux', exclude: '', glob: '', zipFile: 'linux_x64.zip' - sh 'mv linux_x64.zip ${CI_OUTPUT_NAME}_${CI_VERSION}.${BUILD_NUMBER}_Linux_x86_64.zip' - zip archive: false, dir: 'zip_win', exclude: '', glob: '', zipFile: 'mingw64.zip' - sh 'mv mingw64.zip ${CI_OUTPUT_NAME}_${CI_VERSION}.${BUILD_NUMBER}_mingw64.zip' - archiveArtifacts(artifacts: '*.zip') - fingerprint(targets: '*.zip') - } - } - stage('Sign') { - steps { - sh 'ls -l' - sh 'gpg --batch --detach-sign -o ${CI_OUTPUT_NAME}_${CI_VERSION}.${BUILD_NUMBER}_Linux_x86_64.zip.gpg ${CI_OUTPUT_NAME}_${CI_VERSION}.${BUILD_NUMBER}_Linux_x86_64.zip' - sh 'gpg --batch --detach-sign -o ${CI_OUTPUT_NAME}_${CI_VERSION}.${BUILD_NUMBER}_mingw64.zip.gpg ${CI_OUTPUT_NAME}_${CI_VERSION}.${BUILD_NUMBER}_mingw64.zip' - archiveArtifacts(artifacts: '*.gpg') - fingerprint(targets: '*.gpg') - } - } - } - /* - post { - always { - cleanWs(cleanWhenNotBuilt: false, - deleteDirs: true, - disableDeferredWipeout: true, - notFailBuild: true) - } - } - */ -} + agent any + options { + skipDefaultCheckout(true) + } + environment { + CI_OUTPUT_NAME = "RSEModel" + CI_VERSION = "2.1.0" + CI_BUILD_NUMBER = "$BUILD_NUMBER" + } + stages { + stage('Prepare') { + steps { + cleanWs() + rtConanClient(id: "conan", userHome: "/home/jackcartersmith") + } + } + stage('Build') { + steps { + parallel( + linux: { + dir("linux") { + checkout([$class: 'GitSCM', branches: [[name: '**']], browser: [$class: 'GiteaBrowser', repoUrl: 'https://git.jcsmith.fr/JCS-Prod/RSE-Model'], extensions: [], userRemoteConfigs: [[credentialsId: 'jenkins-ssh', url: 'ssh://git@git.jcsmith.fr:2322/JCS-Prod/RSE-Model.git']]]) + sh 'git submodule update --init --recursive' + dir("build") { + rtConanRun(clientId: "conan", command: "install .. --build=missing") + } + cmakeBuild buildDir: 'build', installation: 'latest', steps: [[args: 'all']] + } + }, + windows: { + dir("windows") { + checkout([$class: 'GitSCM', branches: [[name: '**']], browser: [$class: 'GiteaBrowser', repoUrl: 'https://git.jcsmith.fr/JCS-Prod/RSE-Model'], extensions: [], userRemoteConfigs: [[credentialsId: 'jenkins-ssh', url: 'ssh://git@git.jcsmith.fr:2322/JCS-Prod/RSE-Model.git']]]) + sh 'git submodule update --init --recursive' + dir("build") { + rtConanRun(clientId: "conan", command: "install .. --profile=windows --build=missing") + } + cmakeBuild buildDir: 'build', cmakeArgs: '-DGNU_HOST=x86_64-w64-mingw32 -DCMAKE_TOOLCHAIN_FILE=../cmake/mingw_cross_toolchain.cmake', installation: 'latest', steps: [[args: 'all']] + } + } + ) + } + } + stage('Deploy') { + steps { + dir("zip_linux") { + sh 'cp -R ../linux/build/bin ../linux/build/lib ../linux/RSPTerrainLib/include .' + } + dir("zip_win") { + sh 'cp -R ../windows/build/bin ../windows/build/lib ../windows/RSPTerrainLib/include .' + } + zip archive: false, dir: 'zip_linux', exclude: '', glob: '', zipFile: 'linux_x64.zip' + sh 'mv linux_x64.zip ${CI_OUTPUT_NAME}_${CI_VERSION}.${BUILD_NUMBER}_Linux_x86_64.zip' + zip archive: false, dir: 'zip_win', exclude: '', glob: '', zipFile: 'mingw64.zip' + sh 'mv mingw64.zip ${CI_OUTPUT_NAME}_${CI_VERSION}.${BUILD_NUMBER}_mingw64.zip' + archiveArtifacts(artifacts: '*.zip') + fingerprint(targets: '*.zip') + } + } + stage('Sign') { + steps { + sh 'gpg --batch --detach-sign -o ${CI_OUTPUT_NAME}_${CI_VERSION}.${BUILD_NUMBER}_Linux_x86_64.zip.gpg ${CI_OUTPUT_NAME}_${CI_VERSION}.${BUILD_NUMBER}_Linux_x86_64.zip' + sh 'gpg --batch --detach-sign -o ${CI_OUTPUT_NAME}_${CI_VERSION}.${BUILD_NUMBER}_mingw64.zip.gpg ${CI_OUTPUT_NAME}_${CI_VERSION}.${BUILD_NUMBER}_mingw64.zip' + archiveArtifacts(artifacts: '*.gpg') + fingerprint(targets: '*.gpg') + } + } + } + /* + post { + always { + cleanWs(cleanWhenNotBuilt: false, + deleteDirs: true, + disableDeferredWipeout: true, + notFailBuild: true) + } + } + */ +} \ No newline at end of file diff --git a/LICENSE-glew.txt b/LICENSE-glew similarity index 100% rename from LICENSE-glew.txt rename to LICENSE-glew diff --git a/RSPModelLib/CMakeLists.txt b/RSPModelLib/CMakeLists.txt index 9f0beaf..f6c2206 100644 --- a/RSPModelLib/CMakeLists.txt +++ b/RSPModelLib/CMakeLists.txt @@ -22,7 +22,7 @@ file(GLOB RSP_PUBLIC_HRDS ./include/*.h) set(RSP_PUBLIC_HRDS ${RSP_PUBLIC_HRDS} PARENT_SCOPE) -# Building instructions for RSE-Model +# Building instructions for RSP-Model library if(DEFINED ENV{CI}) set(CMAKE_BUILD_TYPE RELEASE) endif() diff --git a/RSPModelLib/include/RSPModel.h b/RSPModelLib/include/RSPModel.h index 9d8e979..c80a5c3 100644 --- a/RSPModelLib/include/RSPModel.h +++ b/RSPModelLib/include/RSPModel.h @@ -10,8 +10,8 @@ #include "RSPModel_datatypes.h" -#ifndef RSPMODEL_H_ -#define RSPMODEL_H_ +#ifndef RSPMODELLIB_H_ +#define RSPMODELLIB_H_ #if defined(_MSC_VER) @@ -118,4 +118,4 @@ RSPMODEL_EXTERN unsigned short RSPModel_objectToD3D( } #endif -#endif /* RSPMODEL_H_ */ +#endif /* RSPMODELLIB_H_ */ diff --git a/RSPModelLib/include/RSPModel_datatypes.h b/RSPModelLib/include/RSPModel_datatypes.h index 284bbef..5646f19 100644 --- a/RSPModelLib/include/RSPModel_datatypes.h +++ b/RSPModelLib/include/RSPModel_datatypes.h @@ -7,8 +7,8 @@ * */ -#ifndef RSPMODEL_DATATYPES_H_ -#define RSPMODEL_DATATYPES_H_ +#ifndef RSPMODELLIB_DATATYPES_H_ +#define RSPMODELLIB_DATATYPES_H_ #ifdef __cplusplus extern "C" { @@ -34,15 +34,25 @@ typedef union u_rspmodel_parameters { // Lib's structure definitions //////////////////////////////////////////////////////////////////////////////// +#ifndef MEMFILE typedef char* MEMFILE; +#endif +#ifndef T_RGBA typedef unsigned int T_RGBA; +#endif +#ifndef T_VECTOR3 typedef struct vector3 { float x,y,z; } T_VECTOR3; +#endif +#ifndef T_VERTEX typedef struct vertex { short x,y,z,w; } T_VERTEX; +#endif +#ifndef T_TEXCOORD typedef struct tex_coord { unsigned short u,v; } T_TEXCOORD; +#endif typedef struct face_flags { unsigned int fUnknown0:1; @@ -119,4 +129,4 @@ typedef struct rspmodel_hob { } #endif -#endif /* RSPMODEL_DATATYPES_H_ */ +#endif /* RSPMODELLIB_DATATYPES_H_ */ diff --git a/RSPModelLib/include/RSPModel_errordefs.h b/RSPModelLib/include/RSPModel_errordefs.h index 6d71ca6..6a36af6 100644 --- a/RSPModelLib/include/RSPModel_errordefs.h +++ b/RSPModelLib/include/RSPModel_errordefs.h @@ -10,8 +10,8 @@ #include -#ifndef RSPMODELLIB_ERRORS_H_ -#define RSPMODELLIB_ERRORS_H_ +#ifndef RSPLIB_ERRORS_H_ +#define RSPLIB_ERRORS_H_ #ifdef __cplusplus extern "C" { @@ -42,4 +42,4 @@ extern "C" { } #endif -#endif /* RSPMODELLIB_ERRORS_H_ */ +#endif /* RSPLIB_ERRORS_H_ */ diff --git a/RSPModelLib/src/hob_parser.h b/RSPModelLib/src/hob_parser.h index fabf751..9bc0926 100644 --- a/RSPModelLib/src/hob_parser.h +++ b/RSPModelLib/src/hob_parser.h @@ -10,8 +10,8 @@ #include "RSPModel_datatypes.h" -#ifndef SRC_HOB_PARSER_H_ -#define SRC_HOB_PARSER_H_ +#ifndef RSPMODELLIB_HOB_PARSER_H_ +#define RSPMODELLIB_HOB_PARSER_H_ /** * @brief Process HOB file stored in memory. @@ -48,4 +48,4 @@ unsigned char RSP_ModelLib_ParseHOBMemFile(const MEMFILE pMemFile, unsigned char RSP_ModelLib_ParseHOBFile(const char* fileName, T_RSPMODEL_HOB* hobStruct, const RSPMODEL_PARAMETERS* pParams); -#endif /* SRC_HOB_PARSER_H_ */ +#endif /* RSPMODELLIB_HOB_PARSER_H_ */ diff --git a/doc/Doxyfile b/doc/Doxyfile index a529575..e1b5845 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = RSE-Model # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.0.0 +PROJECT_NUMBER = 2.1.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a