add foreign_cc deps to cmake prefix path (#1311)
This commit is contained in:
parent
e67c45c8db
commit
6e542304f8
|
@ -12,11 +12,9 @@ _CACHE_ENTRIES = {
|
||||||
"BUILD_CURL_EXE": "off",
|
"BUILD_CURL_EXE": "off",
|
||||||
"BUILD_SHARED_LIBS": "off",
|
"BUILD_SHARED_LIBS": "off",
|
||||||
"CMAKE_BUILD_TYPE": "RELEASE",
|
"CMAKE_BUILD_TYPE": "RELEASE",
|
||||||
"CMAKE_PREFIX_PATH": "$$EXT_BUILD_DEPS/openssl",
|
|
||||||
"CMAKE_USE_OPENSSL": "on",
|
"CMAKE_USE_OPENSSL": "on",
|
||||||
# TODO: ldap should likely be enabled
|
# TODO: ldap should likely be enabled
|
||||||
"CURL_DISABLE_LDAP": "on",
|
"CURL_DISABLE_LDAP": "on",
|
||||||
"OPENSSL_ROOT_DIR": "$$EXT_BUILD_DEPS/openssl",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_MACOS_CACHE_ENTRIES = dict(_CACHE_ENTRIES.items() + {
|
_MACOS_CACHE_ENTRIES = dict(_CACHE_ENTRIES.items() + {
|
||||||
|
|
|
@ -13,7 +13,6 @@ _CACHE_ENTRIES = {
|
||||||
"BUILD_EXAMPLES": "off",
|
"BUILD_EXAMPLES": "off",
|
||||||
"BUILD_FUZZERS": "off",
|
"BUILD_FUZZERS": "off",
|
||||||
"BUILD_SHARED_LIBS": "off",
|
"BUILD_SHARED_LIBS": "off",
|
||||||
"CMAKE_PREFIX_PATH": "$$EXT_BUILD_DEPS/pcre;$$EXT_BUILD_DEPS/openssl;$$EXT_BUILD_DEPS/libssh2;$$EXT_BUILD_DEPS/zlib;$${CMAKE_PREFIX_PATH:-}",
|
|
||||||
#"EMBED_SSH_PATH": "$(location @libssh2//:libssh2)",
|
#"EMBED_SSH_PATH": "$(location @libssh2//:libssh2)",
|
||||||
"USE_HTTPS": "on",
|
"USE_HTTPS": "on",
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,6 @@ _CACHE_ENTRIES = {
|
||||||
"BUILD_SHARED_LIBS": "off",
|
"BUILD_SHARED_LIBS": "off",
|
||||||
"BUILD_TESTING": "off",
|
"BUILD_TESTING": "off",
|
||||||
"CMAKE_FIND_DEBUG_MODE": "on",
|
"CMAKE_FIND_DEBUG_MODE": "on",
|
||||||
"CMAKE_PREFIX_PATH": "$${CMAKE_PREFIX_PATH:-};$$EXT_BUILD_DEPS/openssl",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_LINUX_CACHE_ENTRIES = dict(_CACHE_ENTRIES.items() + {
|
_LINUX_CACHE_ENTRIES = dict(_CACHE_ENTRIES.items() + {
|
||||||
|
|
|
@ -271,6 +271,7 @@ def _create_configure_script(configureParameters):
|
||||||
cmake_prefix = prefix,
|
cmake_prefix = prefix,
|
||||||
include_dirs = inputs.include_dirs,
|
include_dirs = inputs.include_dirs,
|
||||||
is_debug_mode = is_debug_mode(ctx),
|
is_debug_mode = is_debug_mode(ctx),
|
||||||
|
ext_build_dirs = inputs.ext_build_dirs,
|
||||||
)
|
)
|
||||||
return configure_script
|
return configure_script
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,8 @@ def create_cmake_script(
|
||||||
cmake_commands,
|
cmake_commands,
|
||||||
include_dirs = [],
|
include_dirs = [],
|
||||||
cmake_prefix = None,
|
cmake_prefix = None,
|
||||||
is_debug_mode = True):
|
is_debug_mode = True,
|
||||||
|
ext_build_dirs = []):
|
||||||
"""Constructs CMake script to be passed to cc_external_rule_impl.
|
"""Constructs CMake script to be passed to cc_external_rule_impl.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -81,12 +82,13 @@ def create_cmake_script(
|
||||||
include_dirs: Optional additional include directories. Defaults to [].
|
include_dirs: Optional additional include directories. Defaults to [].
|
||||||
cmake_prefix: Optional prefix before the cmake command (without the trailing space).
|
cmake_prefix: Optional prefix before the cmake command (without the trailing space).
|
||||||
is_debug_mode: If the compilation mode is `debug`. Defaults to True.
|
is_debug_mode: If the compilation mode is `debug`. Defaults to True.
|
||||||
|
ext_build_dirs: A list of gen_dirs for each foreign_cc dep.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
list: Lines of bash which make up the build script
|
list: Lines of bash which make up the build script
|
||||||
"""
|
"""
|
||||||
|
|
||||||
merged_prefix_path = _merge_prefix_path(user_cache, include_dirs)
|
merged_prefix_path = _merge_prefix_path(user_cache, include_dirs, ext_build_dirs)
|
||||||
|
|
||||||
toolchain_dict = _fill_crossfile_from_toolchain(workspace_name, tools, flags)
|
toolchain_dict = _fill_crossfile_from_toolchain(workspace_name, tools, flags)
|
||||||
params = None
|
params = None
|
||||||
|
@ -171,9 +173,12 @@ def _wipe_empty_values(cache, keys_with_empty_values_in_user_cache):
|
||||||
cache.pop(key)
|
cache.pop(key)
|
||||||
|
|
||||||
# From CMake documentation: ;-list of directories specifying installation prefixes to be searched...
|
# From CMake documentation: ;-list of directories specifying installation prefixes to be searched...
|
||||||
def _merge_prefix_path(user_cache, include_dirs):
|
def _merge_prefix_path(user_cache, include_dirs, ext_build_dirs):
|
||||||
user_prefix = user_cache.get("CMAKE_PREFIX_PATH")
|
user_prefix = user_cache.get("CMAKE_PREFIX_PATH")
|
||||||
values = ["$$EXT_BUILD_DEPS$$"] + include_dirs
|
values = ["$$EXT_BUILD_DEPS$$"] + include_dirs
|
||||||
|
for ext_dir in ext_build_dirs:
|
||||||
|
values.append("$$EXT_BUILD_DEPS$$/{}".format(ext_dir.basename))
|
||||||
|
|
||||||
if user_prefix != None:
|
if user_prefix != None:
|
||||||
# remove it, it is gonna be merged specifically
|
# remove it, it is gonna be merged specifically
|
||||||
user_cache.pop("CMAKE_PREFIX_PATH")
|
user_cache.pop("CMAKE_PREFIX_PATH")
|
||||||
|
|
Loading…
Reference in New Issue