Another attempt at fixing Borland.

Apparently it still needs to be exported, but only declspec(deprecated)
does not work.
This commit is contained in:
Stephen Kelly 2011-08-10 22:19:39 +02:00
parent 50460ea9de
commit 7924c1d6a8
4 changed files with 17 additions and 8 deletions

View File

@ -160,10 +160,8 @@ macro(_DO_SET_MACRO_VALUES TARGET_LIBRARY)
if(NOT ${type} STREQUAL "STATIC_LIBRARY") if(NOT ${type} STREQUAL "STATIC_LIBRARY")
if(WIN32) if(WIN32)
if (NOT (${CMAKE_CXX_COMPILER_ID} MATCHES Borland))
set(DEFINE_EXPORT "__declspec(dllexport)") set(DEFINE_EXPORT "__declspec(dllexport)")
set(DEFINE_IMPORT "__declspec(dllimport)") set(DEFINE_IMPORT "__declspec(dllimport)")
endif()
elseif(COMPILER_HAS_HIDDEN_VISIBILITY AND USE_COMPILER_HIDDEN_VISIBILITY) elseif(COMPILER_HAS_HIDDEN_VISIBILITY AND USE_COMPILER_HIDDEN_VISIBILITY)
set(DEFINE_EXPORT "__attribute__((visibility(\"default\")))") set(DEFINE_EXPORT "__attribute__((visibility(\"default\")))")
set(DEFINE_IMPORT "__attribute__((visibility(\"default\")))") set(DEFINE_IMPORT "__attribute__((visibility(\"default\")))")

View File

@ -17,7 +17,12 @@ endmacro()
static_variant_build_pass("return libshared_and_static_exported();" "Failed to build static variant") static_variant_build_pass("return libshared_and_static_exported();" "Failed to build static variant")
shared_variant_build_pass("return libshared_and_static_exported();" "Failed to build shared variant") shared_variant_build_pass("return libshared_and_static_exported();" "Failed to build shared variant")
if (NOT ${CMAKE_CXX_COMPILER_ID} MATCHES Borland)
shared_variant_build_fail("return libshared_and_static_deprecated();" "Built shared deprecated variant") shared_variant_build_fail("return libshared_and_static_deprecated();" "Built shared deprecated variant")
static_variant_build_fail("return libshared_and_static_deprecated();" "Built static deprecated variant") static_variant_build_fail("return libshared_and_static_deprecated();" "Built static deprecated variant")
else()
shared_variant_build_pass("return libshared_and_static_deprecated();" "Built shared deprecated variant")
static_variant_build_pass("return libshared_and_static_deprecated();" "Built static deprecated variant")
endif()
static_variant_build_pass("return libshared_and_static_not_exported();" "Failed to build static not exported variant") static_variant_build_pass("return libshared_and_static_not_exported();" "Failed to build static not exported variant")
shared_variant_build_fail("return libshared_and_static_not_exported();" "Built shared not exported variant") shared_variant_build_fail("return libshared_and_static_not_exported();" "Built shared not exported variant")

View File

@ -9,7 +9,11 @@ endmacro()
shared_build_pass("Libshared l; return l.libshared_exported();" "Failed to build exported") shared_build_pass("Libshared l; return l.libshared_exported();" "Failed to build exported")
if (NOT ${CMAKE_CXX_COMPILER_ID} MATCHES Borland)
shared_build_fail("Libshared l; return l.libshared_deprecated();" "Built use of deprecated class method. This should not be possible.") shared_build_fail("Libshared l; return l.libshared_deprecated();" "Built use of deprecated class method. This should not be possible.")
else()
shared_build_pass("Libshared l; return l.libshared_deprecated();" "Built use of deprecated class method. This should not be possible.")
endif()
if (COMPILER_HAS_HIDDEN_VISIBILITY) if (COMPILER_HAS_HIDDEN_VISIBILITY)
shared_build_fail("Libshared l; return l.libshared_excluded();" "Built use of excluded class method. This should not be possible.") shared_build_fail("Libshared l; return l.libshared_excluded();" "Built use of excluded class method. This should not be possible.")
else() else()

View File

@ -9,5 +9,7 @@ endmacro()
static_build_pass("Libstatic l; return l.libstatic_exported();" "Failed to build exported.") static_build_pass("Libstatic l; return l.libstatic_exported();" "Failed to build exported.")
if (NOT ${CMAKE_CXX_COMPILER_ID} MATCHES Borland)
static_build_fail("Libstatic l; return l.libstatic_deprecated();" "Built use of deprecated class method. This should not be possible.") static_build_fail("Libstatic l; return l.libstatic_deprecated();" "Built use of deprecated class method. This should not be possible.")
endif()
static_build_fail("libstatic_deprecated();" "Built use of deprecated function. This should not be possible.") static_build_fail("libstatic_deprecated();" "Built use of deprecated function. This should not be possible.")