Skip to content

Commit

Permalink
Add target_domains option to Conan
Browse files Browse the repository at this point in the history
  • Loading branch information
vmalia authored and mkrainiuk committed Jan 21, 2021
1 parent d377061 commit c572dd1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ if(ENABLE_MKLCPU_BACKEND
list(APPEND DOMAINS_LIST "rng")
endif()

if(NOT TARGET_DOMAINS)
if(NOT TARGET_DOMAINS OR TARGET_DOMAINS STREQUAL "None")
# Set to all by default
set(TARGET_DOMAINS ${DOMAINS_LIST})
else()
Expand Down
5 changes: 5 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class oneMKLConan(ConanFile):
options = {
# Build style
"build_shared_libs": [True, False],
"target_domains" : "ANY",

# Backends
"enable_mklcpu_backend" : [True, False],
Expand All @@ -61,6 +62,7 @@ class oneMKLConan(ConanFile):
}
default_options = {
"build_shared_libs" : True,
"target_domains" : None,

"enable_mklcpu_backend" : True,
"enable_mklgpu_backend" : True,
Expand Down Expand Up @@ -136,6 +138,9 @@ def build(self):
"CONAN_DISABLE_CHECK_COMPILER" : True,
"MKL_ROOT" : "/opt/intel/inteloneapi/mkl/latest",
})
# Pass target_domains definition transparently to CMake, since CMakeLists.txt contains checks and defaults.
if self.options.target_domains != None:
cmake.definitions["TARGET_DOMAINS"] = self.options.target_domains
cmake.configure()
cmake.build()
if tools.get_env("CONAN_RUN_TESTS", default=True) and self.options.build_functional_tests:
Expand Down

0 comments on commit c572dd1

Please sign in to comment.