Skip to content

Commit b82168e

Browse files
authored
[cmake] Re-enable EMSCRIPTEN_FORCE_COMPILERS by default (#24223)
This effectively reverts #23537 Fixes: #23944
1 parent 70404ef commit b82168e

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ See docs/process.md for more on how version tagging works.
2626
network requests. (#24163, #24190)
2727
- Closure arguments can now be used from ports using `settings.CLOSURE_ARGS`
2828
(#24192)
29+
- When using cmake the EMSCRIPTEN_FORCE_COMPILERS setting was reverted to
30+
being on by default due to issues that were found with disabling it. (#24223)
2931

3032
4.0.7 - 04/15/25
3133
----------------

cmake/Modules/Platform/Emscripten.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,11 @@ endif()
121121
file(TO_CMAKE_PATH "${_emcache_output}" _emcache_output)
122122
set(EMSCRIPTEN_SYSROOT "${_emcache_output}/sysroot")
123123

124-
# Allow skipping of CMake compiler autodetection, since this is quite slow with
125-
# Emscripten. Pass -DEMSCRIPTEN_FORCE_COMPILERS=ON to enable
126-
option(EMSCRIPTEN_FORCE_COMPILERS "Force C/C++ compiler" OFF)
124+
# Allow skipping of CMake compiler autodetection. On by default since this is
125+
# quite slow with Emscripten and also leads to issues with
126+
# CMAKE_C_IMPLICIT_LINK_LIBRARIES.
127+
# See https://github.com/emscripten-core/emscripten/issues/23944
128+
option(EMSCRIPTEN_FORCE_COMPILERS "Force C/C++ compiler" ON)
127129
if (EMSCRIPTEN_FORCE_COMPILERS)
128130

129131
# Detect version of the 'emcc' executable. Note that for CMake, we tell it the

test/test_other.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ def test_cmake(self, test_dir, output_file, cmake_args):
920920
@no_windows('Skipped on Windows because CMake does not configure native Clang builds well on Windows.')
921921
@parameterized({
922922
'': ([],),
923-
'force': (['-DEMSCRIPTEN_FORCE_COMPILERS=ON'],),
923+
'noforce': (['-DEMSCRIPTEN_FORCE_COMPILERS=OFF'],),
924924
})
925925
def test_cmake_compile_features(self, args):
926926
os.mkdir('build_native')
@@ -979,7 +979,7 @@ def test_cmake_bitcode_static_libraries(self):
979979
@crossplatform
980980
@parameterized({
981981
'': ([],),
982-
'force': (['-DEMSCRIPTEN_FORCE_COMPILERS=ON'],),
982+
'noforce': (['-DEMSCRIPTEN_FORCE_COMPILERS=OFF'],),
983983
})
984984
def test_cmake_compile_commands(self, args):
985985
self.run_process([EMCMAKE, 'cmake', test_file('cmake/static_lib'), '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON'] + args)

0 commit comments

Comments
 (0)