File tree 3 files changed +23
-3
lines changed
3 files changed +23
-3
lines changed Original file line number Diff line number Diff line change 35
35
- name : Install conan
36
36
run : pip install conan>2
37
37
- run : conan profile detect
38
- - run : conan create .
38
+ - run : conan create . --build=missing
Original file line number Diff line number Diff line change 29
29
- name : Get number of CPU cores
30
30
uses : SimenB/github-actions-cpu-cores@v1
31
31
id : cpu-cores
32
+
33
+ - run : conan install . --options enable_tests=True --build=boost/1.74.0
34
+ - run : cmake --list-presets
35
+ - run : cmake --preset conan-release
36
+ - run : cmake --build --list-presets
37
+ - run : cmake --build --preset conan-release -j${{ steps.cpu-cores.outputs.count }}
38
+ - run : ctest --list-presets
39
+ - run : ctest --preset conan-release
40
+
32
41
- name : cmake
33
42
run : cmake -S . -B build -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=cmake/conan_provider.cmake -DLIBCMAES_BUILD_PYTHON=On -DLIBCMAES_BUILD_TESTS=On -DLIBCMAES_USE_OPENMP=On -DCMAKE_BUILD_TYPE=Release
34
43
- name : compile
Original file line number Diff line number Diff line change @@ -26,8 +26,15 @@ class CmaesConan(ConanFile):
26
26
"shared" : [True , False ],
27
27
"openmp" : [True , False ],
28
28
"surrog" : [True , False ],
29
+ "enable_tests" : [True , False ],
30
+ }
31
+ default_options = {
32
+ "shared" : True ,
33
+ "openmp" : True ,
34
+ "surrog" : True ,
35
+ "enable_tests" : False ,
36
+ "boost/*:without_python" : False ,
29
37
}
30
- default_options = {"shared" : True , "openmp" : True , "surrog" : True }
31
38
32
39
# Sources are located in the same place as this recipe, copy them to the recipe
33
40
exports_sources = (
@@ -40,7 +47,9 @@ class CmaesConan(ConanFile):
40
47
)
41
48
42
49
def build_requirements (self ):
43
- self .test_requires ("gflags/2.2.2" )
50
+ if self .options .enable_tests :
51
+ self .test_requires ("gflags/2.2.2" )
52
+ self .test_requires ("boost/1.74.0" )
44
53
45
54
def requirements (self ):
46
55
self .requires ("eigen/3.4.0" , transitive_headers = True )
@@ -77,6 +86,8 @@ def generate(self):
77
86
tc .variables ["LIBCMAES_BUILD_SHARED_LIBS" ] = self .options .shared
78
87
tc .variables ["LIBCMAES_USE_OPENMP" ] = self .options .openmp
79
88
tc .variables ["LIBCMAES_ENABLE_SURROG" ] = self .options .surrog
89
+ tc .variables ["LIBCMAES_BUILD_PYTHON" ] = self .options .enable_tests
90
+ tc .variables ["LIBCMAES_BUILD_TESTS" ] = self .options .enable_tests
80
91
tc .generate ()
81
92
82
93
def build (self ):
You can’t perform that action at this time.
0 commit comments