-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick private lib changes into release 6.2 (#205)
* Add flag to move libraries under project name (#188) Co-authored-by: Paul Fultz II <pfultz2@yahoo.com> * Turn ROCM_SYMLINK_LIBS OFF by default (#199) * Update RPATH to binaries for PRIVATE lib changes (#197) * Update RPATHs * Remove debug messages and re-indent comments * Use CMP0095 NEW policy for paths and update BIN_INSTALL_DIR paths for private binaries * Remove setting CMP0095 to NEW * Add RPATH to tests to point to private libraries. (#200) * Add RPATH to tests to point to private libraries. * Fix relative path to lib --------- Co-authored-by: Lauren Wrubleski <Lauren.Wrubleski@amd.com> --------- Co-authored-by: Paul Fultz II <pfultz2@yahoo.com> Co-authored-by: Lauren Wrubleski <Lauren.Wrubleski@amd.com>
- Loading branch information
1 parent
5a86281
commit aa86563
Showing
9 changed files
with
140 additions
and
17 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
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,51 @@ | ||
################################################################################ | ||
# Copyright (C) 2024 Advanced Micro Devices, Inc. | ||
################################################################################ | ||
|
||
|
||
cmake_minimum_required (VERSION 3.5) | ||
project(libprivate CXX) | ||
|
||
find_package(ROCmCMakeBuildTools) | ||
|
||
include(ROCMInstallTargets) | ||
include(ROCMPackageConfigHelpers) | ||
include(ROCMSetupVersion) | ||
include(ROCMInstallSymlinks) | ||
include(ROCMCreatePackage) | ||
|
||
rocm_setup_version(VERSION 1.0.0) | ||
|
||
if(ROCM_PREFIX) | ||
rocm_create_package( | ||
NAME simple-private | ||
PREFIX ${ROCM_PREFIX} | ||
MAINTAINER "Amd amd@amd.com" | ||
PTH | ||
LDCONFIG) | ||
else() | ||
rocm_create_package( | ||
NAME simple-private | ||
MAINTAINER "Amd amd@amd.com" | ||
PTH | ||
LDCONFIG) | ||
endif() | ||
|
||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) | ||
|
||
add_library(simple_private simpleprivate.cpp) | ||
#rocm_set_soversion(simple-private 1.1.2) | ||
|
||
add_executable(simple_private_main main.cpp) | ||
target_link_libraries(simple_private_main simple_private) | ||
|
||
if(ROCM_PREFIX) | ||
rocm_install_targets(PRIVATE TARGETS simple_private simple_private_main INCLUDE include PREFIX ${ROCM_PREFIX}) | ||
rocm_export_targets(TARGETS simple_private INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/importtarget.cmake PREFIX ${ROCM_PREFIX}) | ||
rocm_install_symlink_subdir(${ROCM_PREFIX}) | ||
else() | ||
rocm_install_targets(PRIVATE TARGETS simple_private simple_private_main INCLUDE include) | ||
rocm_export_targets(TARGETS simple_private INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/importtarget.cmake) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
This is a placeholder license file for the purposes of testing, and is not the license for this repository or the files | ||
contained in this directory. The license for rocm-cmake (including all files in this directory) can be located at | ||
"https://github.com/RadeonOpenCompute/rocm-cmake/blob/master/LICENSE". |
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,3 @@ | ||
# ###################################################################################################################### | ||
# Copyright (C) 2024 Advanced Micro Devices, Inc. | ||
# ###################################################################################################################### |
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,12 @@ | ||
/******************************************************************************* | ||
* Copyright (C) 2024 Advanced Micro Devices, Inc. | ||
******************************************************************************/ | ||
|
||
|
||
#ifndef GUARD_SIMPLE_PRIVATE_H | ||
#define GUARD_SIMPLE_PRIVATE_H | ||
|
||
void simple_private(); | ||
|
||
|
||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
void simple_private(); | ||
|
||
int main() { | ||
simple_private(); | ||
} |
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,7 @@ | ||
/******************************************************************************* | ||
* Copyright (C) 2024 Advanced Micro Devices, Inc. | ||
******************************************************************************/ | ||
|
||
|
||
void simple_private() | ||
{} |
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,11 @@ | ||
# ###################################################################################################################### | ||
# Copyright (C) 2024 Advanced Micro Devices, Inc. | ||
# ###################################################################################################################### | ||
|
||
install_dir( | ||
${TEST_DIR}/libprivate | ||
CMAKE_ARGS -DROCM_SYMLINK_LIBS=OFF -DROCM_PREFIX=rocm | ||
TARGETS package) | ||
test_expect_file(${PREFIX}/lib/libprivate/include/simpleprivate.h) | ||
test_expect_file(${PREFIX}/lib/libprivate/lib/libsimple_private.a) | ||
install_dir(${TEST_DIR}/libprivate) |