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

reduce copy include folder #1377

Merged
merged 2 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@
set_and_check(SVF_INSTALL_ROOT "@PACKAGE_SVF_INSTALL_ROOT@")
set_and_check(SVF_INSTALL_BIN_DIR "@PACKAGE_SVF_INSTALL_BIN_DIR@")
set_and_check(SVF_INSTALL_LIB_DIR "@PACKAGE_SVF_INSTALL_LIB_DIR@")
set_and_check(SVF_INSTALL_INCLUDE_DIR "@PACKAGE_SVF_INSTALL_INCLUDE_DIR@")

set(SVF_INCLUDE_PATH "@PACKAGE_SVF_INSTALL_ROOT@/../svf/include")
set(SVF_LLVM_INCLUDE_PATH "@PACKAGE_SVF_INSTALL_ROOT@/../svf-llvm/include")

if(EXISTS ${SVF_INCLUDE_PATH} AND EXISTS ${SVF_LLVM_INCLUDE_PATH})
set(SVF_INSTALL_INCLUDE_DIR "${SVF_INCLUDE_PATH};${SVF_LLVM_INCLUDE_PATH};@PACKAGE_SVF_INSTALL_INCLUDE_DIR@")
else()
set_and_check(SVF_INSTALL_INCLUDE_DIR "@PACKAGE_SVF_INSTALL_INCLUDE_DIR@")
endif()

message(STATUS "SVF_INSTALL_INCLUDE_DIR is set to: ${SVF_INSTALL_INCLUDE_DIR}")

set_and_check(SVF_INSTALL_EXTAPI_DIR "@PACKAGE_SVF_INSTALL_EXTAPI_DIR@")
set_and_check(SVF_INSTALL_EXTAPI_FILE "@PACKAGE_SVF_INSTALL_EXTAPI_FILE@")
Expand All @@ -21,4 +31,4 @@ set(SVF_CXX_STANDARD "@CMAKE_CXX_STANDARD@")
set(SVF_ENABLE_RTTI "@SVF_ENABLE_RTTI@")
set(SVF_ENABLE_EXCEPTIONS "@SVF_ENABLE_EXCEPTIONS@")

include("${CMAKE_CURRENT_LIST_DIR}/SVFTargets.cmake")

2 changes: 2 additions & 0 deletions .github/workflows/svf-lib_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ jobs:
rm -rf $GITHUB_WORKSPACE/Release-build/bin/*.dot
rm -rf $GITHUB_WORKSPACE/Release-build/bin/*.json
cp -rf $GITHUB_WORKSPACE/Release-build/include SVF-${osVersion}/Release-build/
cp -rf $GITHUB_WORKSPACE/svf/include SVF-${osVersion}/Release-build/
cp -rf $GITHUB_WORKSPACE/svf-llvm/include SVF-${osVersion}/Release-build/
cp -rf $GITHUB_WORKSPACE/Release-build/lib SVF-${osVersion}/Release-build/
cp -rf $GITHUB_WORKSPACE/Release-build/bin SVF-${osVersion}/Release-build/
git add .
Expand Down
10 changes: 0 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,3 @@ install(
${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/SVF/SVFConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/SVF
)

# Install CMake targets from different SVF subprojects so they can be found by find_package(SVF)
install(
EXPORT SVFTargets
FILE SVFTargets.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/SVF
)

# Export targets added to SVFTargets (set by install() command)
export(EXPORT SVFTargets FILE "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/SVF/SVFTargets.cmake")
6 changes: 0 additions & 6 deletions svf-llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ target_sources(SvfLLVM PRIVATE ${SVF_LLVM_SOURCES})

# Get all of the public header files (i.e. all *.h/*.hpp files) for SVF's subprojects and add them
file(GLOB_RECURSE SVF_LLVM_HEADERS include/*.h include/*.hpp)
add_custom_target(CopySVFLLVMIncludeFiles ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/include/
${CMAKE_BINARY_DIR}/include)

target_sources(SvfLLVM
PUBLIC
Expand All @@ -100,8 +96,6 @@ target_sources(SvfLLVM
FILES ${SVF_LLVM_HEADERS}
)

add_dependencies(SvfCore CopySVFLLVMIncludeFiles CopySVFIncludeFiles)

# Add intrinsics_gen target if we're building as part of LLVM source build
if(TARGET intrinsics_gen)
add_dependencies(SvfLLVM intrinsics_gen)
Expand Down
7 changes: 0 additions & 7 deletions svf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,13 @@ target_sources(SvfCore PRIVATE ${SVF_CORE_SOURCES})
# Get all of the public header files (i.e. all *.h/*.hpp files) for SVF's subprojects and add them
file(GLOB_RECURSE SVF_CORE_HEADERS include/*.h include/*.hpp)

add_custom_target(CopySVFIncludeFiles ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/include/
${CMAKE_BINARY_DIR}/include)

target_sources(SvfCore
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include
FILES ${SVF_CORE_HEADERS}
)

add_dependencies(SvfCore CopySVFIncludeFiles)

# Install the headers and compiled libraries (associate SvfCore with the SVF package's targets)
install(
TARGETS SvfCore
Expand Down
Loading