Skip to content

Commit a0d8515

Browse files
Don't strip name section in RelWithDebInfo builds (#198)
We meant to do this already, but in the move to CMake it got broken.
1 parent ea54ba9 commit a0d8515

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

cmake/binaryen.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ set(BINARYEN_URL https://github.com/WebAssembly/binaryen/releases/download/versi
99
CPMAddPackage(NAME binaryen URL ${BINARYEN_URL} DOWNLOAD_ONLY TRUE)
1010
set(BINARYEN_DIR ${CPM_PACKAGE_binaryen_SOURCE_DIR}/bin)
1111
set(WASM_OPT ${BINARYEN_DIR}/wasm-opt)
12+
13+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cxx-wrapper.in ${CMAKE_BINARY_DIR}/cxx-wrapper)
14+
set(CMAKE_CXX_COMPILER "${CMAKE_BINARY_DIR}/cxx-wrapper")

cmake/compile-flags.cmake

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ set(WASI 1)
22
set(CMAKE_CXX_STANDARD 20)
33
add_compile_definitions("$<$<CONFIG:DEBUG>:DEBUG=1>")
44

5-
# NOTE: we shadow wasm-opt by adding $(CMAKE_CURRENT_SOURCE_DIR)/scripts to the path, which
6-
# includes a script called wasm-opt that immediately exits successfully. See
7-
# that script for more information about why we do this.
8-
set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}/scripts:$ENV{PATH}")
9-
105
list(APPEND CMAKE_EXE_LINKER_FLAGS
116
-Wl,-z,stack-size=1048576 -Wl,--stack-first
127
-mexec-model=reactor

scripts/cxx-wrapper.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
# Clang doesn't support overriding where wasm-opt is found, and CMake doesn't allow overriding
4+
# $PATH for linker/compiler invocations. So we use this script to modify $PATH, and
5+
# scripts/wasm-opt to hide the real wasm-opt from clang.
6+
PATH="${CMAKE_CURRENT_SOURCE_DIR}/scripts:$PATH" ${CMAKE_CXX_COMPILER} "$@"

0 commit comments

Comments
 (0)