diff --git a/CMake/TdSetUpCompiler.cmake b/CMake/TdSetUpCompiler.cmake index 62013f52a..b31c7f049 100644 --- a/CMake/TdSetUpCompiler.cmake +++ b/CMake/TdSetUpCompiler.cmake @@ -60,6 +60,8 @@ function(td_set_up_compiler) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections") if (CMAKE_SYSTEM_NAME STREQUAL "SunOS") set(TD_LINKER_FLAGS "-Wl,-z,ignore") + elseif (EMSCRIPTEN) + set(TD_LINKER_FLAGS "-Wl,--gc-sections") else() set(TD_LINKER_FLAGS "-Wl,--gc-sections -Wl,--exclude-libs,ALL") endif()