summaryrefslogtreecommitdiff
path: root/expat
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2022-09-12 17:04:45 +0200
committerSebastian Pipping <sebastian@pipping.org>2022-09-12 17:07:14 +0200
commit107437adcd6af7611606e2260254fcc4feaef84a (patch)
tree018517895d940908e7a64a8fec40e2875dbc8a22 /expat
parentdde178b976934e16526a3277d31d9fa3fab7a6c1 (diff)
downloadlibexpat-git-107437adcd6af7611606e2260254fcc4feaef84a.tar.gz
Stop exporting API symbols when building a static library
Diffstat (limited to 'expat')
-rw-r--r--expat/CMakeLists.txt4
-rw-r--r--expat/Changes1
-rw-r--r--expat/configure.ac5
3 files changed, 7 insertions, 3 deletions
diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt
index 96acd39b..9702824b 100644
--- a/expat/CMakeLists.txt
+++ b/expat/CMakeLists.txt
@@ -296,7 +296,9 @@ if(FLAG_NO_STRICT_ALIASING)
set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -fno-strict-aliasing")
endif()
if(FLAG_VISIBILITY)
- add_definitions(-DXML_ENABLE_VISIBILITY=1)
+ if(EXPAT_SHARED_LIBS)
+ add_definitions(-DXML_ENABLE_VISIBILITY=1)
+ endif()
set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -fvisibility=hidden")
endif()
if(MINGW)
diff --git a/expat/Changes b/expat/Changes
index 43d5a102..dbb23c3b 100644
--- a/expat/Changes
+++ b/expat/Changes
@@ -27,6 +27,7 @@ Release x.x.x xxx xxxxx xx xxxx
context of public build time options to take need for
set(.. FORCE) in projects using Expat by means of
add_subdirectory(..) off Expat's users' shoulders
+ #626 #641 Stop exporting API symbols when building a static library
#620 CMake: Make documentation on variables a bit more consistent
#610 Address Cppcheck 2.8.1 warning
diff --git a/expat/configure.ac b/expat/configure.ac
index 48640256..0364c5fb 100644
--- a/expat/configure.ac
+++ b/expat/configure.ac
@@ -134,8 +134,9 @@ AS_CASE(["$LD"],[*clang*],
[*linux*],[archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'])])
EXPATCFG_COMPILER_SUPPORTS_VISIBILITY([
- AX_APPEND_FLAG([-fvisibility=hidden], [AM_CFLAGS])
- AX_APPEND_FLAG([-DXML_ENABLE_VISIBILITY=1], [AM_CPPFLAGS])])
+ AX_APPEND_FLAG([-fvisibility=hidden], [AM_CFLAGS])
+ AS_IF([test "${enable_shared}" = yes],
+ [AX_APPEND_FLAG([-DXML_ENABLE_VISIBILITY=1], [AM_CPPFLAGS])])])
dnl Checks for typedefs, structures, and compiler characteristics.