[vlc-devel] [vlc-commits] contrib: only set the CMAKE_SYSTEM_NAME when building with MSVC

Steve Lhomme robux4 at ycbcr.xyz
Wed Mar 6 07:23:43 CET 2019


On 3/5/2019 6:00 PM, Hugo Beauzée-Luyssen wrote:
> On Tue, Mar 5, 2019, at 1:04 PM, Steve Lhomme wrote:
>> vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Mar  4
>> 13:17:51 2019 +0100| [828a65f3a1193d0e2e492c4139db5314b90a3b56] |
>> committer: Steve Lhomme
>>
>> contrib: only set the CMAKE_SYSTEM_NAME when building with MSVC
>>
>>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=828a65f3a1193d0e2e492c4139db5314b90a3b56
>> ---
>>
>>   contrib/src/main.mak | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/contrib/src/main.mak b/contrib/src/main.mak
>> index 34ff009dd6..b4610bbc02 100644
>> --- a/contrib/src/main.mak
>> +++ b/contrib/src/main.mak
>> @@ -495,6 +495,7 @@ else
>>   endif
>>   	echo "set(CMAKE_SYSTEM_PROCESSOR $(ARCH))" >> $@
>>   ifdef HAVE_WIN32
>> +ifdef HAVE_VISUALSTUDIO
>>   ifdef HAVE_WINDOWSPHONE
>>   	echo "set(CMAKE_SYSTEM_NAME WindowsPhone)" >> $@
>>   else
>> @@ -504,6 +505,7 @@ else
>>   	echo "set(CMAKE_SYSTEM_NAME Windows)" >> $@
>>   endif
>>   endif
>> +endif
>>   ifdef HAVE_CROSS_COMPILE
>>   	echo "set(CMAKE_RC_COMPILER $(WINDRES))" >> $@
>>   endif
>>
> Hi,
>
> This appears to break at least the harfbuzz build, and AFAIU CMAKE_SYSTEM_NAME is the designated way of specifying which system to build for, when cross compiling with cmake: https://cmake.org/cmake/help/v3.4/variable/CMAKE_SYSTEM_NAME.html

This is odd, I remember adding the WindowsPhone/WindowsStore because it 
was required when building with MSVC. CMake doesn't respect the 
environment it's called in, specifically on Windows. I didn't think it 
would affect other platforms. I'll try to use the Windows name outside 
of MSVC and see how it goes.


More information about the vlc-devel mailing list