Skip to content

Some problem of compilation with LLGL_BUILD_STATIC_LIB. #179

@coco875

Description

@coco875

When I enable LLGL_BUILD_STATIC_LIB after an recompilation I get this kind of error:

[build] Undefined symbols for architecture arm64:
[build]   "LLGL::ModuleMetal::GetModuleName()", referenced from:
[build]       LLGL::StaticModules::GetStaticModules() in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build]       LLGL::StaticModules::GetRendererName(LLGL::BasicStringLiteral<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build]       LLGL::StaticModules::GetRendererID(LLGL::BasicStringLiteral<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build]       LLGL::StaticModules::AllocRenderSystem(LLGL::RenderSystemDescriptor const&) in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build]   "LLGL::ModuleMetal::GetRendererID()", referenced from:
[build]       LLGL::StaticModules::GetRendererID(LLGL::BasicStringLiteral<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build]   "LLGL::ModuleMetal::GetRendererName()", referenced from:
[build]       LLGL::StaticModules::GetRendererName(LLGL::BasicStringLiteral<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build]   "LLGL::ModuleMetal::AllocRenderSystem(LLGL::RenderSystemDescriptor const*)", referenced from:
[build]       LLGL::StaticModules::AllocRenderSystem(LLGL::RenderSystemDescriptor const&) in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build]   "LLGL::ModuleOpenGL::GetModuleName()", referenced from:
[build]       LLGL::StaticModules::GetStaticModules() in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build]       LLGL::StaticModules::GetRendererName(LLGL::BasicStringLiteral<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build]       LLGL::StaticModules::GetRendererID(LLGL::BasicStringLiteral<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build]       LLGL::StaticModules::AllocRenderSystem(LLGL::RenderSystemDescriptor const&) in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build]   "LLGL::ModuleOpenGL::GetRendererID()", referenced from:
[build]       LLGL::StaticModules::GetRendererID(LLGL::BasicStringLiteral<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build]   "LLGL::ModuleOpenGL::GetRendererName()", referenced from:
[build]       LLGL::StaticModules::GetRendererName(LLGL::BasicStringLiteral<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build]   "LLGL::ModuleOpenGL::AllocRenderSystem(LLGL::RenderSystemDescriptor const*)", referenced from:
[build]       LLGL::StaticModules::AllocRenderSystem(LLGL::RenderSystemDescriptor const&) in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build]   "LLGL::ModuleVulkan::GetModuleName()", referenced from:
[build]       LLGL::StaticModules::GetStaticModules() in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build]       LLGL::StaticModules::GetRendererName(LLGL::BasicStringLiteral<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build]       LLGL::StaticModules::GetRendererID(LLGL::BasicStringLiteral<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build]       LLGL::StaticModules::AllocRenderSystem(LLGL::RenderSystemDescriptor const&) in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build]   "LLGL::ModuleVulkan::GetRendererID()", referenced from:
[build]       LLGL::StaticModules::GetRendererID(LLGL::BasicStringLiteral<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build]   "LLGL::ModuleVulkan::GetRendererName()", referenced from:
[build]       LLGL::StaticModules::GetRendererName(LLGL::BasicStringLiteral<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build]   "LLGL::ModuleVulkan::AllocRenderSystem(LLGL::RenderSystemDescriptor const*)", referenced from:
[build]       LLGL::StaticModules::AllocRenderSystem(LLGL::RenderSystemDescriptor const&) in libLLGLD.a[66](StaticModuleInterface.cpp.o)
[build] ld: symbol(s) not found for architecture arm6

but when I add

if(LLGL_BUILD_RENDERER_VULKAN)
target_link_libraries(LLGL LLGL_Vulkan)
endif()

if(LLGL_BUILD_RENDERER_OPENGL)
target_link_libraries(LLGL LLGL_OpenGL)
endif()

if(LLGL_BUILD_RENDERER_DIRECT3D11)
target_link_libraries(LLGL LLGL_Direct3D11)
endif()

if(LLGL_BUILD_RENDERER_DIRECT3D12)
target_link_libraries(LLGL LLGL_Direct3D12)
endif()

if(LLGL_BUILD_RENDERER_METAL)
target_link_libraries(LLGL LLGL_Metal)
endif()

in the cmake it's only the first time where it fail with this error:

CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
  "LLGL" of type SHARED_LIBRARY
    depends on "LLGL_OpenGL" (weak)
    depends on "LLGL_Metal" (weak)
  "LLGL_OpenGL" of type SHARED_LIBRARY
    depends on "LLGL" (weak)
    depends on "LLGL_Metal" (weak)
  "LLGL_Metal" of type SHARED_LIBRARY
    depends on "LLGL" (weak)
    depends on "LLGL_OpenGL" (weak)
At least one of these targets is not a STATIC_LIBRARY.  Cyclic dependencies are allowed only among static libraries.
CMake Generate step failed.  Build files cannot be regenerated correctly.

(the log from a ci https://github.com/coco875/test-llgl/actions/runs/13958466925/job/39075057293)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions