changes to build process for dflaunch

only build dflaunch on steam-specific builds
only download steamworks SDK when building dflaunch
get steam account from environment when downloading steamworks SDK
develop
Kelly Kinkade 2023-04-18 18:42:42 -05:00 committed by Kelly Kinkade
parent ea01dae88f
commit 337c5eea2a
4 changed files with 32 additions and 18 deletions

@ -38,7 +38,9 @@ jobs:
ccache-win64-cross-msvc
- name: Cross-compile win64 artifacts
env:
CMAKE_EXTRA_ARGS: '-DBUILD_STONESENSE:BOOL=1'
CMAKE_EXTRA_ARGS: '-DBUILD_STONESENSE:BOOL=1 -DBUILD_DFLAUNCH:BOOL=1'
steam_username: ${{ secrets.STEAM_USERNAME }}
steam_password: ${{ secrets.STEAM_PASSWORD }}
run: |
cd build
bash -x build-win64-from-linux.sh

@ -313,18 +313,6 @@ if(WIN32)
"5a09604daca6b2b5ce049d79af935d6a")
endif()
# download Steam SDK
set (STEAMAPI_DIR ${dfhack_SOURCE_DIR}/depends/steam)
file(DOWNLOAD "https://partner.steamgames.com/downloads/steamworks_sdk_156.zip"
${STEAMAPI_DIR}/steamworks_sdk_156.zip
EXPECTED_HASH MD5=af5a579990dbe5ae4c1b0689260d001b)
file(ARCHIVE_EXTRACT
INPUT ${STEAMAPI_DIR}/steamworks_sdk_156.zip
DESTINATION ${STEAMAPI_DIR})
set(STEAMAPI_LIBRARY "${STEAMAPI_DIR}/sdk/redistributable_bin/win64/steam_api64.lib")
set(STEAMAPI_SOURCE_DIR "${STEAMAPI_DIR}/sdk/public/steam")
set(STEAMAPI_SHARED_LIBRARY "${STEAMAPI_DIR}/sdk/redistributable_bin/win64/steam_api64.dll")
endif()
if(APPLE)

@ -0,0 +1,4 @@
IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt
IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF
echo generating a build folder
cmake ..\.. -G"Visual Studio 17 2022" -A x64 -B VC2022 -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" -DBUILD_DEVEL=1 -DBUILD_DEV_PLUGINS=1 -DBUILD_STONESENSE=1 -DBUILD_DFLAUNCH=1

@ -1,9 +1,29 @@
project(package_windows)
if(WIN32)
include_directories(${STEAMAPI_SOURCE_DIR})
link_libraries(${STEAMAPI_LIBRARY})
add_executable(launchdf WIN32 launchdf.cpp)
install(TARGETS launchdf DESTINATION ${DFHACK_DATA_DESTINATION})
install(FILES ${STEAMAPI_SHARED_LIBRARY} DESTINATION ${DFHACK_DATA_DESTINATION})
if (BUILD_DFLAUNCH)
if ((DEFINED ENV{steam_username}) AND (DEFINED ENV{steam_password}))
# download Steam SDK
set (STEAMAPI_DIR ${dfhack_SOURCE_DIR}/depends/steam)
file(DOWNLOAD "https://partner.steamgames.com/downloads/steamworks_sdk_156.zip"
${STEAMAPI_DIR}/steamworks_sdk_156.zip
EXPECTED_HASH MD5=af5a579990dbe5ae4c1b0689260d001b
USERPWD $ENV{steam_username}:$ENV{steam_password}
)
file(ARCHIVE_EXTRACT
INPUT ${STEAMAPI_DIR}/steamworks_sdk_156.zip
DESTINATION ${STEAMAPI_DIR})
set(STEAMAPI_LIBRARY "${STEAMAPI_DIR}/sdk/redistributable_bin/win64/steam_api64.lib")
set(STEAMAPI_SOURCE_DIR "${STEAMAPI_DIR}/sdk/public/steam")
set(STEAMAPI_SHARED_LIBRARY "${STEAMAPI_DIR}/sdk/redistributable_bin/win64/steam_api64.dll")
else()
message(SEND_ERROR "Need to set steam_username and steam_password in environment to download Steamworks SDK")
endif()
include_directories(${STEAMAPI_SOURCE_DIR})
link_libraries(${STEAMAPI_LIBRARY})
add_executable(launchdf WIN32 launchdf.cpp)
install(TARGETS launchdf DESTINATION ${DFHACK_DATA_DESTINATION})
install(FILES ${STEAMAPI_SHARED_LIBRARY} DESTINATION ${DFHACK_DATA_DESTINATION})
endif()
endif()