Skip to content

Apparently cannot use libDaScript with CMake, when this is built as a dependency #1143

@Zetelias

Description

@Zetelias

Hey, i am trying to emb dascript in my C++ application, but it gives linker errors. Since i could not find help on how to set up daScript in your C++ application with CMake, i am unsure wether the problem is on my side or on the daScript side. Regardless, i am submitting the issue.

My CMakeLists.txt file looks like that:

cmake_minimum_required(VERSION 3.15)
project(lengin CXX)



add_executable(lengin src/lengin.cpp src/main.cpp)

# Use the daScript library in the daScript subdirectory
set(DAS_AOT_EXAMPLES_DISABLED ON)
set(DAS_TUTORIAL_DISABLED ON)
set(DAS_TESTS_DISABLED ON)
set(DAS_GLFW_DISABLED ON)
set(DAS_PROFILE_DISABLED ON)
add_subdirectory(daScript)

target_link_libraries(lengin PRIVATE libDaScript)

install(TARGETS lengin DESTINATION "."
        RUNTIME DESTINATION bin
        ARCHIVE DESTINATION lib
        LIBRARY DESTINATION lib
        )

And the error i get is
LINK : fatal error LNK1104: cannot open file 'libDaScriptTest.lib'
It's also the same with MSVC in Visual Studio.

Surprising as i did tell it to disable tests (wouldnt compile otherwise).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions