Adventure Game Studio

AGS Development => Engine Development => Topic started by: Monsieur OUXX on Mon 08/08/2022 13:13:43

Title: Building solution 'Tests' on windows 10 with Visual Studio 2022
Post by: Monsieur OUXX on Mon 08/08/2022 13:13:43
Trying to build the unit tests (Common.Lib.Test and Engine.app.Test, in solution Tests) of branch ags4
On windows 10 with Visual Studio 2022

Is there a help page? (I don't think so).
I think I need third-party libraries Allegro (4?)  and gtest. Anything else?


PS: Please tell me I can use a prebuilt version of Allegro and that I won't have to rebuild it myself.
Title: Re: Building solution 'Tests' on windows 10 with Visual Studio 2022
Post by: Crimson Wizard on Mon 08/08/2022 13:24:45
Quote from: Monsieur OUXX on Mon 08/08/2022 13:13:43
I think I need third-party libraries Allegro (4?)  and gtest. Anything else?


PS: Please tell me I can use a prebuilt version of Allegro and that I won't have to rebuild it myself.


We no longer use a separate Allegro library. As of 3.6.0 (and similarly in ags4) we use stripped allegro4 sources, present in the libsrc directory, and link these directly in the project, as necessary.

Spoiler

Allegro4 is known to have a lot of internal dependencies, that make it difficult to link only few files. We did not resolve that yet (but it's still possible to do, probably, by editing the lib sources). So if you add one file there's a chance you'll have to add 10-20 others.
[close]
Title: Re: Building solution 'Tests' on windows 10 with Visual Studio 2022
Post by: Monsieur OUXX on Mon 08/08/2022 13:40:33
Sorry, I don't understand what you're saying. You're saying I need to use allegro.h from libsrc\allegro\include


But I don't need to build Allegro, right? Not even that stripped Allegro? Right?
Title: Re: Building solution 'Tests' on windows 10 with Visual Studio 2022
Post by: Crimson Wizard on Mon 08/08/2022 14:01:37
What I am saying is: we no longer build Allegro as a library. We directly include its files into the project, when and if it is necessary.

If it's included into the project that you are trying to build, then it should be compiled automatically, along with the rest of the project's files.

What is the actual problem you are facing right now, are there any compilation or linking errors?
Title: Re: Building solution 'Tests' on windows 10 with Visual Studio 2022
Post by: Monsieur OUXX on Fri 12/08/2022 18:14:48
Quote from: Crimson Wizard on Mon 08/08/2022 14:01:37
If it's included into the project that you are trying to build, then it should be compiled automatically, along with the rest of the project's files.

Thanks.

Spoiler

New problem: In order to compile, Common.Lib.Test needs to have AGS_PLATFORM_TEST defined. am I supposed to set that manually (and if yes, how? Is it part of a larger configuration process), or am I missing something? (e.g. I'm not supposed to run that project myself but instead let the CI environment run it).

I see that this variable is mentioned in CMakeLists.txt but until now I didn't have to worry about CMake in Visual Studio. I don't even know how they integrate together, to be honest. I'm going to read this : https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=msvc-170&viewFallbackFrom=vs-2019


This problem has disappeared, I don't even know how.
[close]