From cac6f188e31d88a6b8e7e66d98b7824135a22861 Mon Sep 17 00:00:00 2001 From: JackCarterSmith Date: Sun, 22 Sep 2024 15:38:55 +0200 Subject: [PATCH] Conan asspain --- Jenkinsfile | 8 ++++---- README.md | 13 ++++++------- conanfile.py | 4 ++-- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d008b08..907d432 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,16 +21,16 @@ pipeline { dir("linux") { checkout([$class: 'GitSCM', branches: [[name: '**']], browser: [$class: 'GiteaBrowser', repoUrl: 'https://git.jcsmith.fr/JCS-Prod/RSE-Terrain'], extensions: [], userRemoteConfigs: [[credentialsId: 'jenkins-ssh', url: 'ssh://git@git.jcsmith.fr:2322/JCS-Prod/RSE-Terrain.git']]]) sh 'git submodule update --init --recursive' - sh 'conan install . -of build -s build_type=Release -o tools=True -pr:h=default -pr:b=default --build=missing' - cmakeBuild buildDir: 'build', cmakeArgs: '-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -RSPTERRAIN_SHARED=ON -RSPTERRAIN_STATIC=OFF -DBUILD_TOOLS=ON -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release', installation: 'latest', steps: [[args: 'all']] + sh 'conan install . -of build -s build_type=Release -o "&:tools=True" -pr:b=default -pr:h=default --build=missing' + cmakeBuild buildDir: 'build', cmakeArgs: '-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DRSPTERRAIN_SHARED=ON -DRSPTERRAIN_STATIC=OFF -DBUILD_TOOLS=ON -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release', installation: 'latest', steps: [[args: 'all']] } }, windows: { dir("windows") { checkout([$class: 'GitSCM', branches: [[name: '**']], browser: [$class: 'GiteaBrowser', repoUrl: 'https://git.jcsmith.fr/JCS-Prod/RSE-Terrain'], extensions: [], userRemoteConfigs: [[credentialsId: 'jenkins-ssh', url: 'ssh://git@git.jcsmith.fr:2322/JCS-Prod/RSE-Terrain.git']]]) sh 'git submodule update --init --recursive' - sh 'conan install . -of build -s build_type=Release -o tools=True -pr:h=default -pr:b=default --build=missing' - cmakeBuild buildDir: 'build', cmakeArgs: '-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -RSPTERRAIN_SHARED=ON -RSPTERRAIN_STATIC=OFF -DBUILD_TOOLS=ON -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release', installation: 'latest', steps: [[args: 'all']] + sh 'conan install . -of build -s build_type=Release -o "&:tools=True" -pr:b=default -pr:h=windows --build=missing' + cmakeBuild buildDir: 'build', cmakeArgs: '-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DRSPTERRAIN_SHARED=ON -DRSPTERRAIN_STATIC=OFF -DBUILD_TOOLS=ON -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_RC_COMPILER=x86_64-w64-mingw32-windres', installation: 'latest', steps: [[args: 'all']] } } ) diff --git a/README.md b/README.md index fd823bc..7a8f776 100644 --- a/README.md +++ b/README.md @@ -43,8 +43,8 @@ Due to issue with copyrights, I can't provide samples... You need to extract HOB ### Dependencies -- [zlib](https://www.zlib.net/) (1.2.13) -- [libpng](http://www.libpng.org/pub/png/libpng.html) (1.6.40) +- [zlib](https://www.zlib.net/) (1.3.1) +- [libpng](http://www.libpng.org/pub/png/libpng.html) (1.6.43) - [obj-lib](https://git.jcsmith.fr/jackcartersmith/obj "obj file exporter") ### Compiling @@ -59,10 +59,9 @@ libpng16-dev distrib package can be used on debian/ubuntu. I've a preference for compiling libraries by hand, mainly for backward compatibility, but I recommend using Conan packages manager (https://conan.io) for simplicity. (**Don't forget git submodules**) ```shell -conan install -of build . --build=missing -pr:b=default -pr:h=default -cd build -cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" -cmake --build . +conan install . -of build -b missing -s build_type=Release -o tools=True -pr:b=default -pr:h=default +cmake --preset conan-release -G "Unix Makefiles" +cmake --build --preset conan-release ``` On Windows environment, you can use MinGW `-G "MinGW Makefiles"` or Ninja `-G "Ninja"` as CMake generator. @@ -71,6 +70,6 @@ On Windows environment, you can use MinGW `-G "MinGW Makefiles"` or Ninja `-G "N If you want to do it manually without Conan, you will probably need to specify the dependency flags for CMake. Ex: -`cmake.exe -D"ZLIB_INCLUDE_DIR=zlib/1.2.13/include" -D"ZLIB_LIBRARY=zlib/1.2.13/lib/libzlib.dll.a" -D"PNG_PNG_INCLUDE_DIR=libpng/1.6.40/include" -D"PNG_LIBRARY=libpng/1.6.40/lib/libpng.dll.a" . -G "MinGW Makefiles"` +`cmake.exe -D"ZLIB_INCLUDE_DIR=zlib/1.3.1/include" -D"ZLIB_LIBRARY=zlib/1.3.1/lib/libzlib.dll.a" -D"PNG_PNG_INCLUDE_DIR=libpng/1.6.43/include" -D"PNG_LIBRARY=libpng/1.6.43/lib/libpng.dll.a" . -G "MinGW Makefiles"` I've tested cross-compilation too, but since I want to check that Conan is working properly at each release, I've integrated it into the Jenkins flow using Conan for the cross-abstraction. diff --git a/conanfile.py b/conanfile.py index 1ecba43..bc57fbb 100644 --- a/conanfile.py +++ b/conanfile.py @@ -6,7 +6,7 @@ from conan.tools.scm import Git, Version required_conan_version = ">=2.3" -class RsetextureConan(ConanFile): +class rse_terrain(ConanFile): name = "rspterrainlib" package_type = "library" version = "2.1.0" @@ -59,7 +59,7 @@ class RsetextureConan(ConanFile): git.clone(url="https://git.jcsmith.fr/JCS-Prod/RSE-Terrain.git", target=".", args=cargs) # def _patch(self): -# replace_in_file(self, os.path.join(self.source_folder, "RSPTextureLib", "CMakeLists.txt"), +# replace_in_file(self, os.path.join(self.source_folder, "RSPTerrainLib", "CMakeLists.txt"), # 'set_target_properties(rsp-texture-libstatic PROPERTIES OUTPUT_NAME "${RSP_TEXTURE_LIB_NAME}_static")', # 'set_target_properties(rsp-texture-libstatic PROPERTIES OUTPUT_NAME "${RSP_TEXTURE_LIB_NAME}")')