Skip to content

NODE_EDITOR_SHARED added to target public definition #409

Open
@RealXuChe

Description

@RealXuChe

I'm trying to use NE2 in my project with the following CMake file:

# Node Editor 2
FetchContent_Declare(
        NodeEditor2
        GIT_REPOSITORY [email protected]:paceholder/nodeeditor.git
        GIT_TAG 2.2.4
)
FUNCTION( NE2_MakeAvailable )
    set(BUILD_TESTING OFF)
    set(BUILD_EXAMPLES OFF)
    set(BUILD_SHARED_LIBS OFF)
    set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
    FetchContent_MakeAvailable(NodeEditor2)
ENDFUNCTION ()
NE2_MakeAvailable()

target_compile_definitions(Designer PRIVATE -DNODE_EDITOR_STATIC)
target_link_libraries(Designer PRIVATE nodes)

However here, NODE_EDITOR_SHARED is defined, making both NODE_EDITOR_SHARED and NODE_EDITOR_STATIC defined.

Compile will then fail:

cmake-build-debug/_deps/nodeeditor2-src/include/nodes/internal/Export.hpp:43:6: 错误:#error "Cannot link against shared and static simultaneously."
   43 | #    error "Cannot link against shared and static simultaneously."
      |      ^~~~~

I don't see why there's a public definition of NODE_EDITOR_SHARED. How can I fix this? Or is this a mistake?

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