Closed AntonioCS closed 3 years ago
Same issue I posted on simdjson repository: https://github.com/simdjson/simdjson/issues/1375
The simdjson library definitively support Microsoft Visual Studio Community 2019 under a 64-bit Windows.
Here is the relevant code in our CMake build...
option(SIMDJSON_ENABLE_THREADS "Link with thread support" ON)
if(SIMDJSON_ENABLE_THREADS)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
target_link_libraries(simdjson-flags INTERFACE Threads::Threads)
target_link_libraries(simdjson-flags INTERFACE ${CMAKE_THREAD_LIBS_INIT})
target_compile_options(simdjson-flags INTERFACE ${CMAKE_THREAD_LIBS_INIT})
target_compile_definitions(simdjson-flags INTERFACE SIMDJSON_THREADS_ENABLED=1) # This will be set in the code automatically.
endif()
Ping @myd7349
@JonLiu1993 Posted an issue downstream regarding the port.
https://github.com/simdjson/simdjson/issues/1383
It seems that provided CMake instructions are incorrect.
The following works for me:
cmake_minimum_required(VERSION 3.0)
project(test)
add_executable(test test.cpp)
find_package(simdjson CONFIG REQUIRED)
find_package(Threads REQUIRED)
target_link_libraries(test PRIVATE simdjson::simdjson)
The provided instructions do not make sense to me. For example, simdjson::simdjson-source
does not get installed (nor should it), so I do not see how you could establish a dependency with this target.
@lemire That is an automatically generated usage extracted from the provided targets in the simdjson-config.cmake. As it seems simdjson exports a lot of targets which are unnecessary to be exported or even unuseable if exported. The only reason they are getting exported is because of the misuse of targets in simdjson and cmake giving and error otherwise.
@Neumann-A Ah. Let us see what we can do about that.
I am confident that we will resolve whatever we have to resolve upstream with release 0.8.
I am confident that we will resolve whatever we have to resolve upstream with release 0.8.
thank you for the help
Release 0.8 is out. It should solve this issue.
@lemire ,Thank you for your effort. I will update to the latest version for local testing. I will close the issue after success.
Solved by #17200
Describe the bug I installed
simdjson
(x64) and when I add the provided Cmake config to my CMakeLists.txtI get the following error:
I reported this in the vcpkg channel and @Neumann-A mentioned that it might be missing
find_dependency(Threads)
insimdjsonConfig.cmake
Environment
To Reproduce Steps to reproduce the behavior:
LINK : fatal error LNK1104: cannot open file 'Threads::Threads.lib'
in msvc ouput paneExpected behavior For it to compile without issues
Additional context Switched to
rapidjson
so I there is no urgency :relaxed: