Skip to content

Commit

Permalink
As native libraries (dlls on Windows) are no longer automatically unp…
Browse files Browse the repository at this point in the history
…acked and used from pk3s, unless the game is started with com_unpackLibraries enabled, we revert back to installing the dlls to the /EternalJK/ directory and no longer packing them into a pk3.
  • Loading branch information
taysta committed Nov 28, 2023
1 parent 77349ed commit f75fe7f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 41 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ set(MPDed "eternaljkded.${Architecture}")
set(MPGame "jampgame${Architecture}")
set(MPCGame "cgame${Architecture}")
set(MPUI "ui${Architecture}")
set(BinsPk3 "japro-win-${Architecture}.pk3")
# Library names
set(MPBotLib "botlib")
set(SharedLib "shared")
Expand Down
44 changes: 4 additions & 40 deletions codemp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -741,55 +741,19 @@ if(BuildMPDed)
target_link_libraries(${MPDed} ${MPDedLibraries})
endif(BuildMPDed)

set(GameLibsBuilt)
if(BuildMPGame)
set(GameLibsBuilt ${GameLibsBuilt} ${MPGame})
endif()

if(BuildMPCGame)
set(GameLibsBuilt ${GameLibsBuilt} ${MPCGame})
endif()

if(BuildMPUI)
set(GameLibsBuilt ${GameLibsBuilt} ${MPUI})
endif()

include(InstallZIP)
if(WIN32)
set(GameLibFullPaths)
if(MSVC)
foreach(GameLib ${GameLibsBuilt})
set(GameLibFullPaths
${GameLibFullPaths}
${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${GameLib}${CMAKE_SHARED_LIBRARY_SUFFIX})
endforeach(GameLib)
else()
foreach(GameLib ${GameLibsBuilt})
set(GameLibFullPaths
${GameLibFullPaths}
${CMAKE_BINARY_DIR}/${GameLib}${CMAKE_SHARED_LIBRARY_SUFFIX})
endforeach(GameLib)
endif()
add_zip_command(${BinsPk3}
FILES ${GameLibFullPaths}
DEPENDS "${GameLibsBuilt}")
add_custom_target(Bins
ALL
DEPENDS ${BinsPk3})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${BinsPk3}
DESTINATION "${JKAInstallDir}/EternalJK"
COMPONENT ${JKAMPCoreComponent})
endif()

add_zip_command(japro-assets.pk3
FILES ${CMAKE_SOURCE_DIR}/assets/japro/*)

add_custom_target(Assets
ALL
DEPENDS japro-assets.pk3)

install(FILES
${CMAKE_CURRENT_BINARY_DIR}/japro-assets.pk3
DESTINATION "${JKAInstallDir}/EternalJK"
COMPONENT ${JKAMPCoreComponent})
DESTINATION "${JKAInstallDir}/EternalJK"
COMPONENT ${JKAMPCoreComponent})

install(FILES
${CMAKE_SOURCE_DIR}/assets/settings/cosmetics/example.cosmetic
Expand Down
4 changes: 4 additions & 0 deletions codemp/cgame/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ if(MakeApplicationBundles AND BuildMPEngine)
DESTINATION "${JKAInstallDir}/${MPEngine}.app/Contents/MacOS/EternalJK"
COMPONENT ${JKAMPCoreComponent})
elseif(WIN32)
install(TARGETS ${MPCGame}
RUNTIME
DESTINATION "${JKAInstallDir}/EternalJK"
COMPONENT ${JKAMPCoreComponent})
else()
install(TARGETS ${MPCGame}
LIBRARY
Expand Down
4 changes: 4 additions & 0 deletions codemp/game/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ if(MakeApplicationBundles AND BuildMPEngine)
DESTINATION "${JKAInstallDir}/${MPEngine}.app/Contents/MacOS/EternalJK"
COMPONENT ${JKAMPCoreComponent})
elseif(WIN32)
install(TARGETS ${MPGame}
RUNTIME
DESTINATION "${JKAInstallDir}/EternalJK"
COMPONENT ${JKAMPCoreComponent})
else()
install(TARGETS ${MPGame}
LIBRARY
Expand Down
4 changes: 4 additions & 0 deletions codemp/ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ if(MakeApplicationBundles AND BuildMPEngine)
DESTINATION "${JKAInstallDir}/${MPEngine}.app/Contents/MacOS/EternalJK"
COMPONENT ${JKAMPCoreComponent})
elseif(WIN32)
install(TARGETS ${MPUI}
RUNTIME
DESTINATION "${JKAInstallDir}/EternalJK"
COMPONENT ${JKAMPCoreComponent})
else()
install(TARGETS ${MPUI}
LIBRARY
Expand Down

0 comments on commit f75fe7f

Please sign in to comment.