-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Committing oneTBB 2021.1-beta09 source code
- Loading branch information
Showing
122 changed files
with
6,971 additions
and
651 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# Copyright (c) 2020 Intel Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Save current location, | ||
# see for details: https://cmake.org/cmake/help/latest/variable/CMAKE_CURRENT_LIST_DIR.html | ||
set(_tbb_gen_cfg_path ${CMAKE_CURRENT_LIST_DIR}) | ||
|
||
include(CMakeParseArguments) | ||
|
||
function(tbb_generate_config) | ||
set(options HANDLE_SUBDIRS) | ||
set(oneValueArgs INSTALL_DIR | ||
SYSTEM_NAME | ||
SIZEOF_VOID_P # 4 for 32 bit, 8 for 64 bit. | ||
LIB_REL_PATH INC_REL_PATH DLL_REL_PATH | ||
VERSION | ||
TBB_BINARY_VERSION | ||
TBBMALLOC_BINARY_VERSION | ||
TBBMALLOC_PROXY_BINARY_VERSION | ||
TBBBIND_BINARY_VERSION) | ||
|
||
cmake_parse_arguments(tbb_gen_cfg "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) | ||
|
||
get_filename_component(config_install_dir ${tbb_gen_cfg_INSTALL_DIR} ABSOLUTE) | ||
file(MAKE_DIRECTORY ${config_install_dir}) | ||
|
||
file(TO_CMAKE_PATH "${tbb_gen_cfg_LIB_REL_PATH}" TBB_LIB_REL_PATH) | ||
file(TO_CMAKE_PATH "${tbb_gen_cfg_DLL_REL_PATH}" TBB_DLL_REL_PATH) | ||
file(TO_CMAKE_PATH "${tbb_gen_cfg_INC_REL_PATH}" TBB_INC_REL_PATH) | ||
|
||
set(TBB_SIZEOF_VOID_P "${tbb_gen_cfg_SIZEOF_VOID_P}") | ||
|
||
set(TBB_VERSION ${tbb_gen_cfg_VERSION}) | ||
|
||
set(TBB_COMPONENTS_BIN_VERSION " | ||
set(_tbb_bin_version ${tbb_gen_cfg_TBB_BINARY_VERSION}) | ||
set(_tbbmalloc_bin_version ${tbb_gen_cfg_TBBMALLOC_BINARY_VERSION}) | ||
set(_tbbmalloc_proxy_bin_version ${tbb_gen_cfg_TBBMALLOC_PROXY_BINARY_VERSION}) | ||
set(_tbbbind_bin_version ${tbb_gen_cfg_TBBBIND_BINARY_VERSION}) | ||
") | ||
|
||
if (tbb_gen_cfg_SYSTEM_NAME STREQUAL "Linux") | ||
set(TBB_LIB_PREFIX "lib") | ||
set(TBB_LIB_EXT "so.\${_\${_tbb_component}_bin_version}") | ||
set(TBB_IMPLIB_RELEASE "") | ||
set(TBB_IMPLIB_DEBUG "") | ||
if (tbb_gen_cfg_HANDLE_SUBDIRS) | ||
set(TBB_HANDLE_SUBDIRS " | ||
set(_tbb_subdir gcc4.8) | ||
") | ||
endif() | ||
elseif (tbb_gen_cfg_SYSTEM_NAME STREQUAL "Darwin") | ||
set(TBB_LIB_PREFIX "lib") | ||
set(TBB_LIB_EXT "\${_\${_tbb_component}_bin_version}.dylib") | ||
set(TBB_IMPLIB_RELEASE "") | ||
set(TBB_IMPLIB_DEBUG "") | ||
elseif (tbb_gen_cfg_SYSTEM_NAME STREQUAL "Windows") | ||
set(TBB_LIB_PREFIX "") | ||
set(TBB_LIB_EXT "dll") | ||
set(TBB_COMPILE_DEFINITIONS " | ||
INTERFACE_COMPILE_DEFINITIONS \"__TBB_NO_IMPLICIT_LINKAGE=1\"") | ||
|
||
# .lib files installed to TBB_LIB_REL_PATH (e.g. <prefix>/lib); | ||
# .dll files installed to TBB_DLL_REL_PATH (e.g. <prefix>/bin); | ||
# Expand TBB_LIB_REL_PATH here in IMPORTED_IMPLIB property and | ||
# redefine it with TBB_DLL_REL_PATH value to properly fill IMPORTED_LOCATION property in TBBConfig.cmake.in template. | ||
set(TBB_IMPLIB_RELEASE " | ||
IMPORTED_IMPLIB_RELEASE \"\${CMAKE_CURRENT_LIST_DIR}/${TBB_LIB_REL_PATH}/\${_tbb_subdir}/\${_tbb_component}.lib\"") | ||
set(TBB_IMPLIB_DEBUG " | ||
IMPORTED_IMPLIB_DEBUG \"\${CMAKE_CURRENT_LIST_DIR}/${TBB_LIB_REL_PATH}/\${_tbb_subdir}/\${_tbb_component}_debug.lib\"") | ||
set(TBB_LIB_REL_PATH ${TBB_DLL_REL_PATH}) | ||
|
||
if (tbb_gen_cfg_HANDLE_SUBDIRS) | ||
set(TBB_HANDLE_SUBDIRS " | ||
set(_tbb_subdir vc14) | ||
if (WINDOWS_STORE) | ||
set(_tbb_subdir \${_tbb_subdir}_uwp) | ||
endif() | ||
") | ||
endif() | ||
else() | ||
message(FATAL_ERROR "Unsupported OS name: ${tbb_system_name}") | ||
endif() | ||
|
||
configure_file(${_tbb_gen_cfg_path}/templates/TBBConfig.cmake.in ${config_install_dir}/TBBConfig.cmake @ONLY) | ||
configure_file(${_tbb_gen_cfg_path}/templates/TBBConfigVersion.cmake.in ${config_install_dir}/TBBConfigVersion.cmake @ONLY) | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Copyright (c) 2020 Intel Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
include(${CMAKE_CURRENT_LIST_DIR}/../config_generation.cmake) | ||
|
||
# TBBConfig in TBB provided packages are expected to be placed into: <tbb-root>/lib[/<intel64|ia32>]/cmake/TBB | ||
set(WIN_LIN_INC_REL_PATH "../../../../include") | ||
set(DARWIN_INC_REL_PATH "../../../include") | ||
set(LIB_REL_PATH "../..") | ||
set(DLL_REL_PATH "../../../../redist") # ia32/intel64 subdir is appended depending on configuration. | ||
|
||
# Parse version info | ||
file(READ ${CMAKE_CURRENT_LIST_DIR}/../../include/tbb/version.h _tbb_version_info) | ||
string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" _tbb_ver_major "${_tbb_version_info}") | ||
string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" _tbb_ver_minor "${_tbb_version_info}") | ||
string(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" _tbb_interface_ver "${_tbb_version_info}") | ||
string(REGEX REPLACE ".*#define __TBB_BINARY_VERSION ([0-9]+).*" "\\1" TBB_BINARY_VERSION "${_tbb_version_info}") | ||
file(READ ${CMAKE_CURRENT_LIST_DIR}/../../CMakeLists.txt _tbb_cmakelist) | ||
string(REGEX REPLACE ".*TBBMALLOC_BINARY_VERSION ([0-9]+).*" "\\1" TBBMALLOC_BINARY_VERSION "${_tbb_cmakelist}") | ||
set(TBBMALLOC_PROXY_BINARY_VERSION ${TBBMALLOC_BINARY_VERSION}) | ||
string(REGEX REPLACE ".*TBBBIND_BINARY_VERSION ([0-9]+).*" "\\1" TBBBIND_BINARY_VERSION "${_tbb_cmakelist}") | ||
|
||
# Parse patch and tweak versions from interface version: e.g. 12014 --> 01 - patch version, 4 - tweak version. | ||
math(EXPR _tbb_ver_patch "${_tbb_interface_ver} % 1000 / 10") | ||
math(EXPR _tbb_ver_tweak "${_tbb_interface_ver} % 10") | ||
|
||
# Applicable for beta releases. | ||
if (_tbb_ver_patch EQUAL 0) | ||
math(EXPR _tbb_ver_tweak "${_tbb_ver_tweak} + 6") | ||
endif() | ||
|
||
set(COMMON_ARGS | ||
LIB_REL_PATH ${LIB_REL_PATH} | ||
VERSION ${_tbb_ver_major}.${_tbb_ver_minor}.${_tbb_ver_patch}.${_tbb_ver_tweak} | ||
TBB_BINARY_VERSION ${TBB_BINARY_VERSION} | ||
TBBMALLOC_BINARY_VERSION ${TBBMALLOC_BINARY_VERSION} | ||
TBBMALLOC_PROXY_BINARY_VERSION ${TBBMALLOC_PROXY_BINARY_VERSION} | ||
TBBBIND_BINARY_VERSION ${TBBBIND_BINARY_VERSION} | ||
) | ||
|
||
tbb_generate_config(INSTALL_DIR ${INSTALL_DIR}/linux-32 SYSTEM_NAME Linux INC_REL_PATH ${WIN_LIN_INC_REL_PATH} SIZEOF_VOID_P 4 HANDLE_SUBDIRS ${COMMON_ARGS}) | ||
tbb_generate_config(INSTALL_DIR ${INSTALL_DIR}/linux-64 SYSTEM_NAME Linux INC_REL_PATH ${WIN_LIN_INC_REL_PATH} SIZEOF_VOID_P 8 HANDLE_SUBDIRS ${COMMON_ARGS}) | ||
tbb_generate_config(INSTALL_DIR ${INSTALL_DIR}/windows-32 SYSTEM_NAME Windows INC_REL_PATH ${WIN_LIN_INC_REL_PATH} SIZEOF_VOID_P 4 HANDLE_SUBDIRS DLL_REL_PATH ${DLL_REL_PATH}/ia32 ${COMMON_ARGS}) | ||
tbb_generate_config(INSTALL_DIR ${INSTALL_DIR}/windows-64 SYSTEM_NAME Windows INC_REL_PATH ${WIN_LIN_INC_REL_PATH} SIZEOF_VOID_P 8 HANDLE_SUBDIRS DLL_REL_PATH ${DLL_REL_PATH}/intel64 ${COMMON_ARGS}) | ||
tbb_generate_config(INSTALL_DIR ${INSTALL_DIR}/darwin SYSTEM_NAME Darwin INC_REL_PATH ${DARWIN_INC_REL_PATH} SIZEOF_VOID_P 8 ${COMMON_ARGS}) | ||
message(STATUS "TBBConfig files were created in ${INSTALL_DIR}") |
Oops, something went wrong.