summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlo Marcelo Arenas Belón <carenas@gmail.com>2024-06-11 03:17:40 (GMT)
committerCarlo Marcelo Arenas Belón <carenas@gmail.com>2024-06-12 10:05:28 (GMT)
commit8a33068afe80b029466f9bf8afba4214979dc23a (patch)
tree27625b24f62e068fd52c3d234de6a7a074b8c1c3
parent3f7493de72251f3dac721f960456ea474f15a330 (diff)
downloadCMake-8a33068afe80b029466f9bf8afba4214979dc23a.zip
CMake-8a33068afe80b029466f9bf8afba4214979dc23a.tar.gz
CMake-8a33068afe80b029466f9bf8afba4214979dc23a.tar.bz2
visibility: add support for Oracle Developer Studio 12.6
While an `-fvisibility` flag was added in the previous version, it throws warnings indicating it would be ignored unless given to the linker and fails to work properly. Tested on Solaris 11.3 SPARC and Solaris 11.4 x86/SPARC.
-rw-r--r--Modules/Compiler/SunPro-C.cmake4
-rw-r--r--Modules/Compiler/SunPro-CXX.cmake4
2 files changed, 8 insertions, 0 deletions
diff --git a/Modules/Compiler/SunPro-C.cmake b/Modules/Compiler/SunPro-C.cmake
index 7b4478c..35dbdcd 100644
--- a/Modules/Compiler/SunPro-C.cmake
+++ b/Modules/Compiler/SunPro-C.cmake
@@ -65,5 +65,9 @@ endif()
__compiler_check_default_language_standard(C 5.11 90 5.14 11)
+if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.15)
+ set(CMAKE_C_COMPILE_OPTIONS_VISIBILITY "-fvisibility=")
+endif()
+
set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake
index 1db6aa7..33ce9fc 100644
--- a/Modules/Compiler/SunPro-CXX.cmake
+++ b/Modules/Compiler/SunPro-CXX.cmake
@@ -69,3 +69,7 @@ else()
endif()
__compiler_check_default_language_standard(CXX 1 98)
+
+if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 5.15)
+ set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY "-fvisibility=")
+endif()