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

Build error get_property could not find TARGET BCL::NodeJSSocket #3

Open
echoix opened this issue May 13, 2023 · 0 comments
Open

Build error get_property could not find TARGET BCL::NodeJSSocket #3

echoix opened this issue May 13, 2023 · 0 comments

Comments

@echoix
Copy link

echoix commented May 13, 2023

Is it possible that there is missing something that allows to find BCL::NodeJSSocket when rerunning configuration step for sapfor in a dev container?

I get this at the beginning of the command, but the autodetection of clang features continue either way, but the configure step fails, and can't continue building.

root ➜ /workspaces/sapfor/build (download-cmake) $ cmake .. -C ../CMakeCache.in -DPTS_EXECUTABLE=/repo/pts/bin/pts.pl -DLLVM_PROJECT_DIR=/workspaces/root/llvm-project -DBUILD_LINK=ON -DBUILD_CLANG=ON -DBUILD_PROFILE=ON -DBCL_NODEJS_SOCKET=ON
loading initial cache file ../CMakeCache.in
-- Perl version: 5.30.0
CMake Error at build/bcl/bcl/BCLConfig.cmake:54 (get_property):
  get_property could not find TARGET BCL::NodeJSSocket.  Perhaps it has not
  yet been created.
Call Stack (most recent call first):
  analyzers/tsar/CMakeLists.txt:47 (find_package)

I'm not an expert with CMake yet, but I understand from the file bcl/cmake/BCLConfig.cmake.in near lines 54-55 that the target BCL::NodeJSSocket does not seem to be defined like in the "else" branch of the same if.

get_property(BCL_NODEJS_SOCKET_SOURCES TARGET BCL::NodeJSSocket
PROPERTY INTERFACE_SOURCES)

At lines 64-66, there is an alias that defines BCL::NodeJSSocket

if(BCL_NODEJS_SOCKET)
add_library(BCL::NodeJSSocket ALIAS NodeJSSocket)
endif()

if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/BCLExports.cmake)
# ON if BCLExports.cmake is available.
set(BCL_EXPORT ON)
include(${CMAKE_CURRENT_LIST_DIR}/BCLExports.cmake)
# List of headers from the core of BCL.
get_property(BCL_CORE_HEADERS TARGET BCL::Core PROPERTY INTERFACE_SOURCES)
# List of sources from NodeJSSocket (if NodeJSSocket is available).
if(BCL_NODEJS_SOCKET)
get_property(BCL_NODEJS_SOCKET_SOURCES TARGET BCL::NodeJSSocket
PROPERTY INTERFACE_SOURCES)
endif()
else()
# OFF if BCLExports.cmake is not available. For example, if add_subdirectory()
# has been used to add this project to the build tree.
set(BCL_EXPORT OFF)
add_library(BCL::Core ALIAS Core)
if(BCL_NODEJS_SOCKET)
add_library(BCL::NodeJSSocket ALIAS NodeJSSocket)
endif()
# Try to set some variables which is available in BCL build tree. So, the
# following variables will be available if add_subdirectory() has been used
# configure this project.
# List of headers from the core of BCL.
set(BCL_CORE_HEADERS @BCL_CORE_HEADERS@)
# List of sources from NodeJSSocket (if NodeJSSocket is available).
if(BCL_NODEJS_SOCKET)
set(BCL_NODEJS_SOCKET_SOURCES @BCL_NODEJS_SOCKET_SOURCES@)
endif()
endif()

If I add add_library(BCL::NodeJSSocket ALIAS NodeJSSocket) just before get_property(BCL_NODEJS_SOCKET_SOURCES TARGET BCL::NodeJSSocket PROPERTY INTERFACE_SOURCES)

like so:

  # List of sources from NodeJSSocket (if NodeJSSocket is available).
  if(BCL_NODEJS_SOCKET)
    add_library(BCL::NodeJSSocket ALIAS NodeJSSocket)
    get_property(BCL_NODEJS_SOCKET_SOURCES TARGET BCL::NodeJSSocket
      PROPERTY INTERFACE_SOURCES)
  endif()

I seem to be able to get past that configure error, and I'm still waiting to finish building.

Is it a real solution, or does it have some undesired effects?

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

1 participant