Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
78a1f24
Create a new launcher target for Linux.
sunmachine Jul 14, 2026
ef5f7ec
Fix launcher build on Linux and stage the standalone install layout
sunmachine Jul 14, 2026
df74497
Ignore the Linux launcher binary and its runtime steam_appid.txt
sunmachine Jul 14, 2026
756ef86
windows build for launcher main
DESTROYGIRL Jul 15, 2026
3977f72
Update .gitignore
DESTROYGIRL Jul 15, 2026
e514b06
Default the launcher appid to NT;RE's
sunmachine Jul 18, 2026
73c8cef
Add NEO_INSTALL_LAUNCHER to package the launcher
sunmachine Jul 18, 2026
1203e67
Stop treating the SDK Base install as the game root
sunmachine Jul 18, 2026
2434134
Load the engine in-process on Linux instead of exec'ing hl2.sh
sunmachine Jul 18, 2026
2d80e90
Work around the engine's case-mangled SDK mount path on Linux
sunmachine Jul 18, 2026
31230ac
Terminate the executable path read from /proc/self/exe
sunmachine Jul 18, 2026
a508dad
Honor -wait_for_debugger in the Linux launcher
sunmachine Jul 18, 2026
62a126c
Wrap launcher divergence from the SDK in NEO guards
sunmachine Jul 19, 2026
b91a9b9
Let the engine surface the missing-SDK install flow
sunmachine Jul 19, 2026
c79f7a3
Guard the launcher staging copies per-OS
sunmachine Jul 19, 2026
fa05a5a
Drop the stale Windows-flow warning
sunmachine Jul 19, 2026
ccdf5d5
Tidy launcher CMake indentation and paths
sunmachine Jul 19, 2026
a92d919
Scope the fopen guard to tier1 on Windows
sunmachine Jul 19, 2026
e2eb409
Build and upload the launcher package in CI
sunmachine Jul 19, 2026
c3ef868
Split and ship the launcher debug information
sunmachine Jul 19, 2026
4e267dd
Derive split-debug names from target prefix and suffix
sunmachine Jul 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/cibuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ jobs:
-DNEO_COPY_LIBRARIES=OFF
-DNEO_USE_SEPARATE_BUILD_INFO=ON
-DNEO_INSTALL_LIBRARIES=ON
-DNEO_INSTALL_LAUNCHER=ON
-DNEO_INSTALL_RESOURCES=OFF
-DNEO_EXTRA_ASSETS_ALT_PATH=${{ github.workspace }}/neoAssets

Expand Down Expand Up @@ -131,6 +132,8 @@ jobs:
echo "dedicated=$(find . -regex '\.\/neo-\w*-\w*-dedicated-\w*-\w*' -printf '%f')" >> "$GITHUB_ENV"
echo "dedicated_debuginfo=$(find . -regex '\.\/neo-\w*-\w*-dedicated-debuginfo-\w*-\w*' -printf '%f')" >> "$GITHUB_ENV"
echo "gamedata=$(find . -regex '\.\/neo-\w*-\w*-gamedata' -printf '%f')" >> "$GITHUB_ENV"
echo "launcher=$(find . -regex '\.\/neo-\w*-\w*-launcher-\w*-\w*' -printf '%f')" >> "$GITHUB_ENV"
echo "launcher_debuginfo=$(find . -regex '\.\/neo-\w*-\w*-launcher-debuginfo-\w*-\w*' -printf '%f')" >> "$GITHUB_ENV"

- name: Upload libraries
uses: actions/upload-artifact@v7
Expand Down Expand Up @@ -168,6 +171,20 @@ jobs:
path: ${{ env.install_dir }}/${{ env.gamedata }}
if-no-files-found: error

- name: Upload launcher
uses: actions/upload-artifact@v7
with:
name: ${{ env.launcher }}
path: ${{ env.install_dir }}/${{ env.launcher }}
if-no-files-found: error

- name: Upload launcher debug information
uses: actions/upload-artifact@v7
with:
name: ${{ env.launcher_debuginfo }}
path: ${{ env.install_dir }}/${{ env.launcher_debuginfo }}
if-no-files-found: error

windows-build:
name: ${{ matrix.platform.display_name }} ${{ matrix.preset_build_type.display_name }}

Expand Down Expand Up @@ -241,6 +258,7 @@ jobs:
-DNEO_COPY_LIBRARIES=OFF
-DNEO_USE_SEPARATE_BUILD_INFO=ON
-DNEO_INSTALL_LIBRARIES=ON
-DNEO_INSTALL_LAUNCHER=ON
-DNEO_INSTALL_RESOURCES=OFF
-DNEO_EXTRA_ASSETS_ALT_PATH=${{ github.workspace }}/neoAssets

