mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-23 09:04:21 +00:00
toolchain: Avoid using system headers on later (lib-)clang (#767)
This commit is contained in:
parent
da1ecd03de
commit
0904a18cc3
2
.github/workflows/compile-check.yml
vendored
2
.github/workflows/compile-check.yml
vendored
|
|
@ -51,7 +51,7 @@ jobs:
|
|||
key: tools_libs
|
||||
path: |
|
||||
toolchain/bin
|
||||
toolchain/include
|
||||
toolchain/libcxx-include
|
||||
toolchain/cache-version-url.txt
|
||||
- name: Run setup
|
||||
run: tools/setup.py smo-main.nso
|
||||
|
|
|
|||
2
.github/workflows/test-compile.yml
vendored
2
.github/workflows/test-compile.yml
vendored
|
|
@ -26,7 +26,7 @@ jobs:
|
|||
key: tools_libs
|
||||
path: |
|
||||
toolchain/bin
|
||||
toolchain/include
|
||||
toolchain/libcxx-include
|
||||
toolchain/cache-version-url.txt
|
||||
- name: Run simplified setup
|
||||
run: tools/setup.py --project
|
||||
|
|
|
|||
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -50,6 +50,8 @@ perf.data.old
|
|||
|
||||
# Tooling
|
||||
/toolchain/clang-*
|
||||
!/toolchain/clang-include
|
||||
toolchain/libcxx-include
|
||||
toolchain/include
|
||||
toolchain/cache-version-url.txt
|
||||
tools/check
|
||||
|
|
|
|||
|
|
@ -47,6 +47,13 @@ add_compile_options(-fPIC)
|
|||
# Helps with matching as this causes Clang to emit debug type info even for dynamic classes
|
||||
# with undefined vtables.
|
||||
add_compile_options(-fstandalone-debug)
|
||||
# avoids reading system-wide headers on later clang versions (for example linter's libclang)
|
||||
add_compile_options(--gcc-toolchain=/nonexistant)
|
||||
# after all other includes, use fallback clang headers
|
||||
# => applied only when building this project normally, using system-wide (lib-)clang will use its own
|
||||
add_compile_options(-idirafter ${CMAKE_CURRENT_LIST_DIR}/clang-include)
|
||||
# custom libc++, provided in combination with clang-3.9.1
|
||||
include_directories(SYSTEM ${CMAKE_CURRENT_LIST_DIR}/libcxx-include)
|
||||
|
||||
add_definitions(-D SWITCH)
|
||||
add_definitions(-D NNSDK)
|
||||
|
|
@ -56,5 +63,3 @@ add_link_options(-stdlib=libc++ -nostdlib)
|
|||
add_link_options(-fPIC -Wl,-Bsymbolic-functions -shared)
|
||||
# Use lld for performance reasons (and because we don't want a dependency on GNU tools)
|
||||
add_link_options(-fuse-ld=${ODYSSEY_CLANG_LLD})
|
||||
|
||||
include_directories(SYSTEM ${CMAKE_CURRENT_LIST_DIR}/include)
|
||||
|
|
|
|||
|
|
@ -126,14 +126,18 @@ def setup_project_tools(tools_from_source):
|
|||
os.symlink(f"{get_repo_root()}/toolchain/bin/listsym", f"{get_repo_root()}/tools/listsym")
|
||||
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
if not exists_toolchain_file("include/__config"):
|
||||
if exists_toolchain_file("include/__config"): # old path to libcxx headers => moved to `libcxx-include`
|
||||
print("Removing old libc++ headers...")
|
||||
shutil.rmtree(f"{get_repo_root()}/toolchain/include")
|
||||
|
||||
if not exists_toolchain_file("libcxx-include/__config"):
|
||||
print(">>> Downloading llvm-3.9 libc++ headers...")
|
||||
path = tmpdir + "/libcxx-3.9.1.src.tar.xz"
|
||||
urllib.request.urlretrieve(LIBCXX_SRC_URL, path)
|
||||
print(">>> Extracting libc++ headers...")
|
||||
with tarfile.open(path) as f:
|
||||
f.extractall(tmpdir, filter='tar')
|
||||
shutil.copytree(f"{tmpdir}/libcxx-3.9.1.src/include", f"{get_repo_root()}/toolchain/include", dirs_exist_ok=True)
|
||||
shutil.copytree(f"{tmpdir}/libcxx-3.9.1.src/include", f"{get_repo_root()}/toolchain/libcxx-include", dirs_exist_ok=True)
|
||||
|
||||
if not exists_tool("check") or not exists_tool("decompme") or not exists_tool("listsym") or not exists_toolchain_file("bin/clang") or not exists_toolchain_file("bin/ld.lld"):
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue