Skip to content

Commit 9c91cbf

Browse files
authoredJan 29, 2021
Handle changes caused by CMake minimum version bump (#10859)
fixes #10806
1 parent 5c005ad commit 9c91cbf

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed
 

Diff for: ‎CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
cmake_minimum_required(VERSION 3.5)
22

3+
cmake_policy(SET CMP0025 OLD)
4+
35
# This can be read from ${PROJECT_NAME} after project() is called
46
project(minetest)
57
set(PROJECT_NAME_CAPITALIZED "Minetest")

Diff for: ‎src/CMakeLists.txt

+19-6
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin")
532532
if(BUILD_CLIENT)
533533
add_executable(${PROJECT_NAME} ${client_SRCS} ${extra_windows_SRCS})
534534
add_dependencies(${PROJECT_NAME} GenerateVersion)
535-
set(client_LIBS
535+
target_link_libraries(
536536
${PROJECT_NAME}
537537
${ZLIB_LIBRARIES}
538538
${IRRLICHT_LIBRARY}
@@ -548,9 +548,14 @@ if(BUILD_CLIENT)
548548
${PLATFORM_LIBS}
549549
${CLIENT_PLATFORM_LIBS}
550550
)
551-
target_link_libraries(
552-
${client_LIBS}
553-
)
551+
if(NOT USE_LUAJIT)
552+
set_target_properties(${PROJECT_NAME} PROPERTIES
553+
# This is necessary for dynamic Lua modules
554+
# to work when Lua is statically linked (issue #10806)
555+
ENABLE_EXPORTS 1
556+
)
557+
endif()
558+
554559
if(ENABLE_GLES)
555560
target_link_libraries(
556561
${PROJECT_NAME}
@@ -621,7 +626,15 @@ if(BUILD_SERVER)
621626
${PLATFORM_LIBS}
622627
)
623628
set_target_properties(${PROJECT_NAME}server PROPERTIES
624-
COMPILE_DEFINITIONS "SERVER")
629+
COMPILE_DEFINITIONS "SERVER")
630+
if(NOT USE_LUAJIT)
631+
set_target_properties(${PROJECT_NAME}server PROPERTIES
632+
# This is necessary for dynamic Lua modules
633+
# to work when Lua is statically linked (issue #10806)
634+
ENABLE_EXPORTS 1
635+
)
636+
endif()
637+
625638
if (USE_GETTEXT)
626639
target_link_libraries(${PROJECT_NAME}server ${GETTEXT_LIBRARY})
627640
endif()
@@ -666,7 +679,7 @@ option(APPLY_LOCALE_BLACKLIST "Use a blacklist to avoid broken locales" TRUE)
666679
if (GETTEXTLIB_FOUND AND APPLY_LOCALE_BLACKLIST)
667680
set(GETTEXT_USED_LOCALES "")
668681
foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES})
669-
if (NOT ";${GETTEXT_BLACKLISTED_LOCALES};" MATCHES ";${LOCALE};")
682+
if (NOT "${LOCALE}" IN_LIST GETTEXT_BLACKLISTED_LOCALES)
670683
list(APPEND GETTEXT_USED_LOCALES ${LOCALE})
671684
endif()
672685
endforeach()

0 commit comments

Comments
 (0)
Please sign in to comment.