Skip to content

Commit

Permalink
Merge pull request #3042 from rouault/build_shared_libs_default_win32
Browse files Browse the repository at this point in the history
CMake: make BUILD_SHARED_LIBS=ON the default even on Windows
  • Loading branch information
rouault authored Feb 9, 2022
2 parents ca1ec7b + 0fd9cfb commit 021d6bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 3 additions & 2 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,15 @@ All cached entries can be viewed using ``cmake -LAH`` from a build directory.

.. option:: BUILD_SHARED_LIBS

Build PROJ library shared. Default for Windows is OFF, building only
a static library. Default for all others is ON. See also the CMake
Build PROJ library shared. Default is ON. See also the CMake
documentation for `BUILD_SHARED_LIBS
<https://cmake.org/cmake/help/v3.9/variable/BUILD_SHARED_LIBS.html>`_.

.. versionchanged:: 7.0
Renamed from ``BUILD_LIBPROJ_SHARED``

.. note:: before PROJ 9.0, the default was OFF for Windows builds.

.. option:: BUILD_TESTING=ON

CTest option to build the testing tree, which also downloads and installs
Expand Down
8 changes: 2 additions & 6 deletions src/lib_proj.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ message(STATUS "Configuring proj library:")
### SWITCH BETWEEN STATIC OR SHARED LIBRARY###
##############################################

# default config is shared, except static on Windows
set(BUILD_SHARED_LIBS_DEFAULT ON)
if(WIN32)
set(BUILD_SHARED_LIBS_DEFAULT OFF)
endif()
# default config is shared
option(BUILD_SHARED_LIBS
"Build PROJ library shared." ${BUILD_SHARED_LIBS_DEFAULT})
"Build PROJ library shared." ON)

option(USE_THREAD "Build libproj with thread/mutex support " ON)
if(NOT USE_THREAD)
Expand Down

0 comments on commit 021d6bb

Please sign in to comment.