Skip to content
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

Improve and fix sln solution #16220

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

digant73
Copy link
Contributor

@digant73 digant73 commented Oct 15, 2024

Made some fixes, cleanup and improvements on the SLN solution (Windows only):

  • fixed missing/broken clean action on some projects (e.g. OpenAL, glslang): the bug forced the user to manually remove the related working folders to be able to compile the code
  • as it already happens with the cmake solutions, source folders (e.g. 3rdparty, rpcs3 etc.) are now decoupled from working folders (e.g. lib, tmp (obj and building log files). This avoids to mix working folders in folders typically under git control (e.g. all the projects under 3rdparty folder)
  • building folders and files are collected under the <rpcs3_root>\build folder, similarly to <rpcs3_root>\build-msvc,, <rpcs3_root>\build-gcc and <rpcs3_root>\build-clang64 folders for the cmake solutions
  • precompiled libs for glslang and llvm modules are now decoupled from the related source projects in 3rdparty folder. Precompiled libs simply need to be placed under a more intuitive and logic <rpcs3_root>\build\lib_ext\<$(Configuration)>-x64 folder. Previously, llvm required to be mixed on the existing llvm source project under 3rdparty folder. Both the precompiled and compiled projects can now also coexist. In case both are configured, priority is given to the compiled version (linked to the rpcs3 binary)

@Megamouse
Copy link
Contributor

I'm sorry but no one asked for this

@Megamouse
Copy link
Contributor

The only change I really welcome are the missing clean actions

@digant73
Copy link
Contributor Author

digant73 commented Oct 15, 2024

The only change I really welcome are the missing clean actions

It is a lot more easy than you can imagine at first sight.
The majority of changes are simply to set the following paths (from VS' GUI on each project) to direct the output under a common <rpcs3_root>\build folder:

$(SolutionDir)build\lib\$(Configuration)-$(Platform)\
$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\

Currently there are several projects not having any path set (resolved by default as x64\Release or x64\Debug under the source project) creating working folders here and there.

llvm project is simplified now using the already existing installation folder for both .h reference and .lib (1 folder for .h and 1 folder for .lib). The same for glslang's .lib (while currently there are 5 folders defined in the rpcs3.vcxproj because the module was not installed).
OpenAL, llvm and glslang are currently bugged and very confusing, e.g. for llvm:

  • .h files are searched on 3rdparty folder and also on the installation folder
  • .lib are properly retrieved from the llvm installation folder only

The installation folder was enough for both the .h and .lib needed for the rpcs3 building.

That semplification could be applied also to the precompiled llvm libs. It is necessary only the installation folder while currently (in the downloadable zip file) there are two mixed folders, llvm folder (a copy of source folder 3rparty\llvm\llvm\llvm\include) and lvm_build (a partial copy of the installation folder for llvm project).

This PR is simply making the solution easy and linear as it is with cmake solutions and fixing some bugs on clean actions. You can switch to Release and Debug and compile with no issue at all.

The files needing a review are basically:

  • glslang.vcxproj
  • llvm_build.vcxproj (llvm_build_clang_cl.vcxproj is basically the same; a reference to clang instead of msvc compiler)
  • openal-soft.vcxproj

Despite the current solution, the logic implemented on those modules is now the same:

  • setup the working folder under <rpcs3_root>\build\tmp\$(ProjectName)-$(Configuration)>-x64
  • compile under the working folder
  • install under <rpcs3_root>\build\lib\$(Configuration)>-x64

All the rpcs3 modules will retrieve .lib (and .h for llvm module) from:

  • <rpcs3_root>\build\lib\$(Configuration)>-x64
  • <rpcs3_root>\build\lib_ext\$(Configuration)>-x64 as secondary choice for precompiled libs llvm and glslang only

@Megamouse
Copy link
Contributor

Btw, the CI isn't working with this.
I assume it's downloading the pre build libs to the wrong dir?

@digant73
Copy link
Contributor Author

digant73 commented Oct 16, 2024

Btw, the CI isn't working with this. I assume it's downloading the pre build libs to the wrong dir?

Correct. I thought that llvm and glslang were also compiled in the CI. Anyway, the target folder for the precompiled libs llvm and glslang used in the CI is only ./build/lib_ext/Release-x64 (as I said, no impact on the related submodules on 3rdparty folder)

@Megamouse Megamouse added OS: Windows Build and CI Anything related to the build process and continuous integration labels Oct 17, 2024
@Megamouse
Copy link
Contributor

I'll test this when i have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build and CI Anything related to the build process and continuous integration OS: Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants