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

🔧 Use conan_provider for running conan #3203

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

AnotherFoxGuy
Copy link
Member

This PR removes the vendored conan profiles and replaces them with the conan_provider.cmake script
With this PR you no longer have to invoke conan install manually

How to build on Windows:

  1. Generate VS studio files: cmake . -G"Visual Studio 16 2019" -Bbuild -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=cmake/conan_provider.cmake
  2. Open the Rigs_of_Rods.sln file in the build folder and switch the config to Release
  3. Build the game as usual

How to build on Linux:

  1. Generate ninja files: cmake . -GNinja -DCMAKE_BUILD_TYPE=Release -Bbuild -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=cmake/conan_provider.cmake
  2. cd into the build folder
  3. Build the game: ninja

@ohlidalp
Copy link
Member

ohlidalp commented Dec 25, 2024

I've tested with this script:

conan remote add ror-conan https://git.anotherfoxguy.com/api/packages/rorbot/conan

cmake^
    -S "%USERPROFILE%/hobby/source/rigs-of-rods"^
    -B "%USERPROFILE%/hobby/builds/rigs-of-rods"^
    -G "Visual Studio 17 2022"^
    -D "CMAKE_PROJECT_TOP_LEVEL_INCLUDES=%USERPROFILE%/hobby/source/rigs-of-rods/cmake/conan_provider.cmake"

It seems to work OK, but I'm getting stuck at the same problem as in recent months - jasper refuses to build, looks like a problem with C headers, all errors originate in 'vcruntime_c11_stdatomic.h' or 'jas_thread.h' and there is so many it fills my console scrollback history (I tried both plain cmd and Visual Studio Developer Prompt):

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\vcruntime_c11_stdatomic.h(122,1): error C2059: syntax error: '}' [C:\Users\ohlidalp\.conan2\p\b\jaspe9cb257e97ed19\b\build\src\libjasper\libjasper.vcxproj]
  (compiling source file '../../../src/src/libjasper/ras/ras_enc.c')


jasper/4.0.0: ERROR:
Package '4988a029ea6bb1f509924e7202f3725d51c8ede0' build failed
jasper/4.0.0: WARN: Build folder C:\Users\ohlidalp\.conan2\p\b\jaspe9cb257e97ed19\b\build
ERROR: jasper/4.0.0: Error in build() method, line 92
        cmake.build()
        ConanException: Error 1 while executing
CMake Error at cmake/conan_provider.cmake:483 (message):
  Conan install failed='1'
Call Stack (most recent call first):
  cmake/conan_provider.cmake:595 (conan_install)
  cmake/DependenciesConfig.cmake:3 (find_package)
  CMakeLists.txt:111 (include)


-- Configuring incomplete, errors occurred!

@AnotherFoxGuy
Copy link
Member Author

@ohlidalp I've updated the jasper pkg, that should fix the build issue with VS 2022

@ohlidalp
Copy link
Member

ohlidalp commented Dec 25, 2024

It works now, I tested Debug,Release,RelWithDebInfo.

I checked https://github.com/RigsOfRods/rigs-of-rods/wiki/Compile-(Windows) and I think it needs just 2 tweaks:

  • Add Conan remote: conan remote add ror-conan https://git.anotherfoxguy.com/api/packages/rorbot/conan
  • Add CMake option: "CMAKE_PROJECT_TOP_LEVEL_INCLUDES=rigs-of-rods/cmake/conan_provider.cmake"

@ohlidalp
Copy link
Member

@AnotherFoxGuy we should update wiki build instructions after merging this - check my previous post please.

Copy link
Member

@ohlidalp ohlidalp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greenlit for merging when ready. The build instructions can be updated later (minor changes anyway).

@AnotherFoxGuy
Copy link
Member Author

The build instructions can be updated later

Ive already updated those: https://github.com/RigsOfRods/rigs-of-rods/wiki/Compile-(Windows)#running-cmake

@ohlidalp ohlidalp merged commit c4d229a into RigsOfRods:master Jan 8, 2025
2 checks passed
@AnotherFoxGuy AnotherFoxGuy deleted the conan_provider branch January 8, 2025 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants