Commit 9301a2c2 authored by Michaël Roynard's avatar Michaël Roynard

Fix packaging with new conan profiles

parent b8f91af8
Pipeline #4137 failed with stage
in 4 minutes and 31 seconds
variables:
CC: "gcc" # eg. gcc or clang
CXX: "g++" # eg. g++ or clang++
RELEASE_TYPE: "Release" # default release type
CONAN_PROFILE: "gcc-release" # profile to use with conan
CONAN_PROFILE: "gcc7" # profile to use with conan
# CONAN_PUBLIC_REMOTE_NAME: "lrde-public" # Conan remote name
# CONAN_PUBLIC_REMOTE_URL: "https://artifactory.lrde.epita.fr/artifactory/api/conan/lrde-public" # Conan remote name
# CONAN_PRIVATE_REMOTE_NAME: "lrde-private" # Conan remote name
......@@ -16,125 +13,62 @@ variables:
NAME: "gtest-constexpr-ext" # Conan package name
TAG: "stable" # Conan tag
VERSION: "0.1" # Version to build
CMAKE_GENERATOR: "-G Ninja" # include -G if defined
BUILD_DIRECTORY: "build-in-docker" # build directory name
SOURCE_DIRECTORY: ".." # where cmake search source files from the build directory
TARGET: "check" # target to invoke
TESTS: "ON" # build and run unit tests
stages:
- build
- package
.job-basic-build-linux: &distcheck-basic-build-linux
stage: build
.job-basic-package-linux: &distcheck-basic-package-linux
stage: package
image: mroynard/ubuntu-toolset:stable
script:
- set -e
- export CC=$CC
- export CXX=$CXX
- $CC --version
- $CXX --version
# - conan remote add $CONAN_PUBLIC_REMOTE_NAME $CONAN_PUBLIC_REMOTE_URL
- conan remote add $CONAN_PRIVATE_REMOTE_NAME $CONAN_PRIVATE_REMOTE_URL
# - conan user
# -p $CONAN_API_KEY
# -r $CONAN_PUBLIC_REMOTE_NAME $CONAN_USER
- conan user
-p $CONAN_API_KEY
-r $CONAN_PRIVATE_REMOTE_NAME $CONAN_USER
-p $CONAN_API_KEY
-r $CONAN_PRIVATE_REMOTE_NAME $CONAN_USER
- conan remote list
- mkdir -p $BUILD_DIRECTORY
- cd $BUILD_DIRECTORY
- conan install ..
- conan create
--build missing
-pr $CONAN_PROFILE
- cmake $CMAKE_GENERATOR
-DWITH_TESTS=$TESTS
$SOURCE_DIRECTORY
- cmake --build .
--target $TARGET
--config $RELEASE_TYPE
- ctest -C $RELEASE_TYPE
--output-on-failure
--schedule-random
--verbose
. $NAME/$VERSION@$CONAN_USER/$TAG-$CONAN_PROFILE
- conan upload
--all
-r $CONAN_PRIVATE_REMOTE_NAME
$NAME/$VERSION@$CONAN_USER/$TAG-$CONAN_PROFILE
distcheck-build-linux-gcc-release:
<<: *distcheck-basic-build-linux
distcheck-package-linux-gcc7:
<<: *distcheck-basic-package-linux
variables:
CONAN_PROFILE: "gcc-release"
distcheck-build-linux-clang-release:
<<: *distcheck-basic-build-linux
distcheck-package-linux-gcc8:
<<: *distcheck-basic-package-linux
variables:
CC: "clang"
CXX: "clang++"
CONAN_PROFILE: "clang-release"
CONAN_PROFILE: "gcc8"
distcheck-build-linux-gcc-debug:
<<: *distcheck-basic-build-linux
distcheck-package-linux-clang6:
<<: *distcheck-basic-package-linux
variables:
CONAN_PROFILE: "gcc-debug"
RELEASE_TYPE: "Debug"
CONAN_PROFILE: "clang6"
distcheck-build-linux-clang-debug:
<<: *distcheck-basic-build-linux
distcheck-package-linux-clang7:
<<: *distcheck-basic-package-linux
variables:
CC: "clang"
CXX: "clang++"
CONAN_PROFILE: "clang-debug"
RELEASE_TYPE: "Debug"
CONAN_PROFILE: "clang7"
.job-basic-package-linux: &distcheck-basic-package-linux
distcheck-package-linux-default:
stage: package
image: mroynard/ubuntu-toolset:stable
script:
- set -e
- export CC=$CC
- export CXX=$CXX
- $CC --version
- $CXX --version
# - conan remote add $CONAN_PUBLIC_REMOTE_NAME $CONAN_PUBLIC_REMOTE_URL
- conan remote add $CONAN_PRIVATE_REMOTE_NAME $CONAN_PRIVATE_REMOTE_URL
# - conan user
# -p $CONAN_API_KEY
# -r $CONAN_PUBLIC_REMOTE_NAME $CONAN_USER
- conan user
-p $CONAN_API_KEY
-r $CONAN_PRIVATE_REMOTE_NAME $CONAN_USER
- conan remote list
- conan create
--build missing
-pr $CONAN_PROFILE
. $NAME/$VERSION@$CONAN_USER/$TAG-$CONAN_PROFILE
. $NAME/$VERSION@$CONAN_USER/$TAG
- conan upload
--all
-r $CONAN_PRIVATE_REMOTE_NAME
$NAME/$VERSION@$CONAN_USER/$TAG-$CONAN_PROFILE
distcheck-package-linux-gcc-release:
<<: *distcheck-basic-package-linux
variables:
CONAN_PROFILE: "gcc-release"
distcheck-package-linux-clang-release:
<<: *distcheck-basic-package-linux
variables:
CC: "clang"
CXX: "clang++"
CONAN_PROFILE: "clang-release"
distcheck-package-linux-gcc-debug:
<<: *distcheck-basic-package-linux
variables:
CONAN_PROFILE: "gcc-debug"
RELEASE_TYPE: "Debug"
distcheck-package-linux-clang-debug:
<<: *distcheck-basic-package-linux
variables:
CC: "clang"
CXX: "clang++"
CONAN_PROFILE: "clang-debug"
RELEASE_TYPE: "Debug"
$NAME/$VERSION@$CONAN_USER/$TAG
......@@ -52,9 +52,5 @@ enable_testing()
add_subdirectory(test)
add_custom_target(check
DEPENDS tests-compile
COMMENT "Build and run all the unit tests, examples and benchmarks.")
add_custom_target(full
DEPENDS tests
COMMENT "Build and run all tests, examples, benchmark in addition to building the documentation.")
COMMENT "Build and run all the unit tests, examples and benchmarks.")
......@@ -8,6 +8,8 @@ class GtestConstexprExt(ConanFile):
url = "https://gitlab.lrde.epita.fr/mroynard/gtest-constexpr-ext"
description = "Add macro to detect whether an expression is compile-time."
settings = "os", "compiler", "arch", "build_type", "cppstd"
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = "shared=False", "fPIC=True"
generators = "cmake_find_package"
def source(self):
......@@ -15,7 +17,7 @@ class GtestConstexprExt(ConanFile):
git.clone("{}.git".format(self.url))
def build(self):
cmake = CMake(self, generator="Ninja")
cmake = CMake(self)
cmake.configure()
cmake.build()
cmake.test()
......@@ -31,7 +33,4 @@ class GtestConstexprExt(ConanFile):
self.cpp_info.includedirs = ["include"]
def requirements(self):
self.requires("gtest/1.8.0@dutiona/stable-{}-{}".format(
self.settings.compiler, str(self.settings.build_type).lower()))
# self.requires("gtest/1.8.0@mroynard/stable-{}-{}".format(
# self.settings.compiler, str(self.settings.build_type).lower()))
self.requires("gtest/1.8.1@bincrafters/stable")
......@@ -5,8 +5,7 @@ target_compile_features(Gtest-constexpr-ext INTERFACE cxx_std_17)
target_include_directories(Gtest-constexpr-ext INTERFACE ${GTEST_CONSTEXPR_EXT_INCLUDE_DIR})
target_link_libraries(Gtest-constexpr-ext INTERFACE gtest::gtest)
find_package(Threads REQUIRED)
target_link_libraries(Gtest-constexpr-ext INTERFACE Threads::Threads)
target_link_libraries(Gtest-constexpr-ext INTERFACE)
# dummy static project not linked anywere needed so that a vcxproj is generated with the sources in the solution
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
......
......@@ -17,7 +17,6 @@ macro(add_unit_test Executable Source)
endif()
target_link_libraries(test_${Executable} PRIVATE gtest::gtest)
target_link_libraries(test_${Executable} PRIVATE Threads::Threads)
add_dependencies(tests-compile test_${Executable})
endmacro(add_unit_test)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment