-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
29 lines (24 loc) · 1.31 KB
/
conanfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from conans import ConanFile, CMake, tools
class Aoc2022Conan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
def requirements(self):
self.requires("fmt/9.1.0")
self.requires("range-v3/0.12.0")
if tools.get_env("AOC_2022_BUILD_TESTS", True):
self.requires("gtest/1.12.1")
def _configure_cmake(self):
cmake = CMake(self)
cmake.definitions["ASAN_ENABLED"] = "ON" if tools.get_env("AOC_2022_BUILD_TESTS", True) else "OFF"
cmake.definitions["AOC_2022_BUILD_TESTS"] = "ON" if tools.get_env("AOC_2022_BUILD_TESTS", True) else "OFF"
cmake.definitions["AOC_2022_BUILD_BENCHMARKS"] = "ON" if tools.get_env("AOC_2022_BUILD_BENCHMARKS", True) else "OFF"
if tools.get_env("CMAKE_C_COMPILER_LAUNCHER") is not None:
cmake.definitions["CMAKE_C_COMPILER_LAUNCHER"] = tools.get_env("CMAKE_C_COMPILER_LAUNCHER")
if tools.get_env("CMAKE_CXX_COMPILER_LAUNCHER") is not None:
cmake.definitions["CMAKE_CXX_COMPILER_LAUNCHER"] = tools.get_env("CMAKE_CXX_COMPILER_LAUNCHER")
cmake.definitions["CODE_COVERAGE"] = "ON" if tools.get_env("CODE_COVERAGE", True) else "OFF"
cmake.configure()
return cmake
def build(self):
cmake = self._configure_cmake()
cmake.build()