Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Michaël Roynard
gtest-constexpr-ext
Commits
8af3bff3
Commit
8af3bff3
authored
Jun 05, 2018
by
Michaël Roynard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into 'master'
Put conan install call inside cmake See merge request
!2
parents
8701a86e
b9dcc5c0
Pipeline
#1960
passed with stage
in 1 minute and 15 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
15 deletions
+18
-15
.gitlab-ci.yml
.gitlab-ci.yml
+1
-10
CMakeLists.txt
CMakeLists.txt
+14
-2
include/CMakeLists.txt
include/CMakeLists.txt
+2
-2
test/CMakeLists.txt
test/CMakeLists.txt
+1
-1
No files found.
.gitlab-ci.yml
View file @
8af3bff3
...
...
@@ -2,8 +2,6 @@ variables:
CC
:
"
gcc"
# eg. gcc or clang
CXX
:
"
g++"
# eg. g++ or clang++
RELEASE_TYPE
:
"
Release"
# default release type
COMPILER_VERSION
:
"
7.3"
# version of the compiler
COMPILER_LIBCXX
:
"
libstdc++11"
# libcxx with which we link against
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
...
...
@@ -26,14 +24,9 @@ stages:
-
mkdir -p $BUILD_DIRECTORY
-
cd $BUILD_DIRECTORY
-
if [ "$CLEAN" == "ON" ]; then rm -rf ./*; fi
-
conan install ..
--build missing
-s compiler=$CC
-s compiler.version=$COMPILER_VERSION
-s compiler.libcxx=$COMPILER_LIBCXX
-s build_type=$RELEASE_TYPE
-
cmake $CMAKE_GENERATOR
-DWITH_TESTS=$TESTS
-DCMAKE_BUILD_TYPE=$RELEASE_TYPE
$SOURCE_DIRECTORY
-
cmake --build .
--target $TARGET
...
...
@@ -48,7 +41,6 @@ distcheck-linux-clang-release:
variables
:
CC
:
"
clang"
CXX
:
"
clang++"
COMPILER_VERSION
:
"
6.0"
distcheck-linux-gcc-debug
:
<<
:
*distcheck-basic-linux
...
...
@@ -61,4 +53,3 @@ distcheck-linux-clang-debug:
RELEASE_TYPE
:
"
Debug"
CC
:
"
clang"
CXX
:
"
clang++"
COMPILER_VERSION
:
"
6.0"
CMakeLists.txt
View file @
8af3bff3
...
...
@@ -2,8 +2,20 @@ cmake_minimum_required(VERSION 3.8.2) # required for cxx_std_17
project
(
GTest-constexpr-ext VERSION 0.0.1 LANGUAGES CXX
)
include
(
${
CMAKE_BINARY_DIR
}
/conanbuildinfo.cmake
)
conan_basic_setup
()
# call conan install from cmake for autodetecting libcxx, compiler etc.
if
(
NOT EXISTS
"
${
CMAKE_BINARY_DIR
}
/conan.cmake"
)
message
(
STATUS
"Downloading conan.cmake from https://github.com/conan-io/cmake-conan"
)
file
(
DOWNLOAD
"https://raw.githubusercontent.com/conan-io/cmake-conan/master/conan.cmake"
"
${
CMAKE_BINARY_DIR
}
/conan.cmake"
)
endif
()
include
(
${
CMAKE_BINARY_DIR
}
/conan.cmake
)
# conan dependencies
conan_cmake_run
(
REQUIRES
gtest/1.8.0@bincrafters/stable
BASIC_SETUP CMAKE_TARGETS
BUILD missing
)
SET
(
COMPILER_CLANG OFF
)
SET
(
COMPILER_GCC OFF
)
...
...
include/CMakeLists.txt
View file @
8af3bff3
...
...
@@ -3,7 +3,7 @@ set(GTEST_CONSTEXPR_EXT_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/include")
add_library
(
Gtest-constexpr-ext INTERFACE
)
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
${
CONAN_
LIBS
}
)
target_link_libraries
(
Gtest-constexpr-ext INTERFACE CONAN_
PKG::gtest
)
# 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
)
...
...
@@ -15,4 +15,4 @@ set_target_properties(Gtest-constexpr-ext_srcs PROPERTIES LINKER_LANGUAGE CXX)
target_compile_features
(
Gtest-constexpr-ext_srcs PUBLIC cxx_std_17
)
target_include_directories
(
Gtest-constexpr-ext_srcs PUBLIC
${
GTEST_CONSTEXPR_EXT_INCLUDE_DIR
}
)
source_group
(
TREE
${
GTEST_CONSTEXPR_EXT_INCLUDE_DIR
}
FILES
${
GTEST_CONSTEXPR_EXT_SOURCES
}
)
target_link_libraries
(
Gtest-constexpr-ext_srcs PUBLIC
${
CONAN_
LIBS
}
)
target_link_libraries
(
Gtest-constexpr-ext_srcs PUBLIC CONAN_
PKG::gtest
)
test/CMakeLists.txt
View file @
8af3bff3
...
...
@@ -16,7 +16,7 @@ macro(add_unit_test Executable Source)
target_compile_options
(
test_
${
Executable
}
PRIVATE -Wno-unused-private-field
)
endif
()
target_link_libraries
(
Gtest-constexpr-ext INTERFACE
${
CONAN_
LIBS
}
)
target_link_libraries
(
Gtest-constexpr-ext INTERFACE CONAN_
PKG::gtest
)
add_dependencies
(
tests-compile test_
${
Executable
}
)
endmacro
(
add_unit_test
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment