diff --git a/Makefile b/Makefile index 89eee63..426df1d 100644 --- a/Makefile +++ b/Makefile @@ -99,6 +99,7 @@ build/compiler-rt.BUILT: build/llvm.BUILT build/wasi-libc.BUILT # Do the build, and install it. mkdir -p build/compiler-rt cd build/compiler-rt && cmake -G Ninja \ + -DCMAKE_SYSROOT=$(BUILD_PREFIX)/share/wasi-sysroot \ -DCMAKE_C_COMPILER_WORKS=ON \ -DCMAKE_CXX_COMPILER_WORKS=ON \ -DCMAKE_AR=$(BUILD_PREFIX)/bin/ar \ @@ -112,7 +113,7 @@ build/compiler-rt.BUILT: build/llvm.BUILT build/wasi-libc.BUILT -DCOMPILER_RT_ENABLE_IOS=OFF \ -DCOMPILER_RT_DEFAULT_TARGET_ONLY=On \ -DWASI_SDK_PREFIX=$(BUILD_PREFIX) \ - -DCMAKE_C_FLAGS="$(DEBUG_PREFIX_MAP) --sysroot=$(BUILD_PREFIX)/share/wasi-sysroot" \ + -DCMAKE_C_FLAGS="$(DEBUG_PREFIX_MAP)" \ -DLLVM_CONFIG_PATH=$(ROOT_DIR)/build/llvm/bin/llvm-config \ -DCOMPILER_RT_OS_DIR=wasi \ -DCMAKE_INSTALL_PREFIX=$(PREFIX)/lib/clang/$(CLANG_VERSION)/ \ @@ -154,10 +155,11 @@ build/libcxx.BUILT: build/llvm.BUILT build/compiler-rt.BUILT build/wasi-libc.BUI # Do the build. mkdir -p build/libcxx cd build/libcxx && cmake -G Ninja $(LIBCXX_CMAKE_FLAGS) \ - -DCMAKE_C_FLAGS="$(DEBUG_PREFIX_MAP) --sysroot=$(BUILD_PREFIX)/share/wasi-sysroot" \ - -DCMAKE_CXX_FLAGS="$(DEBUG_PREFIX_MAP) --sysroot=$(BUILD_PREFIX)/share/wasi-sysroot" \ - -DLIBCXX_LIBDIR_SUFFIX=$(ESCAPE_SLASH)/wasm32-wasi \ - $(LLVM_PROJ_DIR)/libcxx + -DCMAKE_SYSROOT=$(BUILD_PREFIX)/share/wasi-sysroot \ + -DCMAKE_C_FLAGS="$(DEBUG_PREFIX_MAP) \ + -DCMAKE_CXX_FLAGS="$(DEBUG_PREFIX_MAP) \ + -DLIBCXX_LIBDIR_SUFFIX=$(ESCAPE_SLASH)/wasm32-wasi \ + $(LLVM_PROJ_DIR)/libcxx ninja $(NINJA_FLAGS) -v -C build/libcxx # Do the install. DESTDIR=$(DESTDIR) ninja $(NINJA_FLAGS) -v -C build/libcxx install @@ -195,10 +197,11 @@ build/libcxxabi.BUILT: build/libcxx.BUILT build/llvm.BUILT # Do the build. mkdir -p build/libcxxabi cd build/libcxxabi && cmake -G Ninja $(LIBCXXABI_CMAKE_FLAGS) \ - -DCMAKE_C_FLAGS="$(DEBUG_PREFIX_MAP) --sysroot=$(BUILD_PREFIX)/share/wasi-sysroot" \ - -DCMAKE_CXX_FLAGS="$(DEBUG_PREFIX_MAP) --sysroot=$(BUILD_PREFIX)/share/wasi-sysroot" \ - -DLIBCXXABI_LIBDIR_SUFFIX=$(ESCAPE_SLASH)/wasm32-wasi \ - $(LLVM_PROJ_DIR)/libcxxabi + -DCMAKE_SYSROOT=$(BUILD_PREFIX)/share/wasi-sysroot \ + -DCMAKE_C_FLAGS="$(DEBUG_PREFIX_MAP) \ + -DCMAKE_CXX_FLAGS="$(DEBUG_PREFIX_MAP) \ + -DLIBCXXABI_LIBDIR_SUFFIX=$(ESCAPE_SLASH)/wasm32-wasi \ + $(LLVM_PROJ_DIR)/libcxxabi ninja $(NINJA_FLAGS) -v -C build/libcxxabi # Do the install. DESTDIR=$(DESTDIR) ninja $(NINJA_FLAGS) -v -C build/libcxxabi install