Open Jaskowicz1 opened 3 months ago
Just to add, if you get an abort with an invalid token (if you manage to figure it out or whatnot) when running the .exe, that's normal. Put a try catch around the bot.start()
if you would rather not get an abort.
Another note to add, Conan does generate release versions of all the requirements too.
So it's even more confusing why Debug works here.
If you flip Release for Debug and Debug for Release as you follow the steps, you'll get the same outcome (but ofc flipped so binaries will be in Release).
Hi @Jaskowicz1
Thanks for your report, I am having a look.
I also have some feedback about the branch and the conanfile.py
inside the library-conan
, where should I report it?
Quick feedback about:
Re-run cmake .. -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_BUILD_TYPE=Release
VS is a multi-config generator, and as such CMAKE_BUILD_TYPE
shouldn't be neither defined nor used. This might be related to the issue, I am building the project, but if you can try to drop it and try again to see if it helps, that would be great too.
Thank you for taking a look, @memsharded !
I also have some feedback about the branch and the conanfile.py inside the library-conan, where should I report it?
https://github.com/brainboxdotcc/DPP/pull/1066 would be the best place! That way the feedback is directly on the PR!
VS is a multi-config generator, and as such CMAKE_BUILD_TYPE shouldn't be neither defined nor used. This might be related to the issue, I am building the project, but if you can try to drop it and try again to see if it helps, that would be great too.
I'll certainly give another run without to see what happens!
Some issues that I am seeing:
dpp-10.0
folder:
Installing: C:/Users/..../.conan2/p/b/dpp2166487df2998/p/include/dpp-10.0/dpp/timer.h
-- Installing: C:/Users/.../.conan2/p/b/dpp2166487df2998/p/include/dpp-10.0/dpp/unicode_emoji.h
But the recipe is using the default package_info()
which defaults to include
folder.
The recipe should do something like:
def package_info(self):
self.cpp_info.includedirs = ["include/dpp-10.0"]
Likewise:
-- Installing: C:/Users/.../.conan2/p/b/dpp2166487df2998/p/lib/dpp-10.0/dpp.lib
So something like:
def package_info(self):
self.cpp_info.includedirs = ["include/dpp-10.0"]
self.cpp_info.libdirs= ["lib/dpp-10.0"]
I'd suggest to have a look to https://docs.conan.io/2/tutorial/creating_packages/define_package_information.html
Also, Conan has a built-in functionality, the test_package
that automatically runs this check without having to have another separate project to test that it has been correctly packaged. Please check https://docs.conan.io/2/tutorial/creating_packages/test_conan_packages.html. You can start from the conan new cmake_lib -d name=mypkg -d version=0.1
to have a fully working package and test_package
.
Describe the bug
OS: Windows 11 Compiler: Visual Studio 17 2022 (MSVC 19.38.33130.0, MSBuild version 17.8.3+195e7f5a3) Conan Ver: 2.2.2 Conan profiles: default
When creating a test project to use D++ with Conan, I end up having to build in Debug even though I setup the project for Release (I really don't know how to word this any other way, it's massively confusing). I also have to remove part of
cmakedeps_macros.cmake
to even let Conan find D++, because it just can't find it?How to reproduce it
Step 1) Clone D++ from an in-progress PR: https://github.com/MikeRavenelle/DPP Step 2) Switch to the
conan_support
branch and pull it. Step 3) Runcd library-conan
Step 4) Changedef generate(self)
in theconanfile.py
to:Yes, this step is required. They haven't updated their PR to include this yet, so without
BUILD_SHARED_LIBS
as false, Conan will double include ZLib (I have no idea why). Step 5) Commit it so Conan doesn't shout about the package being dirty (you can't push it, but this just shuts up Conan). Step 6) Runconan create .
Step 7) Let Conan do it's thing Step 8) Go to a different folder (for now, let's sayDocuments
) and make a new sample project (mkdir test_proj
will do) with the following:CMakeLists.txt
,conanfile.txt
, andmain.cpp
. These files should have the following contents:CMakeLists.txt
:conanfile.txt
:main.cpp
:Step 9) Run
conan install . --output-folder=build --build=missing -s build_type=Release
. Step 10) Runcd build
. Step 11) Runcmake .. -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_BUILD_TYPE=Release
and notice how dpp can't be found (Please address this too!).The next step addresses how to fix this issue in a very hacky and bad way, but I assume might be the cause of the whole Release makes Debug and so on.
Step 12) Edit
cmakedeps_macros.cmake
and navigate to line 23. Strip thefind_library
down tofind_library(CONAN_FOUND_LIBRARY NAMES ${_LIBRARY_NAME} PATHS ${package_libdir})
and move the entire if statement outside the if statement. It should look like this below:Step 13) Re-run
cmake .. -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_BUILD_TYPE=Release
and notice how there's no issues anymore. Step 14) Runcd ..
Step 15) Runcmake --build build --config Release
and notice theLINK : fatal error LNK1181: cannot open input file 'CONAN_FOUND_LIBRARY-NOTFOUND.obj'
error. Step 16) Runcmake --build build --config Debug
and notice no error (However, everything we did, was for release!). Step 17) Runcd build
,cd Debug
. Step 18) Runls
(or whatever the equivelent is for command prompt, I use powershell) and notice how all the files are there!