-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
134 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. | ||
|
||
# | ||
# The clambctrace object library | ||
# | ||
add_library(clambctrace_obj OBJECT) | ||
target_sources(clambctrace_obj | ||
PRIVATE | ||
ClamBCTrace.cpp | ||
) | ||
|
||
target_include_directories(clambctrace_obj | ||
PRIVATE | ||
${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) | ||
. # For Common/clambc.h | ||
.. # For clambc.h #TODO: change all passes to use "Common" and then delete this line. | ||
${LLVM_INCLUDE_DIRS} | ||
) | ||
|
||
set_target_properties(clambctrace_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") | ||
|
||
# | ||
# For testing | ||
# | ||
#target_compile_definitions(clambctrace_obj -DLOG_BEFORE_AFTER=1) | ||
|
||
# | ||
# The clambctrace shared library. | ||
# | ||
add_library( clambctrace SHARED ) | ||
target_link_libraries( clambctrace | ||
PUBLIC | ||
clambctrace_obj ) | ||
set_target_properties( clambctrace PROPERTIES | ||
VERSION ${LIBCLAMBC_VERSION} | ||
SOVERSION ${LIBCLAMBC_SOVERSION} ) | ||
|
||
target_link_directories(clambctrace PRIVATE ${LLVM_LIBRARY_DIRS}) | ||
target_link_libraries(clambctrace PUBLIC ${LLVM_LIBS}) | ||
|
||
if(WIN32) | ||
install(TARGETS clambctrace DESTINATION .) | ||
|
||
# Also install shared library (DLL) dependencies | ||
install(CODE [[ | ||
file(GET_RUNTIME_DEPENDENCIES | ||
LIBRARIES | ||
$<TARGET_FILE:clambctrace> | ||
RESOLVED_DEPENDENCIES_VAR _r_deps | ||
UNRESOLVED_DEPENDENCIES_VAR _u_deps | ||
DIRECTORIES | ||
${LLVM_LIBRARY_DIRS} | ||
) | ||
foreach(_file ${_r_deps}) | ||
string(TOLOWER ${_file} _file_lower) | ||
if(NOT ${_file_lower} MATCHES "c:[\\/]windows[\\/]system32.*") | ||
file(INSTALL | ||
DESTINATION "${CMAKE_INSTALL_PREFIX}" | ||
TYPE SHARED_LIBRARY | ||
FOLLOW_SYMLINK_CHAIN | ||
FILES "${_file}" | ||
) | ||
endif() | ||
endforeach() | ||
#message("UNRESOLVED_DEPENDENCIES_VAR: ${_u_deps}") | ||
]]) | ||
else() | ||
install(TARGETS clambctrace DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
endif() | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters