Skip to content

Commit

Permalink
Add additional compiler flags for tvOS (#51241)
Browse files Browse the repository at this point in the history
We had those in the original mono/mono build.
  • Loading branch information
akoeplinger authored Apr 15, 2021
1 parent 2acee91 commit e254b56
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/libraries/Native/Unix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ if(CLR_CMAKE_TARGET_MACCATALYST)
endif()

if(CLR_CMAKE_TARGET_TVOS)
# with -fembed-bitcode passing -headerpad_max_install_names is not allowed so remove it from the CMake flags
string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_C_LINK_FLAGS ${CMAKE_C_LINK_FLAGS})
string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS})
string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
Expand Down
1 change: 1 addition & 0 deletions src/mono/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "tvOS")
set(HOST_IOS 1)
if(CMAKE_SYSTEM_NAME STREQUAL "tvOS")
set(HOST_TVOS 1)
# with -fembed-bitcode passing -headerpad_max_install_names is not allowed so remove it from the CMake flags
string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_C_LINK_FLAGS ${CMAKE_C_LINK_FLAGS})
string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS})
string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
Expand Down
11 changes: 7 additions & 4 deletions src/mono/mono.proj
Original file line number Diff line number Diff line change
Expand Up @@ -316,22 +316,25 @@
<_MonoCFLAGS Include="-I$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)/runtimes/$(TargetOS)-$(TargetArchitecture)/native/include" />
<_MonoCXXFLAGS Include="-Wl,-application_extension" />
</ItemGroup>
<!-- iOS simulator specific options -->
<ItemGroup Condition="'$(TargetsiOS)' == 'true' and '$(TargetsiOSSimulator)' == 'true'">
<!-- iOS/tvOS simulator specific options -->
<ItemGroup Condition="('$(TargetsiOS)' == 'true' and '$(TargetsiOSSimulator)' == 'true') or ('$(TargetstvOS)' == 'true' and '$(TargetstvOSSimulator)' == 'true')">
<_MonoCMakeArgs Include="-DENABLE_MINIMAL=shared_perfcounters"/>
</ItemGroup>
<!-- iOS device specific options -->
<ItemGroup Condition="'$(TargetsiOS)' == 'true' and '$(TargetsiOSSimulator)' != 'true'">
<!-- iOS/tvOS device specific options -->
<ItemGroup Condition="('$(TargetsiOS)' == 'true' and '$(TargetsiOSSimulator)' != 'true') or ('$(TargetstvOS)' == 'true' and '$(TargetstvOSSimulator)' != 'true')">
<_MonoCMakeArgs Include="-DENABLE_MINIMAL=jit,portability,logging,shared_perfcounters" />
<_MonoCMakeArgs Include="-DENABLE_VISIBILITY_HIDDEN=1"/>
<_MonoCMakeArgs Include="-DENABLE_LAZY_GC_THREAD_CREATION=1"/>
<_MonoCMakeArgs Include="-DENABLE_SIGALTSTACK=0"/>
<_MonoCFLAGS Include="-Werror=partial-availability" />
<_MonoCFLAGS Condition="'$(TargetstvOS)' == 'true'" Include="-fno-gnu-inline-asm" />
<_MonoCFLAGS Include="-fexceptions" />
<_MonoCPPFLAGS Include="-DSMALL_CONFIG" />
<_MonoCPPFLAGS Include="-D_XOPEN_SOURCE" />
<_MonoCPPFLAGS Include="-DHAVE_LARGE_FILE_SUPPORT=1" />
<_MonoCXXFLAGS Include="-Werror=partial-availability" />
<_MonoCXXFLAGS Condition="'$(TargetstvOS)' == 'true'" Include="-fno-gnu-inline-asm" />
<_MonoCXXFLAGS Include="-fexceptions" />
</ItemGroup>
<!-- Android specific options -->
<PropertyGroup Condition="'$(TargetsAndroid)' == 'true'">
Expand Down

0 comments on commit e254b56

Please sign in to comment.