Skip to content

Commit

Permalink
Emscripten: properly set EMAR for Interprocedural Optimization.
Browse files Browse the repository at this point in the history
Co-authored-by: Vladimír Vondruš <[email protected]>
  • Loading branch information
Skylion007 and mosra committed Sep 3, 2023
1 parent d5d7430 commit 98bdb68
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions generic/Emscripten-wasm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ set(CMAKE_CXX_COMPILER "${EMSCRIPTEN_PREFIX}/em++${EMCC_SUFFIX}" CACHE FILEPATH
# some way but I didn't bother investigating further.
set(CMAKE_AR "${EMSCRIPTEN_PREFIX}/emar${EMCC_SUFFIX}" CACHE PATH "Path to Emscripten ar")
set(CMAKE_RANLIB "${EMSCRIPTEN_PREFIX}/emranlib${EMCC_SUFFIX}" CACHE PATH "Path to Emscripten ranlib")
# When CMAKE_INTERPROCEDURAL_OPTIMIZATION is set, CMake apparently uses these
# instead of CMAKE_AR and such. Couldn't find any official documentation on
# why, https://github.com/emscripten-core/emscripten/issues/11143 seems to be
# the only place mentioning this.
set(CMAKE_C_COMPILER_AR "${CMAKE_AR}")
set(CMAKE_CXX_COMPILER_AR "${CMAKE_AR}")
set(CMAKE_C_COMPILER_RANLIB "${CMAKE_RANLIB}")
set(CMAKE_CXX_COMPILER_RANLIB "${CMAKE_RANLIB}")

# Fetch Emscripten version, needed for the below setup. Taken from
# https://github.com/emscripten-core/emscripten/blob/74d6a15644e7f6e76ed6a1da9c6937b5cb7aef6e/cmake/Modules/Platform/Emscripten.cmake#L152
Expand Down

0 comments on commit 98bdb68

Please sign in to comment.