Skip to content

Commit 1865325

Browse files
committed
Use unset in cmake toolchain file. NFC
The `unset` function is the set as calling `set` without a second argument but less confusing for the reader. See https://cmake.org/cmake/help/latest/command/set.html#set-normal-variable 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 1865325

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cmake/Modules/Platform/Emscripten.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,18 @@ 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

3839
# In CMake, CMAKE_HOST_WIN32 is set when we are cross-compiling from Win32 to
3940
# Emscripten:
4041
# http://www.cmake.org/cmake/help/v2.8.12/cmake.html#variable:CMAKE_HOST_WIN32
4142
# The variable WIN32 is set only when the target arch that will run the code
4243
# will be WIN32, so unset WIN32 when cross-compiling.
43-
set(WIN32)
44+
unset(WIN32)
4445

4546
# The same logic as above applies for APPLE and CMAKE_HOST_APPLE, so unset
4647
# APPLE.
47-
set(APPLE)
48+
unset(APPLE)
4849

4950
# And for UNIX and CMAKE_HOST_UNIX. However, Emscripten is often able to mimic
5051
# being a Linux/Unix system, in which case a lot of existing CMakeLists.txt
@@ -298,7 +299,7 @@ set(CMAKE_LINK_LIBRARY_USING_WHOLE_ARCHIVE_SUPPORTED True)
298299
# detect when building using Emscripten.
299300
set(EMSCRIPTEN 1 CACHE INTERNAL "If true, we are targeting Emscripten output.")
300301

301-
# Hardwire support for cmake-2.8/Modules/CMakeBackwardsCompatibilityC.cmake
302+
# Hardwire support for CMake/Modules/CMakeBackwardCompatibilityC.cmake
302303
# without having CMake to try complex things to autodetect these:
303304
set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
304305
set(CMAKE_SIZEOF_CHAR 1)
@@ -317,7 +318,6 @@ set(CMAKE_HAVE_SYS_PRCTL_H 1)
317318
set(CMAKE_WORDS_BIGENDIAN 0)
318319
set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN")
319320
set(CMAKE_CXX_BYTE_ORDER "LITTLE_ENDIAN")
320-
set(CMAKE_DL_LIBS)
321321

322322
function(em_validate_asmjs_after_build target)
323323
message(WARNING "em_validate_asmjs_after_build no longer exists")

0 commit comments

Comments
 (0)