conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
950 stars 1.73k forks source link

[package] enet/1.3.17: Include flags not present in meson build system #21261

Closed CODESOLE closed 10 months ago

CODESOLE commented 10 months ago

Description

I am using Meson + Ninja with VSBuildTools to compile. When building with enet and include enet/enet.h into main.c. It complaint about fatal error C1083: Cannot open include file: 'enet/enet.h': No such file or directory and when i look compile_commands.json there are two other libraries include flags but no enet library. When i look ~/.conan2/p/enet... it's been built there but not included.

Package and Environment Details

Conan profile

Host profile: [settings] arch=x86_64 build_type=Release compiler=msvc compiler.cppstd=14 compiler.runtime=dynamic compiler.runtime_type=Release compiler.version=193 os=Windows

Build profile: [settings] arch=x86_64 build_type=Release compiler=msvc compiler.cppstd=14 compiler.runtime=dynamic compiler.runtime_type=Release compiler.version=193 os=Windows

Steps to reproduce

Windows batch command:

conan install . --output-folder=build\debug --build=missing -s build_type=Debug &&^
cd build\debug &&^
meson setup --native-file conan_meson_native.ini ..\.. meson-src &&^
meson compile -C meson-src &&^

Logs

Click to expand log ``` ======== Input profiles ======== Profile host: [settings] arch=x86_64 build_type=Debug compiler=msvc compiler.cppstd=14 compiler.runtime=dynamic compiler.runtime_type=Debug compiler.version=193 os=Windows Profile build: [settings] arch=x86_64 build_type=Release compiler=msvc compiler.cppstd=14 compiler.runtime=dynamic compiler.runtime_type=Release compiler.version=193 os=Windows ======== Computing dependency graph ======== Graph root conanfile.txt: C:\Users\serce\Documents\Github\wolox\conanfile.txt Requirements enet/1.3.17#57c0ba98cdd9a7c4e3e61eb76e0f2930 - Cache glfw/3.3.8#545c12c3dd621f4cb64d5d8c5f469293 - Cache opengl/system#b29589c04d6df84c110d6acb066ab653 - Cache raylib/4.0.0#a43b6e8856fb1693c7f9baa4cb3bddf8 - Cache ======== Computing necessary packages ======== Requirements enet/1.3.17#57c0ba98cdd9a7c4e3e61eb76e0f2930:ed44dacde2751b398e4bf9441ff992a70c913c00#79d6faa0d767ee80dc81bc892aa57e 81 - Cache glfw/3.3.8#545c12c3dd621f4cb64d5d8c5f469293:e33ea92493b9598cbe77e2793ea141a7e46a7ca1#157d498a34f03e8ad54ad4110375814 1 - Cache opengl/system#b29589c04d6df84c110d6acb066ab653:da39a3ee5e6b4b0d3255bfef95601890afd80709#0ba8627bd47edc3a501e8f0eb9a7 9e5e - Cache raylib/4.0.0#a43b6e8856fb1693c7f9baa4cb3bddf8:abf5843de3c4c0d915174754e359d407ed70ab04#afd31a57d63f32f8039089812dc5b 832 - Cache ======== Installing packages ======== enet/1.3.17: Already installed! (1 of 4) opengl/system: Already installed! (2 of 4) glfw/3.3.8: Already installed! (3 of 4) raylib/4.0.0: Already installed! (4 of 4) WARN: deprecated: Usage of deprecated Conan 1.X features that will be removed in Conan 2.X: WARN: deprecated: 'cpp_info.filenames' used in: glfw/3.3.8, opengl/system WARN: deprecated: 'cpp_info.names' used in: glfw/3.3.8 WARN: deprecated: 'cpp_info.build_modules' used in: glfw/3.3.8, raylib/4.0.0 ======== Finalizing install (deploy, generators) ======== conanfile.txt: Writing generators to C:\Users\serce\Documents\Github\wolox\build\debug conanfile.txt: Generator 'MesonToolchain' calling 'generate()' conanfile.txt: Generator 'PkgConfigDeps' calling 'generate()' conanfile.txt: Generating aggregated env files conanfile.txt: Generated aggregated env files: ['conanbuild.bat', 'conanrun.bat'] Install finished successfully Directory already configured. Just run your build command (e.g. ninja) and Meson will regenerate as necessary. If ninja fails, run "ninja reconfigure" or "meson setup --reconfigure" to force Meson to regenerate. If build failures persist, run "meson setup --wipe" to rebuild from scratch using the same options as passed when configuring the build. To change option values, run "meson configure" instead. Activating VS 17.8.0 INFO: automatically activated MSVC compiler environment INFO: autodetecting backend as ninja INFO: calculating backend command to run: "C:\Program Files\Meson\ninja.EXE" -C C:/Users/serce/Documents/Github/wolox/bu ild/debug/meson-src ninja: Entering directory `C:/Users/serce/Documents/Github/wolox/build/debug/meson-src' [0/1] Regenerating build files.The Meson build system Version: 1.2.2 Source dir: C:\Users\serce\Documents\Github\wolox Build dir: C:\Users\serce\Documents\Github\wolox\build\debug\meson-src Build type: native build Project name: wolox Project version: 0.1.0 C compiler for the host machine: cl (msvc 19.38.33130 "x64 için Microsoft (R) C/C++ İyileştirmeli Derleyicisi Sürüm 19.3 8.33130") C linker for the host machine: link link 14.38.33130.0 Host machine cpu family: x86_64 Host machine cpu: x86_64 Dependency raylib found: YES 4.0.0 (cached) Library m found: NO Build targets in project: 1 wolox 0.1.0 User defined options Native files: C:\Users\serce\Documents\Github\wolox\build\debug\conan_meson_native.ini Found ninja-1.11.1 at "C:\Program Files\Meson\ninja.EXE" Cleaning... 0 files. [1/2] Compiling C object wolox.exe.p/src_main.c.obj FAILED: wolox.exe.p/src_main.c.obj "cl" "-Iwolox.exe.p" "-I." "-I..\..\.." "-I..\..\..\src" "-IC:/Users/serce/.conan2/p/b/raylid97a5b24f62eb/p/include" "-I C:/Users/serce/.conan2/p/b/glfwafdae0b9c0d75/p/include" "/MDd" "/nologo" "/showIncludes" "/utf-8" "/W4" "/Od" "/Zi" "/D_ CRT_SECURE_NO_WARNINGS" "/Fdwolox.exe.p\src_main.c.pdb" /Fowolox.exe.p/src_main.c.obj "/c" ../../../src/main.c ../../../src/main.c(20): fatal error C1083: Cannot open include file: 'enet/enet.h': No such file or directory ninja: build stopped: subcommand failed. ```
SpaceIm commented 10 months ago

