-
Notifications
You must be signed in to change notification settings - Fork 0
Prepare main branch for building using the exports #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
0d45c1c
fa805ea
fb48279
ec2fc70
904815b
167edda
7f2ce1f
1419e5f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -125,7 +125,10 @@ target_file_copy_if_different(OpenSHC.exe "${CRUSADER_DIR}/shfolder.dll" "$<TARG | |
|
|
||
|
|
||
|
|
||
| set(OPEN_SHC_DLL_DEST "${CRUSADER_DIR}/ucp/modules/${OPEN_SHC_NAME}-${OPEN_SHC_VERSION}" CACHE PATH "Path for OpenSHC.dll and OpenSHC.pdb") | ||
| # We could reinstate this later: | ||
| ## set(OPEN_SHC_DLL_DEST "${CRUSADER_DIR}/ucp/modules/${OPEN_SHC_NAME}-${OPEN_SHC_VERSION}" CACHE PATH "Path for OpenSHC.dll and OpenSHC.pdb") | ||
| # For now it is easier to put it in a dll subfolder | ||
| set(OPEN_SHC_DLL_DEST "${CMAKE_BINARY_DIR}/dll" CACHE PATH "Path for OpenSHC.dll and OpenSHC.pdb") | ||
|
Comment on lines
+128
to
+131
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the issue that is solved here? Does reccmp not follow Symlinks? I would contest that a bit, since it breaks the "debugging with game" flow.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no big issue. What it solved was that I couldn't find the dll file, as the path to the What about adding a cmake statement to also copy the dll and pdb to the build-RelWithDebInfo/dll/ subdirectory that reccmp expects? Then the "debugging with game" is default but the other situation also works.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this case I actually really want to have my cake and eat it, because I feel it should be possible. So, I assume you tried to set the project: .
targets:
STRONGHOLDCRUSADER:
path: ../../_original/ucp/modules/OpenSHC-1.41.0/OpenSHC.dll
pdb: ../../_original/ucp/modules/OpenSHC-1.41.0/OpenSHC.pdband it did not work? I would prefer two options and of them A: Can you ask the reccmp people again, why this does not work?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's go this route: project: .
targets:
STRONGHOLDCRUSADER:
path: ../../_original/ucp/modules/OpenSHC-1.41.0/OpenSHC.dll
pdb: ../../_original/ucp/modules/OpenSHC-1.41.0/OpenSHC.pdbI will test if it works just fine!
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tested it on my setup. Should work. If you manage to confirm this, please change the |
||
|
|
||
| add_library(OpenSHC.dll SHARED src/entry.cpp ${CORE_SOURCES} ${OPENSHC_SOURCES}) | ||
| set_target_properties(OpenSHC.dll PROPERTIES OUTPUT_NAME ${OPEN_SHC_NAME}) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| project: . | ||
| targets: | ||
| STRONGHOLDCRUSADER: | ||
| path: ../../build-RelWithDebInfo/dll/OpenSHC.dll | ||
| pdb: ../../build-RelWithDebInfo/dll/OpenSHC.pdb |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| targets: | ||
| STRONGHOLDCRUSADER: | ||
| path: ../../_original/Stronghold Crusader.exe |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| project: . | ||
| targets: | ||
| STRONGHOLDCRUSADER: | ||
| path: ../../build-RelWithDebInfo/OpenSHC.exe | ||
| pdb: ../../build-RelWithDebInfo/OpenSHC.pdb |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| targets: | ||
| STRONGHOLDCRUSADER: | ||
| filename: Stronghold Crusader.exe | ||
| source_root: ../../src | ||
| hash: | ||
| sha256: 3bb0a8c1e72331b3a30a5aa93ed94beca0081b476b04c1960e26d5b45387ac5a | ||
| data_sources: [] | ||
| ghidra: | ||
| ignore_types: [] | ||
| ignore_functions: [] | ||
| name_substitutions: [] | ||
| allow_hash_mismatch: false | ||
| report: | ||
| ignore_functions: [] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| targets: | ||
| STRONGHOLDCRUSADER: | ||
| path: ../../_original/Stronghold Crusader.exe |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| git+https://github.com/isledecomp/reccmp |
TheRedDaemon marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| @echo off | ||
| setlocal | ||
|
|
||
| :: === Configuration === | ||
| set "VENV_DIR=.venv" | ||
| set "ENV_ACTIVE=0" | ||
| set "CMD_EXIT_CODE=0" | ||
|
|
||
| :: -------------------------------------------- | ||
| :: Change working directory to script location | ||
| :: -------------------------------------------- | ||
| cd /d "%~dp0" || ( | ||
| echo [ERROR] Failed to set working directory to script location. | ||
| call :Cleanup | ||
| exit /b 1 | ||
| ) | ||
|
|
||
| :: -------------------------------------------- | ||
| :: Check arguments | ||
| :: -------------------------------------------- | ||
| if "%~1"=="" ( | ||
| echo [ERROR] No command provided. | ||
| echo Usage: %~nx0 command [args...] | ||
| call :Cleanup | ||
| exit /b 1 | ||
| ) | ||
|
|
||
| :: -------------------------------------------- | ||
| :: Check virtual environment exists | ||
| :: -------------------------------------------- | ||
| if not exist "%VENV_DIR%\Scripts\activate.bat" ( | ||
| echo [ERROR] Virtual environment not found: %VENV_DIR% | ||
| echo Please run the setup script first. | ||
| call :Cleanup | ||
| exit /b 1 | ||
| ) | ||
|
|
||
| :: -------------------------------------------- | ||
| :: Prevent double-activation | ||
| :: -------------------------------------------- | ||
| if /i "%VIRTUAL_ENV%"=="%CD%\%VENV_DIR%" ( | ||
| echo [ERROR] Already running inside the target virtual environment. | ||
| call :Cleanup | ||
| exit /b 1 | ||
| ) | ||
|
|
||
| :: -------------------------------------------- | ||
| :: Activate virtual environment | ||
| :: -------------------------------------------- | ||
| call "%VENV_DIR%\Scripts\activate.bat" | ||
| if /i not "%VIRTUAL_ENV%"=="%CD%\%VENV_DIR%" ( | ||
| echo [ERROR] Failed to activate virtual environment. | ||
| call :Cleanup | ||
| exit /b 1 | ||
| ) | ||
|
|
||
| set "ENV_ACTIVE=1" | ||
| echo [OK] Virtual environment activated. | ||
|
|
||
| :: -------------------------------------------- | ||
| :: Run provided command | ||
| :: -------------------------------------------- | ||
| echo [INFO] Running command: %* | ||
| cmd /c %* | ||
| set "CMD_EXIT_CODE=%ERRORLEVEL%" | ||
| if %CMD_EXIT_CODE% neq 0 ( | ||
| echo [ERROR] Command failed with exit code %CMD_EXIT_CODE%. | ||
| call :Cleanup | ||
| exit /b %CMD_EXIT_CODE% | ||
| ) | ||
|
|
||
| :: -------------------------------------------- | ||
| :: Cleanup | ||
| :: -------------------------------------------- | ||
| call :Cleanup | ||
|
|
||
| echo [SUCCESS] Command completed successfully. | ||
| exit /b 0 | ||
|
|
||
| :: -------------------------------------------- | ||
| :: Cleanup function | ||
| :: -------------------------------------------- | ||
| :Cleanup | ||
| if "%ENV_ACTIVE%"=="1" ( | ||
| deactivate | ||
| set "ENV_ACTIVE=0" | ||
| echo [OK] Virtual environment deactivated. | ||
| ) | ||
| exit /b 0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| @echo off | ||
| setlocal | ||
|
|
||
| :: === Configuration === | ||
| set "VENV_DIR=.venv" | ||
| set "REQ_FILE=requirements.txt" | ||
| set "ENV_ACTIVE=0" | ||
|
|
||
| :: --- Change working directory to the folder where the script is located --- | ||
| cd /d "%~dp0" || ( | ||
| echo [ERROR] Failed to set working directory to script location: %~dp0 | ||
| call :Cleanup | ||
| exit /b 1 | ||
| ) | ||
|
|
||
| :: -------------------------------------------- | ||
| :: Check if not running in own env | ||
| :: -------------------------------------------- | ||
| if /i "%VIRTUAL_ENV%"=="%CD%\%VENV_DIR%" ( | ||
| echo [ERROR] This script is already running inside the target virtual environment. | ||
| exit /b 1 | ||
| ) | ||
|
|
||
| :: -------------------------------------------- | ||
| :: Check for Python installation | ||
| :: -------------------------------------------- | ||
| python --version >nul 2>&1 | ||
| if %errorlevel% neq 0 ( | ||
| echo [ERROR] Python is not installed or not in PATH. | ||
| call :Cleanup | ||
| exit /b 1 | ||
| ) | ||
| echo [OK] Python is available. | ||
|
|
||
| :: -------------------------------------------- | ||
| :: Create virtual environment | ||
| :: -------------------------------------------- | ||
| echo Creating virtual environment in "%VENV_DIR%"... | ||
| python -m venv "%VENV_DIR%" | ||
| if %errorlevel% neq 0 ( | ||
| echo [ERROR] Failed to create virtual environment. | ||
| call :Cleanup | ||
| exit /b 1 | ||
| ) | ||
|
|
||
| :: -------------------------------------------- | ||
| :: Activate virtual environment | ||
| :: -------------------------------------------- | ||
| call "%VENV_DIR%\Scripts\activate.bat" | ||
| if /i not "%VIRTUAL_ENV%"=="%CD%\%VENV_DIR%" ( | ||
| echo [ERROR] Failed to activate virtual environment. | ||
| call :Cleanup | ||
| exit /b 1 | ||
| ) | ||
| set "ENV_ACTIVE=1" | ||
| echo [OK] Virtual environment activated. | ||
|
|
||
| :: -------------------------------------------- | ||
| :: Install requirements | ||
| :: -------------------------------------------- | ||
| if not exist "%REQ_FILE%" ( | ||
| echo [ERROR] Requirements file not found: %REQ_FILE% | ||
| call :Cleanup | ||
| exit /b 1 | ||
| ) | ||
|
|
||
| echo Installing packages from "%REQ_FILE%"... | ||
| pip install -r "%REQ_FILE%" | ||
| if %errorlevel% neq 0 ( | ||
| echo [ERROR] Failed to install packages. | ||
| call :Cleanup | ||
| exit /b 1 | ||
| ) | ||
| echo [OK] All packages installed successfully. | ||
|
|
||
| :: -------------------------------------------- | ||
| :: Normal cleanup | ||
| :: -------------------------------------------- | ||
| call :Cleanup | ||
|
|
||
| echo [SUCCESS] Setup complete. | ||
| endlocal | ||
| exit /b 0 | ||
|
|
||
| :: -------------------------------------------- | ||
| :: Cleanup function | ||
| :: -------------------------------------------- | ||
| :Cleanup | ||
| if "%ENV_ACTIVE%"=="1" ( | ||
| deactivate | ||
| set "ENV_ACTIVE=0" | ||
| echo [OK] Virtual environment deactivated. | ||
| ) | ||
| exit /b 0 |
This file was deleted.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.