SoftwareNetwork / sw

Software Manager. Build System, Build System Generator and Package Manager. C/C++ and other languages. Tools and libraries for Software Management.
https://software-network.org
Other
118 stars 24 forks source link

lua not built when adding sol2 dependency #126

Closed pschlan closed 9 months ago

pschlan commented 9 months ago

Describe the bug

When adding sol2 to my cmake project, sw doesn't automatically build lua and the build fails.

set(SOL2_DEPENDENCY
    org.sw.demo.thephd.sol2-3.3.1
)
find_package(SW REQUIRED)
sw_add_package(${SOL2_DEPENDENCY})
sw_execute()

# ...

target_link_libraries(${NAME}
PRIVATE
  ${SOL2_DEPENDENCY}
)

Failure:

ninja: error: 'C:/Users/Jenkins/.sw/storage/pkg/a6/f7/bcad/obj/bld/295576/lib/org.sw.demo.lua-5.4.6.lib', needed by 'TestRunner/TestRunner.exe', missing and no known rule to make it

This can be worked around by building lua manually first:

sw.exe build -static-build org.sw.demo.lua-5.4.6

In .sw/cmake/sw.txt and .sw/cmake/deps/*, there is no line for org.sw.demo.lua-5.4.6.

However I do see a declared dependency in .sw/cmake/CMakeLists.txt:

target_link_libraries(org.sw.demo.thephd.sol2-3.3.1 INTERFACE org.sw.demo.lua-5.4.6)
target_link_libraries(org.sw.demo.thephd.sol2-3.3.1 INTERFACE org.sw.demo.lua-5.4.6)

(It's actually there twice, no copy&paste error.)

Expected behavior I would expect sw to build the lua dependency automatically.

To Reproduce Steps to reproduce the behavior:

Information:

egorpugin commented 9 months ago

Hi,

Please try this exe. I will publish general release later.

sw.zip

pschlan commented 9 months ago

Seems this did the trick, thanks a lot! May I ask what the issue was? (Just curious.)

egorpugin commented 9 months ago

Dependencies of header only libraries were not built. See commit https://github.com/SoftwareNetwork/sw/commit/e0b66ba84e5245070e1b6b5f6aebae5cf1919a6a