mirror of
git://git.sv.nongnu.org/freetype/freetype2.git
synced 2026-01-19 04:52:09 +00:00
[build] Revise visibility attributes usage in autotools and CMake.
* CMakeLists.txt: Set `C_VISIBILITY_PRESET` to hidden for non-Windows only. Windows handles exports with `DLL_EXPORT` defined, and old MinGW toolchains emit a lot of warnings about visibility attributes not being supported in this configuration. * build/unix/configure.raw: Revise visibility attributes checks by compiling a better test program with `-Werror` in `CFLAGS` so that warnings correctly indicate unsupported configurations.
This commit is contained in:
committed by
Werner Lemberg
parent
81f839a7d9
commit
5bc2081741
@@ -489,10 +489,6 @@ add_library(freetype
|
||||
${BASE_SRCS}
|
||||
)
|
||||
|
||||
set_target_properties(
|
||||
freetype PROPERTIES
|
||||
C_VISIBILITY_PRESET hidden)
|
||||
|
||||
target_compile_definitions(
|
||||
freetype PRIVATE FT2_BUILD_LIBRARY)
|
||||
|
||||
@@ -503,6 +499,10 @@ if (WIN32)
|
||||
target_compile_definitions(
|
||||
freetype PRIVATE DLL_EXPORT)
|
||||
endif ()
|
||||
else ()
|
||||
# Windows handles exports with DLL_EXPORT defined above.
|
||||
set_target_properties(freetype PROPERTIES
|
||||
C_VISIBILITY_PRESET hidden)
|
||||
endif ()
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
|
||||
Reference in New Issue
Block a user