Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NODE_EDITOR_SHARED added to target public definition #409

Open
RealXuChe opened this issue Feb 14, 2024 · 2 comments
Open

NODE_EDITOR_SHARED added to target public definition #409

RealXuChe opened this issue Feb 14, 2024 · 2 comments

Comments

@RealXuChe
Copy link
Contributor

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?

@paceholder
Copy link
Owner

paceholder commented Feb 14, 2024 via email

@paceholder
Copy link
Owner

paceholder commented Feb 14, 2024 via email

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

No branches or pull requests

2 participants