Skip to content
Snippets Groups Projects
Commit 5a06de24 authored by Grégoire Kubler's avatar Grégoire Kubler
Browse files

chore : better aidge install handling

Now no more cd, uses cmake to build in chosen $BUILD_DIR
Removed manual setup of CMAKE_PREFIX_PATH, now done in cmakelists & setup.py
$BUILD_TYPE specified in .build:variable:aidge_install
parent 92ed500b
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@ variables:
.build:variable:aidge_install:
variables:
AIDGE_INSTALL: "aidge_install/" # aidge installation dir, will serve as cmake_install_prefix
BUILD_TYPE: Release
BUILD_DIR: "build_cpp_${CI_PROJECT_NAME}_${CI_JOB_NAME_SLUG}_pipelineid_${CI_PIPELINE_ID}"
......
......@@ -23,8 +23,9 @@ include:
- DEPENDENCY_JOB="$CI_JOB_NAME"
- !reference [.ubuntu:download:artifacts, before_script]
# Build current module
- export CMAKE_PREFIX_PATH=$AIDGE_INSTALL
- echo "Build directory :$BUILD_DIR"
- echo "Current Working Directory :"
- pwd
- echo "Build directory :\ $BUILD_DIR"
- mkdir -p $BUILD_DIR
- echo $AIDGE_INSTALL
- mkdir -p $AIDGE_INSTALL # strips the variable of "../"
......@@ -40,10 +41,10 @@ include:
build:ubuntu_cpp:
extends: .build:ubuntu_cpp:template
script:
- cd $BUILD_DIR
# WERROR=OFF until https://gitlab.eclipse.org/eclipse/aidge/aidge/-/issues/137 is not closed
- cmake -DCMAKE_BUILD_TYPE=Release -DWERROR=OFF -DCOVERAGE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DPYBIND=0 ..
- make -j4 all install
- cmake -B $BUILD_DIR -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWERROR=OFF -DCOVERAGE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DPYBIND=0 ..
- cmake --build $BUILD_DIR --target all -j4
- cmake --install $BUILD_DIR --config $BUILD_TYPE
build:ubuntu_cpp:g++:
......@@ -58,12 +59,12 @@ build:ubuntu_cpp:g++:
matrix:
- Gplusplus_VERSION: ["10","12"]
script:
- cd $BUILD_DIR
- apt-get install -y g++-$Gplusplus_VERSION
- export CXX=/usr/bin/g++-$Gplusplus_VERSION
# WERROR=OFF until https://gitlab.eclipse.org/eclipse/aidge/aidge/-/issues/137 is not closed
- cmake -DCMAKE_BUILD_TYPE=Release -DWERROR=OFF -DCOVERAGE=OFF -DPYBIND=0 -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
- make -j4 all install
- cmake -B $BUILD_DIR -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWERROR=OFF -DCOVERAGE=OFF -DPYBIND=0 -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
- cmake --build $BUILD_DIR --target all -j4
- cmake --install $BUILD_DIR --config $BUILD_TYPE
build:ubuntu_cpp:clang:
stage: build
......@@ -77,11 +78,11 @@ build:ubuntu_cpp:clang:
matrix:
- CLANG_VERSION: ["12","15"]
script:
- cd $BUILD_DIR
- apt-get install -y clang-$CLANG_VERSION
# WERROR=OFF until https://gitlab.eclipse.org/eclipse/aidge/aidge/-/issues/137 is not closed
- cmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++-$CLANG_VERSION -DCMAKE_BUILD_TYPE=Release -DWERROR=OFF -DCOVERAGE=OFF -DPYBIND=0 -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
- make -j4 all install
- cmake -B $BUILD_DIR -DCMAKE_CXX_COMPILER=/usr/bin/clang++-$CLANG_VERSION -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWERROR=OFF -DCOVERAGE=OFF -DPYBIND=0 -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
- cmake --build $BUILD_DIR --target all -j4
- cmake --install $BUILD_DIR --config $BUILD_TYPE
####################################################################################################
......
......@@ -22,7 +22,6 @@ build:windows_cpp:
# Update PATH
- $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
- Write-Host "Aidge install = $env:AIDGE_INSTALL"
- $env:CMAKE_PREFIX_PATH = $env:AIDGE_INSTALL
# Download dependencies if required
- $DEPENDENCY_JOB="build:windows_cpp"
- !reference [.windows:download:artifacts, before_script]
......@@ -38,7 +37,8 @@ build:windows_cpp:
Set-Location $BUILD_PATH
# Configure with CMake
cmake -DCMAKE_BUILD_TYPE=Release `
cmake -B $BUILD_PATH `
-DCMAKE_BUILD_TYPE=Release `
-DTESTS=ON `
-DPYBIND=OFF `
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON `
......@@ -46,14 +46,14 @@ build:windows_cpp:
-S "$SOURCE_PATH" `
-B "$BUILD_PATH"
- cmake --build . -j2
- cmake --install . --config Debug
- cmake --build $BUILD_PATH -j2
- cmake --install $BUILD_PATH --config Debug
artifacts:
expire_in: 3 days
paths:
- $BUILD_DIR/
- $AIDGE_INSTALL_ARTIFACT/
- $BUILD_PATH/
- $AIDGE_INSTALL/
test:windows_cpp:
stage: test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment