Skip to content

Commit

Permalink
fix CMAKE_SYSTEM_NAME for Android and QNX
Browse files Browse the repository at this point in the history
  • Loading branch information
getim committed Sep 5, 2024
1 parent 4099c8d commit ba4a14b
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 15 deletions.
55 changes: 42 additions & 13 deletions repositories/cyclonedds.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ selects.config_setting_group(
)

selects.config_setting_group(
name = "android_or_qnx",
match_any = [
name = "android_with_shm",
match_all = [
"@platforms//os:android",
"@platforms//os:qnx",
":enable_shm_on",
],
)

selects.config_setting_group(
name = "android_or_qnx_with_shm",
name = "qnx_with_shm",
match_all = [
":android_or_qnx",
"@platforms//os:qnx",
":enable_shm_on",
],
)
Expand All @@ -64,9 +64,17 @@ selects.config_setting_group(
)

selects.config_setting_group(
name = "android_or_qnx_without_shm",
name = "android_without_shm",
match_all = [
":android_or_qnx",
"@platforms//os:android",
":enable_shm_off",
],
)

selects.config_setting_group(
name = "qnx_without_shm",
match_all = [
"@platforms//os:qnx",
":enable_shm_off",
],
)
Expand Down Expand Up @@ -104,10 +112,17 @@ cache_entries_linux_and_macos = {
"ENABLE_SOURCE_SPECIFIC_MULTICAST": "ON",
}

cache_entries_qnx = {
cache_entries_android_and_qnx = {
"ENABLE_SOURCE_SPECIFIC_MULTICAST": "OFF",
"ENABLE_IPV6": "OFF",
"CMAKE_SYSTEM_NAME": "ANDROID_OR_QNX",
}

cache_entries_android = {
"CMAKE_SYSTEM_NAME": "Android",
}

cache_entries_qnx = {
"CMAKE_SYSTEM_NAME": "QNX",
}

cache_entries_with_shm = {
Expand All @@ -132,30 +147,44 @@ cmake(
cache_entries_linux_and_macos,
cache_entries_with_shm,
),
":android_or_qnx_with_shm": dicts.add(
":android_with_shm": dicts.add(
cache_entries,
cache_entries_android,
cache_entries_android_and_qnx,
cache_entries_with_shm,
),
":qnx_with_shm": dicts.add(
cache_entries,
cache_entries_qnx,
cache_entries_android_and_qnx,
cache_entries_with_shm,
),
":linux_or_macos_without_shm": dicts.add(
cache_entries,
cache_entries_linux_and_macos,
cache_entries_without_shm,
),
":android_or_qnx_without_shm": dicts.add(
":android_without_shm": dicts.add(
cache_entries,
cache_entries_android,
cache_entries_android_and_qnx,
cache_entries_without_shm,
),
":qnx_without_shm": dicts.add(
cache_entries,
cache_entries_qnx,
cache_entries_android_and_qnx,
cache_entries_without_shm,
),
},
no_match_error = "Unsupported build configuration",
),
generate_args = ["-GNinja"],
lib_source = ":all_srcs",
linkopts = select(
linkopts = selects.with_or(
{
":linux_or_macos": ["-lpthread"],
":android_or_qnx": [],
("@platforms//os:android", "@platforms//os:qnx"): [],
},
no_match_error = "Supported OSs: Android, Linux, macOS, QNX",
),
Expand Down
12 changes: 10 additions & 2 deletions repositories/iceoryx.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ cache_entries = {
"CCACHE": "OFF",
}

cache_entries_android = {
"CMAKE_SYSTEM_NAME": "Android",
}

cache_entries_qnx = {
"CMAKE_SYSTEM_NAME": "ANDROID_OR_QNX",
"CMAKE_SYSTEM_NAME": "QNX",
}

# Depends on libacl. On Ubuntu install as `sudo apt-get install libacl1-dev`.
Expand All @@ -27,7 +31,11 @@ cmake(
cache_entries = selects.with_or(
{
("@platforms//os:linux", "@platforms//os:macos"): cache_entries,
("@platforms//os:android", "@platforms//os:qnx"): dicts.add(
"@platforms//os:android": dicts.add(
cache_entries,
cache_entries_android,
),
"@platforms//os:qnx": dicts.add(
cache_entries,
cache_entries_qnx,
),
Expand Down

0 comments on commit ba4a14b

Please sign in to comment.