Expand Down Expand Up @@ -286,6 +304,8 @@ jobs:
echo "dedicated=$(find . -regex '\.\/neo-\w*-\w*-dedicated-\w*-\w*' -printf '%f')" >> "$GITHUB_ENV"
echo "dedicated_debuginfo=$(find . -regex '\.\/neo-\w*-\w*-dedicated-debuginfo-\w*-\w*' -printf '%f')" >> "$GITHUB_ENV"
echo "gamedata=$(find . -regex '\.\/neo-\w*-\w*-gamedata' -printf '%f')" >> "$GITHUB_ENV"
echo "launcher=$(find . -regex '\.\/neo-\w*-\w*-launcher-\w*-\w*' -printf '%f')" >> "$GITHUB_ENV"
echo "launcher_debuginfo=$(find . -regex '\.\/neo-\w*-\w*-launcher-debuginfo-\w*-\w*' -printf '%f')" >> "$GITHUB_ENV"

- name: Upload libraries
uses: actions/upload-artifact@v7
Expand Down Expand Up @@ -315,6 +335,20 @@ jobs:
path: ${{ env.install_dir }}/${{ env.dedicated_debuginfo }}
if-no-files-found: error

- name: Upload launcher
uses: actions/upload-artifact@v7
with:
name: ${{ env.launcher }}
path: ${{ env.install_dir }}/${{ env.launcher }}
if-no-files-found: error

- name: Upload launcher debug information
uses: actions/upload-artifact@v7
with:
name: ${{ env.launcher_debuginfo }}
path: ${{ env.install_dir }}/${{ env.launcher_debuginfo }}
if-no-files-found: error

pack-resources:
name: Windows Native Resources

Expand Down Expand Up @@ -358,6 +392,7 @@ jobs:
-DNEO_COPY_LIBRARIES=OFF
-DNEO_INSTALL_LIBRARIES=OFF
-DNEO_INSTALL_RESOURCES=ON
-DNEO_INSTALL_LAUNCHER=OFF

- name: Install resources
run: cmake --install ${{ env.build_dir }}
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ out

/game/neo/screenshots

# Mod launcher binary and the appid file it writes at runtime
/game/neo_linux64
/game/neo_win64.exe
/game/steam_appid.txt

