-
Notifications
You must be signed in to change notification settings - Fork 752
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Generate and install stripped PDBs for SYCL libraries (#4915)
Adds stripped PDB files for SYCL library and the PI plugins when building with MSVC. Full PDB files will also be generated, but only the stripped variants will be installed. The stripped PDB files will only be generated and installed if the used linker supports the /PDBSTRIPPED options. LLD does not currently support this option. If the stripped PDB is not generated, no PDB files are installed for the SYCL libraries and PI plugins. Signed-off-by: Steffen Larsen <steffen.larsen@intel.com>
- Loading branch information
1 parent
0d9b4ae
commit 6e5dd48
Showing
7 changed files
with
41 additions
and
0 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,21 @@ | ||
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") | ||
include(LLVMCheckLinkerFlag) | ||
|
||
# add_stripped_pdb(TARGET_NAME) | ||
# | ||
# Will add option for generating stripped PDB file and install the generated | ||
# file as ${ARG_TARGET_NAME}.pdb in bin folder. | ||
# NOTE: LLD does not currently support /PDBSTRIPPED so the PDB file is optional. | ||
macro(add_stripped_pdb ARG_TARGET_NAME) | ||
llvm_check_linker_flag(CXX "/PDBSTRIPPED:${ARG_TARGET_NAME}.stripped.pdb" | ||
LINKER_SUPPORTS_PDBSTRIPPED) | ||
if(LINKER_SUPPORTS_PDBSTRIPPED) | ||
target_link_options(${ARG_TARGET_NAME} | ||
PRIVATE "/PDBSTRIPPED:${ARG_TARGET_NAME}.stripped.pdb") | ||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${ARG_TARGET_NAME}.stripped.pdb" | ||
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin | ||
RENAME "${ARG_TARGET_NAME}.pdb" | ||
COMPONENT ${ARG_TARGET_NAME} | ||
OPTIONAL) | ||
endif() | ||
endmacro() |
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
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
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