File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -333,6 +333,10 @@ configure_package_config_file(
333333# TODO(umar): Disable for now. Causing issues with builds on windows.
334334#export(PACKAGE ArrayFire)
335335
336+ # Unset the visibility to avoid setting policy commands for older versions of
337+ # CMake for examples and tests.
338+ unset (CMAKE_CXX_VISIBILITY_PRESET)
339+
336340include (CTest )
337341
338342# Handle depricated BUILD_TEST variable if found.
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ macro(arrayfire_set_cmake_default_variables)
6868
6969 set (CMAKE_CXX_STANDARD 11)
7070 set (CMAKE_CXX_EXTENSIONS OFF )
71+ set (CMAKE_CXX_VISIBILITY_PRESET hidden)
7172
7273 # Set a default build type if none was specified
7374 if (NOT CMAKE_BUILD_TYPE )
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ endfunction()
115115
116116arrayfire_get_cuda_cxx_flags (cuda_cxx_flags )
117117if (NOT MSVC )
118- set (cuda_cxx_flags "${cuda_cxx_flags} -Xcompiler -fPIC" )
118+ set (cuda_cxx_flags "${cuda_cxx_flags} -Xcompiler -fPIC -Xcompiler= ${CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY} hidden " )
119119endif ()
120120
121121if (AF_WITH_NONFREE AND CMAKE_VERSION VERSION_LESS "3.7" )
You can’t perform that action at this time.
0 commit comments