Skip to content

Improve and fix sln solution#16220

Merged
Megamouse merged 5 commits intoRPCS3:masterfrom
digant73:improve_sln_solution
Nov 16, 2024
Merged

Improve and fix sln solution#16220
Megamouse merged 5 commits intoRPCS3:masterfrom
digant73:improve_sln_solution

Conversation

@digant73
Copy link
Copy Markdown
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
Copy Markdown
Contributor

I'm sorry but no one asked for this

@Megamouse
Copy link
Copy Markdown
Contributor

The only change I really welcome are the missing clean actions

@digant73
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

I'll test this when i have time.

@Megamouse
Copy link
Copy Markdown
Contributor

Needs a rebase

@Megamouse
Copy link
Copy Markdown
Contributor

I couldn't merge this since there were still conflicts apparently.
So I merged something else that touches the same code anyway.
Needs another rebase with proper conflict solving.

@Megamouse
Copy link
Copy Markdown
Contributor

This isn't working either. I can push the rebased commits if you like.

@digant73
Copy link
Copy Markdown
Contributor Author

digant73 commented Nov 16, 2024

This isn't working either. I can push the rebased commits if you like.

it should be ok. If not, sure, proceed with your changes

@digant73
Copy link
Copy Markdown
Contributor Author

digant73 commented Nov 16, 2024

I also saw those deprecated files and folders under 3rdparty folder in .gitgnore but I limited the removal only to the changed llvm module in this PR.
Also the following seems to be obsolete (libusb_cmake is not even existing while the current libusb is not afftected (those files are renamed/generetaed under the working folder build-<xxx> using cmake))

# libusb
/3rdparty/libusb_cmake/config.h
/3rdparty/libusb_cmake/libusb-1.0.pc

digant73 and others added 2 commits November 16, 2024 16:12
@Megamouse
Copy link
Copy Markdown
Contributor

Good catch.
I also added a commit to ignore opencv in the CI unless needed (Don't wanna add an extra PR just for that)

@Megamouse Megamouse merged commit 2ee1770 into RPCS3:master Nov 16, 2024
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