Skip to content

Commit

Permalink
Update installation paths
Browse files Browse the repository at this point in the history
Rename library to `libamd_comgr.so` for consistentcy with the header and
to differentiate it as an AMD library.

Remove redundant `comgr` subdirectory in `include/`

Move installed documentation from `comgr/` to `share/comgr/` to try to
bring it closer to the linux standards base.

Change-Id: I418e112667546d675688a00a6a5c5e201c5efdcd
  • Loading branch information
slinder1 committed Sep 20, 2018
1 parent 31f1935 commit 3d5bd38
Show file tree
Hide file tree
Showing 20 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Code Object Manager

The Code Object Manager is a shared library which provides operations for
creating and inspecting code objects. See the documentation in the header file
`lib/comgr/include/comgr/amd_comgr.h`
`lib/comgr/include/amd_comgr.h`

License
-------
Expand Down
18 changes: 9 additions & 9 deletions lib/comgr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,26 @@ endif()
add_definitions(-DAMD_EXPORT)

file(GLOB SOURCES "src/*.cpp")
add_library(comgr SHARED ${SOURCES})
add_library(amd_comgr SHARED ${SOURCES})

install(
TARGETS
comgr
amd_comgr
DESTINATION lib
)

install(
FILES
"include/comgr/amd_comgr.h"
DESTINATION include/comgr
"include/amd_comgr.h"
DESTINATION include
)

install(
FILES
"README.md"
"LICENSE.txt"
"NOTICES.txt"
DESTINATION comgr
DESTINATION share/amd_comgr
)

set(YAML_CPP_BUILD_TESTS OFF CACHE BOOL "Enable testing" FORCE)
Expand Down Expand Up @@ -134,22 +134,22 @@ llvm_map_components_to_libnames(LLVM_LIBS
Coroutines
)

