Skip to content

Commit

Permalink
Bump cmake version to 3.27 and fix headless linking to GLEW (#1762)
Browse files Browse the repository at this point in the history
* fix source file names in cmake

* bump cmake version to 3.27

* make lua link GLEW compile-only, preventing linking to the actual lib
  • Loading branch information
n-morales authored Nov 11, 2024
1 parent 38a5ded commit 5a05d4f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
20 changes: 10 additions & 10 deletions AI/Wrappers/LegacyCpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ if (BUILD_${myName}_AIWRAPPER)

# Assemble the Legacy C++ AI sources
set(mySources
"${mySourceDir}/AIAI"
"${mySourceDir}/AIAICallback"
"${mySourceDir}/AIAICheats"
"${mySourceDir}/AIGlobalAICallback"
"${mySourceDir}/DamageArray"
"${mySourceDir}/MoveData"
"${mySourceDir}/UnitDef"
"${rts}/ExternalAI/AISCommands"
"${rts}/Sim/Units/CommandAI/Command"
"${rts}/System/float3"
"${mySourceDir}/AIAI.cpp"
"${mySourceDir}/AIAICallback.cpp"
"${mySourceDir}/AIAICheats.cpp"
"${mySourceDir}/AIGlobalAICallback.cpp"
"${mySourceDir}/DamageArray.cpp"
"${mySourceDir}/MoveData.cpp"
"${mySourceDir}/UnitDef.cpp"
"${rts}/ExternalAI/AISCommands.cpp"
"${rts}/Sim/Units/CommandAI/Command.cpp"
"${rts}/System/float3.cpp"
${ai_common_SRC}
)

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.27)
cmake_policy(SET CMP0060 OLD) #causes link errors on Linux otherwise
cmake_policy(SET CMP0065 OLD) #we need binaries compiled with -rdynamic for BARb to work (cause unknown https://github.com/beyond-all-reason/spring/issues/405)

Expand Down
2 changes: 1 addition & 1 deletion rts/build/cmake/ConfigureVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# )
#

cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.27)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_MODULES_SPRING}")

Expand Down
2 changes: 1 addition & 1 deletion rts/lib/lua/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ else ()
TARGET_LINK_LIBRARIES(lua)
endif ()

target_link_libraries(lua GLEW::GLEW)
target_link_libraries(lua $<COMPILE_ONLY:GLEW::GLEW>)
target_include_directories(lua PUBLIC include)

if (UNIX)
Expand Down
6 changes: 3 additions & 3 deletions rts/lib/minizip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ else (MINIZIP_FOUND)
# Build our own minizip library

set(miniZipSources
"unzip"
"zip"
"ioapi"
"unzip.c"
"zip.c"
"ioapi.c"
)

add_definitions(-DNOCRYPT -DNOUNCRYPT)
Expand Down
2 changes: 1 addition & 1 deletion tools/dirchange/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")

add_executable(dirchange EXCLUDE_FROM_ALL dirchange)
add_executable(dirchange EXCLUDE_FROM_ALL dirchange.cpp)
set_target_properties(dirchange PROPERTIES OUTPUT_NAME "dch")

0 comments on commit 5a05d4f

Please sign in to comment.