[vlc-commits] contrib: always set a CMAKE_SYSTEM_NAME when building for Windows

Steve Lhomme git at videolan.org
Thu Jun 18 18:31:48 CEST 2020


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Mar  6 08:42:58 2019 +0100| [c15ee010d49571debb0e6e6362316accb9a14a97] | committer: Steve Lhomme

contrib: always set a CMAKE_SYSTEM_NAME when building for Windows

(cherry picked from commit 1a58bd09f1392ae128b538620172c78a604b91fb) (rebased)

rebased:
- this branch already had RelWithDebInfo and the CXXFLAGS fix

Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=c15ee010d49571debb0e6e6362316accb9a14a97
---

 contrib/src/main.mak | 31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index e60af87bef..b6fe95401a 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -507,6 +507,22 @@ help:
 
 .PHONY: all fetch fetch-all install mostlyclean clean distclean package list help prebuilt
 
+CMAKE_SYSTEM_NAME =
+ifdef HAVE_WIN32
+CMAKE_SYSTEM_NAME = Windows
+ifdef HAVE_VISUALSTUDIO
+ifdef HAVE_WINSTORE
+CMAKE_SYSTEM_NAME = WindowsStore
+endif
+ifdef HAVE_WINDOWSPHONE
+CMAKE_SYSTEM_NAME = WindowsPhone
+endif
+endif
+endif
+ifdef HAVE_DARWIN_OS
+CMAKE_SYSTEM_NAME = Darwin
+endif
+
 # CMake toolchain
 toolchain.cmake:
 	$(RM) $@
@@ -516,24 +532,15 @@ else
 	echo "set(CMAKE_BUILD_TYPE RelWithDebInfo)" >> $@
 endif
 	echo "set(CMAKE_SYSTEM_PROCESSOR $(ARCH))" >> $@
+	if test -n "$(CMAKE_SYSTEM_NAME)"; then \
+		echo "set(CMAKE_SYSTEM_NAME $(CMAKE_SYSTEM_NAME))" >> $@; \
+	fi;
 ifdef HAVE_WIN32
-ifdef HAVE_VISUALSTUDIO
-ifdef HAVE_WINDOWSPHONE
-	echo "set(CMAKE_SYSTEM_NAME WindowsPhone)" >> $@
-else
-ifdef HAVE_WINSTORE
-	echo "set(CMAKE_SYSTEM_NAME WindowsStore)" >> $@
-else
-	echo "set(CMAKE_SYSTEM_NAME Windows)" >> $@
-endif
-endif
-endif
 ifdef HAVE_CROSS_COMPILE
 	echo "set(CMAKE_RC_COMPILER $(WINDRES))" >> $@
 endif
 endif
 ifdef HAVE_DARWIN_OS
-	echo "set(CMAKE_SYSTEM_NAME Darwin)" >> $@
 	echo "set(CMAKE_C_FLAGS \"$(CFLAGS) $(EXTRA_CFLAGS)\")" >> $@
 	echo "set(CMAKE_CXX_FLAGS \"$(CXXFLAGS) $(EXTRA_CXXFLAGS)\")" >> $@
 	echo "set(CMAKE_LD_FLAGS \"$(LDFLAGS)\")" >> $@



More information about the vlc-commits mailing list