target_link_libraries(comgr ${LINKER_OPTS}
target_link_libraries(amd_comgr ${LINKER_OPTS}
yaml-cpp
${CLANG_LIBS}
${LLD_LIBS}
${LLVM_LIBS}
)

if (NOT UNIX)
target_link_libraries(comgr version)
target_link_libraries(amd_comgr version)
endif()

enable_testing()
add_subdirectory(test)

# Add packaging directives for comgr
set(CPACK_PACKAGE_NAME comgr)
# Add packaging directives for amd_comgr
set(CPACK_PACKAGE_NAME amd_comgr)
set(CPACK_PACKAGE_VENDOR "AMD")
set(CPACK_PACKAGE_VERSION_MAJOR 0)
set(CPACK_PACKAGE_VERSION_MINOR 0)
Expand Down
2 changes: 1 addition & 1 deletion lib/comgr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Code Object Manager (Comgr)
===========================

The Comgr library provides APIs for compiling and inspecting AMDGPU code
objects. The API is documented in the [header file](include/comgr/amd_comgr.h).
objects. The API is documented in the [header file](include/amd_comgr.h).

Build the Code Object Manager
-----------------------------
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/comgr/src/comgr-msgpack.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#define COMGR_MSGPACK_H

#include "MsgPackReader.h"
#include "comgr/amd_comgr.h"
#include "amd_comgr.h"
#include "llvm/Support/Casting.h"
#include <map>
#include <memory>
Expand Down
2 changes: 1 addition & 1 deletion lib/comgr/src/comgr-symbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include "llvm/Object/Archive.h"
#include "llvm/Object/ELFObjectFile.h"
#include "llvm/Object/SymbolSize.h"
#include "comgr/amd_comgr.h"
#include "amd_comgr.h"

using namespace llvm;
using namespace llvm::support;
Expand Down
2 changes: 1 addition & 1 deletion lib/comgr/src/comgr-symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#ifndef COMGR_SYMBOL_H_
#define COMGR_SYMBOL_H_

#include "comgr/amd_comgr.h"
#include "amd_comgr.h"
#include "llvm/Object/ObjectFile.h"

using namespace llvm::object;
Expand Down
2 changes: 1 addition & 1 deletion lib/comgr/src/comgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

#include "comgr-msgpack.h"
#include "comgr-symbol.h"
#include "comgr/amd_comgr.h"
#include "amd_comgr.h"
#include "yaml-cpp/yaml.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallVector.h"
Expand Down
24 changes: 12 additions & 12 deletions lib/comgr/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,57 +37,57 @@ add_definitions(-DTEST_OBJ_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\")

# Test : Data Objects and Data Set
add_executable(data_test data_test.c)
target_link_libraries(data_test comgr)
target_link_libraries(data_test amd_comgr)
add_test(NAME data_test COMMAND data_test)

# Test : Disassembly of relocatable ELF
add_executable(disasm_llvm_reloc_test disasm_llvm_reloc_test.c)
target_link_libraries(disasm_llvm_reloc_test comgr)
target_link_libraries(disasm_llvm_reloc_test amd_comgr)
add_test(NAME disasm_llvm_reloc_test COMMAND disasm_llvm_reloc_test)

# Test : Disassembly of shared object ELF
add_executable(disasm_llvm_so_test disasm_llvm_so_test.c)
target_link_libraries(disasm_llvm_so_test comgr)
target_link_libraries(disasm_llvm_so_test amd_comgr)
add_test(NAME disasm_llvm_so_test COMMAND disasm_llvm_so_test)

# Test : TP-Metadata (Metadata properties for a target)
add_executable(metadata_tp_test metadata_tp_test.c)
target_link_libraries(metadata_tp_test comgr)
target_link_libraries(metadata_tp_test amd_comgr)
add_test(NAME metadata_tp_test COMMAND metadata_tp_test)

# Test : Metadata YAML (Metadata of a code object)
add_executable(metadata_yaml_test metadata_yaml_test.c)
target_link_libraries(metadata_yaml_test comgr)
target_link_libraries(metadata_yaml_test amd_comgr)
add_test(NAME metadata_yaml_test COMMAND metadata_yaml_test)

# Test : Symbols
add_executable(symbols_test symbols_test.c)
target_link_libraries(symbols_test comgr)
target_link_libraries(symbols_test amd_comgr)
add_test(NAME symbols_test COMMAND symbols_test)

# Test : Iterate Symbols
add_executable(symbols_iterate_test symbols_iterate_test.c)
target_link_libraries(symbols_iterate_test comgr)
target_link_libraries(symbols_iterate_test amd_comgr)
add_test(NAME symbols_iterate_test COMMAND symbols_iterate_test)

# Test : Compile
add_executable(compile_test compile_test.c)
target_link_libraries(compile_test comgr)
target_link_libraries(compile_test amd_comgr)
add_test(NAME compile_test COMMAND compile_test)

# Test : Compile Minimal
add_executable(compile_minimal_test compile_minimal_test.c)
target_link_libraries(compile_minimal_test comgr)
target_link_libraries(compile_minimal_test amd_comgr)
add_test(NAME compile_minimal_test COMMAND compile_minimal_test)

# Test : Assemble
add_executable(assemble_test assemble_test.c)
target_link_libraries(assemble_test comgr)
target_link_libraries(assemble_test amd_comgr)
add_test(NAME assemble_test COMMAND assemble_test)

# Test : Linking
add_executable(link_test link_test.c)
target_link_libraries(link_test comgr)
target_link_libraries(link_test amd_comgr)
add_test(NAME link_test COMMAND link_test)

# Windows binaries have no equivalent to -rpath, so we must set their PATH to
Expand All @@ -105,5 +105,5 @@ if (NOT(UNIX))
compile_minimal_test
assemble_test
link_test
PROPERTIES ENVIRONMENT "PATH=$<TARGET_LINKER_FILE_DIR:comgr>")
PROPERTIES ENVIRONMENT "PATH=$<TARGET_LINKER_FILE_DIR:amd_comgr>")
endif()
2 changes: 1 addition & 1 deletion lib/comgr/test/assemble_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
*******************************************************************************/

#include "comgr/amd_comgr.h"
#include "amd_comgr.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/comgr/test/compile_minimal_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
*******************************************************************************/

#include "comgr/amd_comgr.h"
#include "amd_comgr.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/comgr/test/compile_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
*******************************************************************************/

#include "comgr/amd_comgr.h"
#include "amd_comgr.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/comgr/test/data_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
*******************************************************************************/

#include "comgr/amd_comgr.h"
#include "amd_comgr.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/comgr/test/disasm_llvm_reloc_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
*******************************************************************************/

#include "comgr/amd_comgr.h"
#include "amd_comgr.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/comgr/test/disasm_llvm_so_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
*******************************************************************************/

#include "comgr/amd_comgr.h"
#include "amd_comgr.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/comgr/test/link_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
*******************************************************************************/

#include "comgr/amd_comgr.h"
#include "amd_comgr.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/comgr/test/metadata_tp_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
*******************************************************************************/

#include "comgr/amd_comgr.h"
#include "amd_comgr.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/comgr/test/metadata_yaml_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
*******************************************************************************/

#include "comgr/amd_comgr.h"
#include "amd_comgr.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/comgr/test/symbols_iterate_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
*******************************************************************************/

#include "comgr/amd_comgr.h"
#include "amd_comgr.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/comgr/test/symbols_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
*******************************************************************************/

#include "comgr/amd_comgr.h"
#include "amd_comgr.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down

0 comments on commit 3d5bd38

Please sign in to comment.