More clean up

Issue with duplicate include/define
This commit is contained in:
JackCarterSmith 2022-08-22 22:50:34 +02:00
parent c5e14436a2
commit 12d7409767
Signed by: JackCarterSmith
GPG Key ID: 832E52F4E23F8F24
9 changed files with 103 additions and 94 deletions

View File

@ -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})

157
Jenkinsfile vendored
View File

@ -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)
}
}
*/
}

View File

@ -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()

View File

@ -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_ */

View File

@ -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_ */

View File

@ -10,8 +10,8 @@
#include <stdlib.h>
#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_ */

View File

@ -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_ */

View File

@ -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