Commit 4f7c100c authored by Michaël Roynard's avatar Michaël Roynard

Merge branch 'dev' into 'master'

Fix pthread dependency

See merge request !4
parents 58a3e4ab 31d25c06
Pipeline #2036 passed with stage
in 1 minute and 29 seconds
......@@ -18,7 +18,7 @@ class GtestconstexprextConan(ConanFile):
git.clone(self.url)
def build(self):
cmake = CMake(self)
cmake = CMake(self, generator="Ninja")
cmake.configure()
cmake.build()
cmake.test()
......
......@@ -5,6 +5,9 @@ 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_PKG::gtest)
FIND_PACKAGE(Threads REQUIRED)
target_link_libraries(Gtest-constexpr-ext INTERFACE Threads::Threads)
# 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)
set(GTEST_CONSTEXPR_EXT_SOURCES
......
......@@ -16,7 +16,8 @@ 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_PKG::gtest)
target_link_libraries(test_${Executable} PRIVATE CONAN_PKG::gtest)
target_link_libraries(test_${Executable} PRIVATE Threads::Threads)
add_dependencies(tests-compile test_${Executable})
endmacro(add_unit_test)
......@@ -25,6 +26,7 @@ option(WITH_TESTS "Compile and run tests" ON)
if(WITH_TESTS)
FIND_PACKAGE(Threads REQUIRED)
add_subdirectory(gtest-constexpr-ext)
endif(WITH_TESTS)
......@@ -4,11 +4,15 @@ cmake_minimum_required(VERSION 3.8.2)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)
add_executable(example example.cpp)
target_link_libraries(example PRIVATE CONAN_PKG::gtest-constexpr-ext)
target_compile_features(example INTERFACE cxx_std_17)
add_executable(test test.cpp)
target_compile_features(test INTERFACE cxx_std_17)
target_link_libraries(test PRIVATE CONAN_PKG::gtest-constexpr-ext)
FIND_PACKAGE(Threads REQUIRED)
target_link_libraries(test PRIVATE Threads::Threads)
enable_testing()
add_test(NAME example
add_test(NAME test
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
COMMAND example)
COMMAND test)
......@@ -8,7 +8,7 @@ class GtestconstexprextTestConan(ConanFile):
generators = "cmake"
def build(self):
cmake = CMake(self)
cmake = CMake(self, generator="Ninja")
cmake.configure()
cmake.build()
......@@ -20,4 +20,4 @@ class GtestconstexprextTestConan(ConanFile):
def test(self):
if not tools.cross_building(self.settings):
os.chdir("bin")
self.run(".%sexample" % os.sep)
self.run(".%stest" % os.sep)
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