diff --git a/README.md b/README.md index 8115d6b34..20a0e3677 100644 --- a/README.md +++ b/README.md @@ -204,29 +204,15 @@ These instructions have been written for and tested on Debian 12 and Arch for Li Once they're fetched, place them in the `/ntrebuild` directory. #### Linux-only additional instructions -1. **Linux only:** Make a symlink so that Src2013 dedicated server can see SteamCMD's binaries: +Make a symlink so that Src2013 dedicated server can see SteamCMD's binaries: + +(NOTE: I'm NOT sure if this is how it is on other systems other than Debian 12, so please, check first if you have `~/.steam/sdk64` before running these! If you have Desktop Steam installed, then you should have this directory, but it doesn't seem to be the case with SteamCMD, which is why we need to do this.) +``` +ln -s ~/.steam/steam/steamcmd/linux64 ~/.steam/sdk64 +``` + +**Note:** Making `_srv` symlinks (`ln -s libtier0_srv.so libtier0.so` for example) is not necessary. - (NOTE: I'm NOT sure if this is how it is on other systems other than Debian 12, so please, check first if you have `~/.steam/sdk64` before running these! If you have Desktop Steam installed, then you should have this directory, but it doesn't seem to be the case with SteamCMD, which is why we need to do this.) - ``` - ln -s ~/.steam/steam/steamcmd/linux64 ~/.steam/sdk64 - ``` -2. **Linux only:** Change directory into `/ntrebuild/bin/linux64` then run these commands to make symlinks for needed files: - ``` - ln -s datacache_srv.so datacache.so; - ln -s dedicated_srv.so dedicated.so; - ln -s engine_srv.so engine.so; - ln -s libtier0_srv.so libtier0.so; - ln -s libvstdlib_srv.so libvstdlib.so; - ln -s materialsystem_srv.so materialsystem.so; - ln -s replay_srv.so replay.so; - ln -s scenefilecache_srv.so scenefilecache.so; - ln -s shaderapiempty_srv.so shaderapiempty.so; - ln -s soundemittersystem_srv.so soundemittersystem.so; - ln -s studiorender_srv.so studiorender.so; - ln -s vphysics_srv.so vphysics.so; - ln -s vscript_srv.so vscript.so; - ``` -3. `cd` up directories twice, so that you are in `/ntrebuild`. #### Extracting NT;RE and editing gameinfo.txt 1. Extract the latest release of NT;RE into `/ntrebuild`, so you will have a directory `/ntrebuild/neo` with a `gameinfo.txt` inside. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f6abe6bf9..b49b2fd07 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -130,20 +130,26 @@ if(NEO_RAD_TELEMETRY_DISABLED) endif() if (OS_LINUX) - set(PLATSUBDIR "/linux64") + set(PLATSUBDIR "linux64") elseif (OS_WINDOWS) - set(PLATSUBDIR "/x64") + set(PLATSUBDIR "x64") endif () set(STEAM_RUNTIME_PATH /usr) set(CRYPTOPPDIR steamrt_sniper64) +if (NEO_DEDICATED AND OS_LINUX) + set(SRV_SUFFIX "_srv") +else() + set(SRV_SUFFIX "") +endif() + add_compile_definitions( # SDK2013CE # Cut out since 2025-02-18 TF2 SDK Update NEO GLOWS_ENABLE - _DLL_EXT=${CMAKE_SHARED_LIBRARY_SUFFIX} - _EXTERNAL_DLL_EXT=${CMAKE_SHARED_LIBRARY_SUFFIX} + _DLL_EXT=${SRV_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX} + _EXTERNAL_DLL_EXT=${SRV_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX} _GLIBCXX_USE_CXX11_ABI=0 FRAME_POINTER_OMISSION_DISABLED SOURCE1=1 @@ -159,8 +165,8 @@ add_compile_definitions( ) if(OS_WINDOWS) - set(LIBPUBLIC "${CMAKE_SOURCE_DIR}/lib/public${PLATSUBDIR}") - set(LIBCOMMON "${CMAKE_SOURCE_DIR}/lib/common${PLATSUBDIR}") + set(LIBPUBLIC "${CMAKE_SOURCE_DIR}/lib/public/${PLATSUBDIR}") + set(LIBCOMMON "${CMAKE_SOURCE_DIR}/lib/common/${PLATSUBDIR}") set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "EditAndContinue") @@ -379,8 +385,9 @@ if(OS_LINUX OR OS_MACOS) endif() if(OS_LINUX) - set(LIBPUBLIC "${CMAKE_SOURCE_DIR}/lib/public${PLATSUBDIR}") - set(LIBCOMMON "${CMAKE_SOURCE_DIR}/lib/common${PLATSUBDIR}") + set(LIBPUBLIC_RELATIVE_PATH "lib/public/${PLATSUBDIR}") + set(LIBPUBLIC "${CMAKE_SOURCE_DIR}/${LIBPUBLIC_RELATIVE_PATH}") + set(LIBCOMMON "${CMAKE_SOURCE_DIR}/lib/common/${PLATSUBDIR}") add_compile_definitions( LINUX @@ -498,8 +505,8 @@ if(NEO_INSTALL_LIBRARIES) else() install( TARGETS server - LIBRARY DESTINATION "${LIBRARY_INSTALL_PATH}${PLATSUBDIR}" - RUNTIME DESTINATION "${LIBRARY_INSTALL_PATH}${PLATSUBDIR}" + LIBRARY DESTINATION "${LIBRARY_INSTALL_PATH}/${PLATSUBDIR}" + RUNTIME DESTINATION "${LIBRARY_INSTALL_PATH}/${PLATSUBDIR}" ) endif() else() @@ -548,8 +555,8 @@ if(NEO_INSTALL_LIBRARIES) else() install( TARGETS client game_shader_dx9 server - LIBRARY DESTINATION "${LIBRARY_INSTALL_PATH}${PLATSUBDIR}" - RUNTIME DESTINATION "${LIBRARY_INSTALL_PATH}${PLATSUBDIR}" + LIBRARY DESTINATION "${LIBRARY_INSTALL_PATH}/${PLATSUBDIR}" + RUNTIME DESTINATION "${LIBRARY_INSTALL_PATH}/${PLATSUBDIR}" ) endif() endif() diff --git a/src/cmake/FindTier0.cmake b/src/cmake/FindTier0.cmake index 8f24ce0b2..6da95a07f 100644 --- a/src/cmake/FindTier0.cmake +++ b/src/cmake/FindTier0.cmake @@ -1,14 +1,24 @@ if(OS_WINDOWS) + set(TIER0_LIBRARY_FIND_PATH "${LIBPUBLIC}") set(TIER0_LIBRARY_NAME tier0.lib) -elseif(OS_LINUX) - set(TIER0_LIBRARY_NAME libtier0.so) +elseif(OS_LINUX) + if (NEO_DEDICATED) + set(TIER0_LIBRARY_FIND_PATH "${CMAKE_BINARY_DIR}/${LIBPUBLIC_RELATIVE_PATH}") + set(TIER0_LIBRARY_NAME libtier0_srv.so) + + file(MAKE_DIRECTORY "${TIER0_LIBRARY_FIND_PATH}") + file(COPY_FILE "${LIBPUBLIC}/libtier0.so" "${TIER0_LIBRARY_FIND_PATH}/${TIER0_LIBRARY_NAME}") + else() + set(TIER0_LIBRARY_FIND_PATH "${LIBPUBLIC}") + set(TIER0_LIBRARY_NAME libtier0.so) + endif() elseif(OS_MACOS) set(TIER0_LIBRARY_NAME libtier0.dylib) endif() find_file(TIER0_LIBRARY NAMES ${TIER0_LIBRARY_NAME} - PATHS "${LIBPUBLIC}" + PATHS "${TIER0_LIBRARY_FIND_PATH}" NO_CACHE NO_DEFAULT_PATH REQUIRED diff --git a/src/cmake/FindVSTDLib.cmake b/src/cmake/FindVSTDLib.cmake index 378240328..da03e490b 100644 --- a/src/cmake/FindVSTDLib.cmake +++ b/src/cmake/FindVSTDLib.cmake @@ -1,14 +1,24 @@ if(OS_WINDOWS) + set(VSTDLIB_LIBRARY_FIND_PATH "${LIBPUBLIC}") set(VSTDLIB_LIBRARY_NAME vstdlib.lib) elseif(OS_LINUX) - set(VSTDLIB_LIBRARY_NAME libvstdlib.so) + if (NEO_DEDICATED) + set(VSTDLIB_LIBRARY_FIND_PATH "${CMAKE_BINARY_DIR}/${LIBPUBLIC_RELATIVE_PATH}") + set(VSTDLIB_LIBRARY_NAME libvstdlib_srv.so) + + file(MAKE_DIRECTORY "${VSTDLIB_LIBRARY_FIND_PATH}") + file(COPY_FILE "${LIBPUBLIC}/libvstdlib.so" "${VSTDLIB_LIBRARY_FIND_PATH}/${VSTDLIB_LIBRARY_NAME}") + else() + set(VSTDLIB_LIBRARY_FIND_PATH "${LIBPUBLIC}") + set(VSTDLIB_LIBRARY_NAME libvstdlib.so) + endif() elseif(OS_MACOS) set(VSTDLIB_LIBRARY_NAME libvstdlib.dylib) endif() find_library(VSTDLIB_LIBRARY NAMES ${VSTDLIB_LIBRARY_NAME} - PATHS "${LIBPUBLIC}" + PATHS "${VSTDLIB_LIBRARY_FIND_PATH}" NO_CACHE NO_DEFAULT_PATH REQUIRED