Skip to content

ubuntu arm #249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,32 @@ jobs:
castxml-epic: 1
cppstd: "-std=c++11"

# UBUNTU ARM
- os: ubuntu-22.04-arm
arch: aarch64
compiler: clang++
clang-version: 15
python-version: "3.13"
castxml-epic: 0
cppstd: "-std=c++17"

- os: ubuntu-24.04-arm
arch: aarch64
compiler: clang++
clang-version: 16
python-version: "3.13"
castxml-epic: 0
cppstd: "-std=c++17"

# UBUNTU 24.04 - CASTXML EPIC 1
- os: ubuntu-24.04-arm
arch: aarch64
compiler: clang++
clang-version: 16
python-version: "3.13"
castxml-epic: 1
cppstd: "-std=c++11"

# MACOS
- os: macos-13
compiler: clang++
Expand Down Expand Up @@ -181,6 +207,21 @@ jobs:
tar -xzf ~/castxml-ubuntu-22.04-x86_64.tar.gz -C ~/
chmod +x ~/castxml/bin/castxml

# ─── Setup CastXML for Linux aarch64 ──────────────────────────────
- name: Setup CastXML for Linux aarch64 (Ubuntu 24.04)
if: matrix.os == 'ubuntu-24.04-arm' && matrix.arch == 'aarch64'
run: |
wget -q -O ~/castxml-ubuntu-24.04-arm-aarch64.tar.gz https://github.com/CastXML/CastXMLSuperbuild/releases/download/v0.6.11.post2/castxml-ubuntu-24.04-arm-aarch64.tar.gz
tar -xzf ~/castxml-ubuntu-24.04-arm-aarch64.tar.gz -C ~/
chmod +x ~/castxml/bin/castxml

- name: Setup CastXML for Linux aarch64 (Ubuntu 22.04)
if: matrix.os == 'ubuntu-22.04-arm' && matrix.arch == 'aarch64'
run: |
wget -q -O ~/castxml-ubuntu-22.04-arm-aarch64.tar.gz https://github.com/CastXML/CastXMLSuperbuild/releases/download/v0.6.11.post2/castxml-ubuntu-22.04-arm-aarch64.tar.gz
tar -xzf ~/castxml-ubuntu-22.04-arm-aarch64.tar.gz -C ~/
chmod +x ~/castxml/bin/castxml

# ─── Setup CastXML for MacOS ──────────────────────────────
- name: Setup CastXML for macOS (arm64)
if: matrix.os == 'macos-15'
Expand Down
28 changes: 21 additions & 7 deletions src/pygccxml/parser/project_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,12 @@ def __parse_all_at_once(self, files):
header_content.append(
'#include "%s" %s' %
(header, os.linesep))
return self.read_string(''.join(header_content))
declarations = self.read_string(''.join(header_content))
declarations = self._join_top_namespaces(declarations, [])
for ns in declarations:
if isinstance(ns, pygccxml.declarations.namespace_t):
declarations_joiner.join_declarations(ns)
return declarations

def read_string(self, content):
"""Parse a string containing C/C++ source code.
Expand Down Expand Up @@ -420,15 +425,24 @@ def read_xml(self, file_configuration):
def _join_top_namespaces(main_ns_list, other_ns_list):
answer = main_ns_list[:]
for other_ns in other_ns_list:
main_ns = pygccxml.declarations.find_declaration(
same_name_namespaces = pygccxml.declarations.find_all_declarations(
answer,
decl_type=pygccxml.declarations.namespace_t,
name=other_ns._name,
recursive=False)
if main_ns:
main_ns.take_parenting(other_ns)
else:
name=other_ns.name,
parent=None, # top-level only
recursive=False
)
if len(same_name_namespaces) == 0:
answer.append(other_ns)
elif len(same_name_namespaces) == 1:
same_name_namespaces[0].take_parenting(other_ns)
else:
primary_ns = same_name_namespaces[0]
for extra_ns in same_name_namespaces[1:]:
primary_ns.take_parenting(extra_ns)
answer.remove(extra_ns)
# then unify the new other_ns
primary_ns.take_parenting(other_ns)
return answer

@staticmethod
Expand Down