Skip to content

Conversation

@Juff-Ma
Copy link
Contributor

@Juff-Ma Juff-Ma commented Apr 17, 2025

So, this adds the talked about package support for conan and in theory this should work.
However, when I tried using the package it spit out linker errors (tried with tls=True and shared=True, it couldn't find the used functions).
I'm not an expert in conan packaging so maybe the package itself is fine and I did something wrong.

I tried it using the following commands (files below):

  1. conan create . (in webui repo, everything else in the test folder)
  2. conan install . --build="webui/2.5.0-beta.4" -of conan
  3. cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=conan/conan_toolchain.cmake
  4. cmake --build build

main.c:

#include <webui.h>

int main() {

	size_t my_window = webui_new_window();
	webui_show(my_window, "<html><head><script src=\"webui.js\"></script></head> Hello World ! </html>");
	webui_wait();
	return 0;
}

CMakeLists.txt:

cmake_minimum_required(VERSION 3.15)

project(Test)

add_executable(Test
    main.c)

find_package(webui REQUIRED)

include_directories(${webui_INCLUDE_DIRS})

target_link_libraries(Test
    PUBLIC webui::webui)

install(TARGETS Test)

conanfile.txt:

[requires]
webui/2.5.0-beta.4

[generators]
CMakeToolchain
CMakeDeps

[options]
webui/*:shared=True
webui/*:tls=True

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.

1 participant