Likely an issue in your conanfile (no PkgConfigDeps) and/or your meson build file (no logic to find dependencies with pkgconfig files), and unlikely a conancenter issue.

CODESOLE commented 10 months ago

conanfile.txt:

[requires]
raylib/4.0.0
enet/1.3.17

[generators]
PkgConfigDeps
MesonToolchain

meson.build:

project(
  'wolox',
  'c',
  version : '0.1.0',
  license : 'MIT',
  default_options: ['default_library=static', 'warning_level=3'],
)

cc = meson.get_compiler('c')
if cc.get_id() == 'msvc'
  add_global_arguments('/D_CRT_SECURE_NO_WARNINGS', language : 'c')
endif

raylib = dependency('raylib')
enet = dependency('enet')

m_dep = cc.find_library('m', required : false)

source_files = [
  'src/main.c',
]

executable('wolox', sources: source_files,
           win_subsystem: 'windows',
           include_directories: include_directories('src'),
           dependencies: [raylib, enet, m_dep])

failing output:

ninja: Entering directory `C:/Users/serce/Documents/Github/wolox/build/debug/meson-src'
[0/1] Regenerating build files.The Meson build system
Version: 1.2.2
Source dir: C:\Users\serce\Documents\Github\wolox
Build dir: C:\Users\serce\Documents\Github\wolox\build\debug\meson-src
Build type: native build
Project name: wolox
Project version: 0.1.0
C compiler for the host machine: cl (msvc 19.38.33130 "x64 Microsoft (R) C/C++ version: 19.38.33130")
C linker for the host machine: link link 14.38.33130.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Dependency raylib found: YES 4.0.0 (cached)
Found pkg-config: C:\Users\serce\AppData\Local\Microsoft\WinGet\Packages\bloodrock.pkg-config-lite_Microsoft.Winget.Sour
ce_8wekyb3d8bbwe\pkg-config-lite-0.28-1\bin\pkg-config.EXE (0.28)
Found CMake: C:\Program Files\CMake\bin\cmake.EXE (3.27.7)
Run-time dependency enet found: NO (tried pkgconfig and cmake)

..\..\..\meson.build:15:7: ERROR: Dependency "enet" not found, tried pkgconfig and cmake

A full log can be found at C:\Users\serce\Documents\Github\wolox\build\debug\meson-src\meson-logs\meson-log.txt
ninja: error: rebuilding 'build.ninja': subcommand failed

FAILED: build.ninja
"C:\Program Files\Meson\meson.exe" "--internal" "regenerate" "C:\Users\serce\Documents\Github\wolox" "."

Am I missing something ?

SpaceIm commented 10 months ago

Yes, pkgconfig name of enet is libenet.

CODESOLE commented 10 months ago

thx solved