svn commit: r1919323 - /subversion/branches/cmake/CMakeLists.txt

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <[email protected]>
Author: rinrab
Date: Wed Jul 17 19:20:31 2024
New Revision: 1919323

URL: http://svn.apache.org/viewvc?rev=1919323&view=rev
Log:
On the 'cmake' branch: Correctly setup position independent code.

Set CMAKE_POSITION_INDEPENDENT_CODE option to ON if there are shared any
shared libraries. This adds -fpic option on Linux and fixes a problem with
svn_ctype_table. Suggested on dev@ at [1].

* CMakeLists.txt
  (): Set CMAKE_POSITION_INDEPENDENT_CODE to ON for if there are shared libs.

[1] https://lists.apache.org/thread/1mpqrt98owsxoj13rmqlo1m8r0ll9cxv

Modified:
    subversion/branches/cmake/CMakeLists.txt

Modified: subversion/branches/cmake/CMakeLists.txt
URL: http://svn.apache.org/viewvc/subversion/branches/cmake/CMakeLists.txt?rev=1919323&r1=1919322&r2=1919323&view=diff
==============================================================================
--- subversion/branches/cmake/CMakeLists.txt (original)
+++ subversion/branches/cmake/CMakeLists.txt Wed Jul 17 19:20:31 2024
@@ -141,6 +141,10 @@ if(SVN_BUILD_SHARED_RA)
   message(FATAL_ERROR "SVN_BUILD_SHARED_RA not yet supported")
 endif()
 
+if(BUILD_SHARED_LIBS OR SVN_BUILD_SHARED_FS OR SVN_BUILD_SHARED_RA)
+  set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+endif()
+
 # Setup modules path
 
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake")
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.