Skip to content
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

Replace DEFAULT_SYSROOT usage with Clang config files #503

Merged
merged 1 commit into from
Dec 12, 2024
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
1 change: 1 addition & 0 deletions clang.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--sysroot=<CFGDIR>/../share/wasi-sysroot
13 changes: 12 additions & 1 deletion cmake/wasi-sdk-toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ ExternalProject_Add(llvm-build
-DLLVM_DEFAULT_TARGET_TRIPLE=wasm32-wasi
-DLLVM_INSTALL_BINUTILS_SYMLINKS=TRUE
-DLLVM_ENABLE_LIBXML2=OFF
-DDEFAULT_SYSROOT=../share/wasi-sysroot
# Pass `-s` to strip symbols by default and shrink the size of the
# distribution
-DCMAKE_EXE_LINKER_FLAGS=-s
Expand Down Expand Up @@ -159,6 +158,18 @@ copy_misc_file(wasi-sdk-p1.cmake cmake)
copy_misc_file(wasi-sdk-p2.cmake cmake)
copy_misc_file(cmake/Platform/WASI.cmake cmake/Platform)

function(copy_cfg_file compiler)
set(dst ${wasi_tmp_install}/bin/${compiler}.cfg)
add_custom_command(
OUTPUT ${dst}
COMMAND cmake -E copy ${CMAKE_CURRENT_SOURCE_DIR}/clang.cfg ${dst})
add_custom_target(copy-${compiler} DEPENDS ${dst})
add_dependencies(misc-files copy-${compiler})
endfunction()

copy_cfg_file(clang)
copy_cfg_file(clang++)

include(wasi-sdk-dist)

# Figure out the name of the artifact which is either explicitly specified or
Expand Down
Loading