Skip to content

Commit 35f0ffc

Browse files
authored
Remove WIN32 and APPLE references from Emscripten.cmake. NFC (#25855)
Since we are the toolchain file we decide what to set and no other toolchain file should be setting these. We have tests that confirm that these are indeed not set. Also move the setting if `CMAKE_DL_LIBS` which it is not related to `CMakeBackwardCompatibilityC.cmake` (which also had a typo in the name).
1 parent ed2c0a2 commit 35f0ffc

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

cmake/Modules/Platform/Emscripten.cmake

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,10 @@ set(CMAKE_SYSTEM_PROCESSOR ${EMSCRIPTEN_SYSTEM_PROCESSOR})
3434
# This feature is activated if a shared library project has the property
3535
# SOVERSION defined.
3636
set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
37+
set(CMAKE_DL_LIBS "")
3738

38-
# In CMake, CMAKE_HOST_WIN32 is set when we are cross-compiling from Win32 to
39-
# Emscripten:
40-
# http://www.cmake.org/cmake/help/v2.8.12/cmake.html#variable:CMAKE_HOST_WIN32
41-
# The variable WIN32 is set only when the target arch that will run the code
42-
# will be WIN32, so unset WIN32 when cross-compiling.
43-
set(WIN32)
44-
45-
# The same logic as above applies for APPLE and CMAKE_HOST_APPLE, so unset
46-
# APPLE.
47-
set(APPLE)
48-
49-
# And for UNIX and CMAKE_HOST_UNIX. However, Emscripten is often able to mimic
50-
# being a Linux/Unix system, in which case a lot of existing CMakeLists.txt
51-
# files can be configured for Emscripten while assuming UNIX build, so this is
52-
# left enabled.
39+
# Emscripten has good enough Linux/Unix emualtion that it makes sense to set
40+
# UNIX by defaut.
5341
set(UNIX 1)
5442

5543
# Do a no-op access on the CMAKE_TOOLCHAIN_FILE variable so that CMake will not
@@ -298,7 +286,7 @@ set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED True)
298286
# detect when building using Emscripten.
299287
set(EMSCRIPTEN 1 CACHE INTERNAL "If true, we are targeting Emscripten output.")
300288

301-
# Hardwire support for cmake-2.8/Modules/CMakeBackwardsCompatibilityC.cmake
289+
# Hardwire support for CMake/Modules/CMakeBackwardCompatibilityC.cmake
302290
# without having CMake to try complex things to autodetect these:
303291
set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
304292
set(CMAKE_SIZEOF_CHAR 1)
@@ -317,7 +305,6 @@ set(CMAKE_HAVE_SYS_PRCTL_H 1)
317305
set(CMAKE_WORDS_BIGENDIAN 0)
318306
set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN")
319307
set(CMAKE_CXX_BYTE_ORDER "LITTLE_ENDIAN")
320-
set(CMAKE_DL_LIBS)
321308

322309
function(em_validate_asmjs_after_build target)
323310
message(WARNING "em_validate_asmjs_after_build no longer exists")

0 commit comments

Comments
 (0)