# Binary Assets
/game/**/bin/**
/game/neo/maps
Expand Down
45 changes: 44 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ else ()
endif ()
option(NEO_INSTALL_LIBRARIES "Install game libraries" OFF)
option(NEO_INSTALL_RESOURCES "Install game resources" OFF)
option(NEO_INSTALL_LAUNCHER "Install the Steam mod launcher" OFF)
option(NEO_USE_SEPARATE_BUILD_INFO "Use separate build info on Linux" OFF)
option(NEO_ENABLE_CPACK "Enable CPack" OFF)
option(NEO_USE_MEM_DEBUG "Enable USE_MEM_DEBUG defines" OFF)
option(NEO_GENERATE_GAMEDATA "Generate SourceMod gamedata" ${NEO_DEDICATED})
option(NEO_BUILD_LAUNCHER "Build the Steam mod launcher" ON)
set(NEO_MOD_APPID "3172910" CACHE STRING "Steam appid for the mod launcher's steam_appid.txt")

message(STATUS "Treat compile warnings as errors: ${CMAKE_COMPILE_WARNING_AS_ERROR}")
message(STATUS "CI build mode: ${NEO_CI_BUILD}")
Expand All @@ -72,8 +75,11 @@ message(STATUS "Alternate location to fetch the extra assets: ${NEO_EXTRA_ASSETS
message(STATUS "Directory for output libraries: ${NEO_OUTPUT_LIBRARY_PATH}")
message(STATUS "Install game libraries: ${NEO_INSTALL_LIBRARIES}")
message(STATUS "Install game resources: ${NEO_INSTALL_RESOURCES}")
message(STATUS "Install the Steam mod launcher: ${NEO_INSTALL_LAUNCHER}")
message(STATUS "Use separate build info on Linux: ${NEO_USE_SEPARATE_BUILD_INFO}")
message(STATUS "Enable CPack: ${NEO_ENABLE_CPACK}")
message(STATUS "Build the Steam mod launcher: ${NEO_BUILD_LAUNCHER}")
message(STATUS "Mod launcher appid override: ${NEO_MOD_APPID}")
message("")

if(NEO_COPY_LIBRARIES)
Expand Down Expand Up @@ -211,7 +217,6 @@ if(OS_WINDOWS)
_ALLOW_RUNTIME_LIBRARY_MISMATCH
_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH
_ALLOW_MSC_VER_MISMATCH
fopen=dont_use_fopen
Comment thread
sunmachine marked this conversation as resolved.
_MBCS
)

Expand Down Expand Up @@ -452,6 +457,10 @@ endif()

add_subdirectory(game/server)

if(NEO_BUILD_LAUNCHER AND NOT NEO_DEDICATED)
add_subdirectory(launcher_main)
endif()

if(NEO_COPY_LIBRARIES)
set(COPY_ALL_LIBS_FLAG ALL)
else()
Expand Down Expand Up @@ -585,6 +594,40 @@ if(NEO_INSTALL_LIBRARIES)
endif()
endif()

if(NEO_INSTALL_LAUNCHER AND NEO_BUILD_LAUNCHER AND NOT NEO_DEDICATED)
# The launcher sits at the install root, next to the neo/ game directory.
# steam_api ships with the engine binaries in bin/, so only the launcher
# itself is staged here.
set(LAUNCHER_INSTALL_PATH "${INSTALL_PATH_PREFIX}-launcher-${CMAKE_SYSTEM_NAME}-${BUILD_TYPE_NAME}")

if(NEO_USE_SEPARATE_BUILD_INFO)
set(LAUNCHER_DEBUG_INFO_INSTALL_PATH "${INSTALL_PATH_PREFIX}-launcher-debuginfo-${CMAKE_SYSTEM_NAME}-${BUILD_TYPE_NAME}")

if(OS_WINDOWS)
install(TARGETS launcher_main RUNTIME DESTINATION "${LAUNCHER_INSTALL_PATH}")

install(
FILES "$<TARGET_PDB_FILE:launcher_main>"
DESTINATION "${LAUNCHER_DEBUG_INFO_INSTALL_PATH}"
)
else()
get_target_property(LAUNCHER_STRIPPED_FILE launcher_main STRIPPED_FILE)
install(
PROGRAMS ${LAUNCHER_STRIPPED_FILE}
DESTINATION "${LAUNCHER_INSTALL_PATH}"
)

get_target_property(LAUNCHER_SPLIT_DEBUG_INFO_FILE launcher_main SPLIT_DEBUG_INFO_FILE)
install(
FILES ${LAUNCHER_SPLIT_DEBUG_INFO_FILE}
DESTINATION "${LAUNCHER_DEBUG_INFO_INSTALL_PATH}"
)
endif()
else()
install(TARGETS launcher_main RUNTIME DESTINATION "${LAUNCHER_INSTALL_PATH}")
endif()
endif()

if(NEO_INSTALL_RESOURCES)
install(
DIRECTORY
Expand Down
4 changes: 4 additions & 0 deletions src/cmake/packaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ if(NEO_INSTALL_RESOURCES)
set(CPACK_PACKAGE_FILE_NAME "neo-${BUILD_DATE_SHORT}-${GIT_HASH}-resources")
endif()

if(NEO_INSTALL_LAUNCHER)
set(CPACK_PACKAGE_FILE_NAME "neo-${BUILD_DATE_SHORT}-${GIT_HASH}-launcher-${CMAKE_SYSTEM_NAME}")
endif()

if(OS_WINDOWS)
set(CPACK_GENERATOR "ZIP")
else()
Expand Down
30 changes: 27 additions & 3 deletions src/cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,33 @@ function(split_debug_information)
set(TARGET_OUTPUT_NAME "${PARSED_ARGS_TARGET}")
endif()

set(SPLITDEBUG_SOURCE "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_OUTPUT_NAME}.so")
set(SPLITDEBUG_TARGET "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_SUBDIRECTORY}/${TARGET_OUTPUT_NAME}.so")
set(SPLITDEBUG_TARGET_DEBUG "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_SUBDIRECTORY}/${TARGET_OUTPUT_NAME}.so.debug")
get_target_property(TARGET_PREFIX ${PARSED_ARGS_TARGET} PREFIX)
if("${TARGET_PREFIX}" STREQUAL "TARGET_PREFIX-NOTFOUND")
get_target_property(TARGET_TYPE ${PARSED_ARGS_TARGET} TYPE)
if(TARGET_TYPE STREQUAL "EXECUTABLE")
set(TARGET_PREFIX "")
elseif(TARGET_TYPE STREQUAL "SHARED_LIBRARY")
set(TARGET_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
else()
message(WARNING "Unknown TARGET_TYPE value")
endif()
endif()

get_target_property(TARGET_SUFFIX ${PARSED_ARGS_TARGET} SUFFIX)
if("${TARGET_SUFFIX}" STREQUAL "TARGET_SUFFIX-NOTFOUND")
get_target_property(TARGET_TYPE ${PARSED_ARGS_TARGET} TYPE)
if(TARGET_TYPE STREQUAL "EXECUTABLE")
set(TARGET_SUFFIX "${CMAKE_EXECUTABLE_SUFFIX}")
elseif(TARGET_TYPE STREQUAL "SHARED_LIBRARY")
set(TARGET_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}")
else()
message(WARNING "Unknown TARGET_TYPE value")
endif()
endif()

set(SPLITDEBUG_SOURCE "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PREFIX}${TARGET_OUTPUT_NAME}${TARGET_SUFFIX}")
set(SPLITDEBUG_TARGET "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_SUBDIRECTORY}/${TARGET_PREFIX}${TARGET_OUTPUT_NAME}${TARGET_SUFFIX}")
set(SPLITDEBUG_TARGET_DEBUG "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_SUBDIRECTORY}/${TARGET_PREFIX}${TARGET_OUTPUT_NAME}${TARGET_SUFFIX}.debug")

add_custom_target(
${PARSED_ARGS_TARGET}_split_debug_information
Expand Down
5 changes: 5 additions & 0 deletions src/game/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ if(OS_LINUX OR OS_MACOS)
endif()

if(OS_WINDOWS)
target_compile_definitions(server
PRIVATE
fopen=dont_use_fopen
)

target_link_libraries(server
PRIVATE
winmm.lib
Expand Down
90 changes: 90 additions & 0 deletions src/launcher_main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Steam mod launcher. Runs the game from the mod's own install directory
# using the mod's shipped engine binaries; the Source SDK Base 2013 MP
# install is only an asset dependency, mounted through gameinfo.txt.
if(OS_LINUX)
find_package(SDL2 REQUIRED)
endif()

set(LAUNCHER_SOURCES main.cpp)

if(OS_WINDOWS)
list(APPEND LAUNCHER_SOURCES launcher_main_mod_neo.rc)
endif()

add_executable(launcher_main
${LAUNCHER_SOURCES}
)

# GetExecutableModName derives the default -game dir from the executable name
# by stripping from the last underscore: neo_linux64 -> -game neo. The suffix
# also avoids colliding with the game/neo directory at the install root.
if(OS_LINUX)
set_target_properties(launcher_main
PROPERTIES
OUTPUT_NAME neo_linux64
)
elseif(OS_WINDOWS)
set_target_properties(launcher_main
PROPERTIES
OUTPUT_NAME neo_win64
WIN32_EXECUTABLE TRUE
)
endif()

if(NEO_USE_SEPARATE_BUILD_INFO)
split_debug_information(TARGET launcher_main)
endif()

target_include_directories(launcher_main
PRIVATE
${CMAKE_SOURCE_DIR}/public
${CMAKE_SOURCE_DIR}/common
)

if(OS_LINUX)
target_link_libraries(launcher_main
PRIVATE
SDL2::SDL2
${CMAKE_DL_LIBS}
)

# main.cpp defines __wrap_fopen/__wrap_fopen64 which reference __real_fopen/__real_fopen64
target_link_options(launcher_main
PRIVATE
-Wl,--wrap=fopen
-Wl,--wrap=fopen64
)
endif()

if(NEO_MOD_APPID)
target_compile_definitions(launcher_main
PRIVATE
MOD_LAUNCHER
MOD_APPID=${NEO_MOD_APPID}
)
endif()

if(NEO_COPY_LIBRARIES)
# Stage the standalone-install layout: launcher at the install root next to
# neo/, and the steam_api lib where the launcher dlopens it (game/bin, the
# engine binary dir).
add_custom_command(TARGET launcher_main POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:launcher_main>
${CMAKE_SOURCE_DIR}/../game/
VERBATIM
)
# The repo only carries the Linux steam_api runtime; on Windows
# lib/public/x64 has the import lib, and the launcher loads
# bin/x64/steam_api64.dll from a Source SDK Base / depot install.
if(OS_LINUX)
add_custom_command(TARGET launcher_main POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory
${CMAKE_SOURCE_DIR}/../game/bin/linux64/
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/lib/public/linux64/libsteam_api.so
${CMAKE_SOURCE_DIR}/../game/bin/linux64/
VERBATIM
)
endif()
endif()
Comment thread
sunmachine marked this conversation as resolved.
Loading