Skip to content

Commit eb1ec0e

Browse files
authored
Merge pull request #4423 from OSGeo/backport-4422-to-9.6
[Backport 9.6] Build: make sure that BUILD_SHARED_LIBS is initialized before defining DEFAULT_EMBED_RESOURCE_FILES
2 parents 84cfcb3 + 93f47ed commit eb1ec0e

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@ include(ProjConfig)
156156
include(ProjMac)
157157
include(policies)
158158

159+
##############################################
160+
### SWITCH BETWEEN STATIC OR SHARED LIBRARY###
161+
##############################################
162+
163+
# default config is shared
164+
option(BUILD_SHARED_LIBS "Build PROJ library shared." ON)
165+
159166
################################################################################
160167
# Check for nlohmann_json
161168
################################################################################
@@ -368,6 +375,9 @@ function (is_sharp_embed_available res)
368375
endfunction()
369376

370377
is_sharp_embed_available(IS_SHARP_EMBED_AVAILABLE_RES)
378+
if (NOT DEFINED BUILD_SHARED_LIBS)
379+
message(FATAL_ERROR "BUILD_SHARED_LIBS should be set")
380+
endif()
371381
if (NOT BUILD_SHARED_LIBS)
372382
set(DEFAULT_EMBED_RESOURCE_FILES ON)
373383
else()

src/lib_proj.cmake

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
message(STATUS "Configuring proj library:")
22

3-
##############################################
4-
### SWITCH BETWEEN STATIC OR SHARED LIBRARY###
5-
##############################################
6-
7-
# default config is shared
8-
option(BUILD_SHARED_LIBS
9-
"Build PROJ library shared." ON)
10-
113
find_package(Threads QUIET)
124
if(Threads_FOUND AND CMAKE_USE_PTHREADS_INIT)
135
add_definitions(-DPROJ_HAS_PTHREADS)

0 commit comments

Comments
 (0)