Skip to content

Commit

Permalink
Fix CMake compilation for static libraries with IPO (emscripten-core#…
Browse files Browse the repository at this point in the history
  • Loading branch information
PJK136 committed May 14, 2020
1 parent cfd03f3 commit 3802859
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -470,3 +470,4 @@ a license to everyone to use it as detailed in LICENSE.)
* rssqian <[email protected]>
* Shachar Langbeheim <[email protected]>
* David Carlier <[email protected]>
* Paul Du <[email protected]> (copyright owned by ARSKAN)
13 changes: 13 additions & 0 deletions cmake/Modules/Platform/Emscripten.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,19 @@ if ("${CMAKE_RANLIB}" STREQUAL "")
set(CMAKE_RANLIB "${EMSCRIPTEN_ROOT_PATH}/emranlib${EMCC_SUFFIX}" CACHE FILEPATH "Emscripten ranlib")
endif()

if ("${CMAKE_C_COMPILER_AR}" STREQUAL "")
set(CMAKE_C_COMPILER_AR "${CMAKE_AR}")
endif()
if ("${CMAKE_CXX_COMPILER_AR}" STREQUAL "")
set(CMAKE_CXX_COMPILER_AR "${CMAKE_AR}")
endif()
if ("${CMAKE_C_COMPILER_RANLIB}" STREQUAL "")
set(CMAKE_C_COMPILER_RANLIB "${CMAKE_RANLIB}")
endif()
if ("${CMAKE_CXX_COMPILER_RANLIB}" STREQUAL "")
set(CMAKE_CXX_COMPILER_RANLIB "${CMAKE_RANLIB}")
endif()

# Don't allow CMake to autodetect the compiler, since it does not understand
# Emscripten.
# Pass -DEMSCRIPTEN_FORCE_COMPILERS=OFF to disable (sensible mostly only for
Expand Down

0 comments on commit 3802859

Please sign in to comment.