[vlc-commits] [Git][videolan/vlc][master] contrib: use the variables similar to emcmake for emscripten

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Sep 21 12:30:18 UTC 2022



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
0c4307e6 by Steve Lhomme at 2022-09-21T11:09:37+00:00
contrib: use the variables similar to emcmake for emscripten

emcmake is supposed to be used with CMake and emscripten [1] and it uses a
toolchain file for that [2]. But we already have our own with more things. So let's
use the same toolchain file in [3] which may overwrite some of our own values with
the ones that are expected for CMake emscripten.

This should allow CheckTypeSize and TestBigEndian tests to work properly.

[1] https://badlydrawnrod.github.io/posts/2020/05/19/emcmake-with-emscripten/
[2] https://github.com/emscripten-core/emscripten/blob/main/emcmake.py
[3] https://github.com/emscripten-core/emscripten/blob/main/cmake/Modules/Platform/Emscripten.cmake

- - - - -


1 changed file:

- contrib/src/main.mak


Changes:

=====================================
contrib/src/main.mak
=====================================
@@ -637,6 +637,8 @@ CMAKE_SYSTEM_NAME = Darwin
 endif
 ifdef HAVE_EMSCRIPTEN
 CMAKE_SYSTEM_NAME = Emscripten
+EMCMAKE_PATH := $(shell command -v emcmake)
+EMSDK_PATH := $(dir $(EMCMAKE_PATH))
 endif
 
 ifdef HAVE_ANDROID
@@ -694,8 +696,7 @@ ifdef HAVE_CROSS_COMPILE
 	echo "set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)" >> $@
 endif
 ifdef HAVE_EMSCRIPTEN
-	# https://github.com/emscripten-core/emscripten/blob/main/cmake/Modules/Platform/Emscripten.cmake#L268
-	echo "set(EMSCRIPTEN 1)" >> $@
+	echo "include($(EMSDK_PATH)cmake/Modules/Platform/Emscripten.cmake)" >> $@
 endif
 
 MESON_SYSTEM_NAME =



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0c4307e6fe270db02830ad219d0fb54aff64383a

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0c4307e6fe270db02830ad219d0fb54aff64383a
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list