Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
kswiecicki committed Aug 26, 2024
1 parent 01c084e commit bd48d8f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,26 @@ jobs:
- name: Build all
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS

- name: Dump binary dependents
- name: Show contents of bin directory
working-directory: ${{github.workspace}}/build
run: ls ./bin/${{matrix.build_type}}/

- name: Show contents of lib directory
working-directory: ${{github.workspace}}/build
run: ls ./lib/${{matrix.build_type}}/

- name: Show contents of PATH env var
run: $Env:PATH

- name: Append build bin and lib dir to PATH env
run: $env:PATH = "${{github.workspace}}/build/bin/${{matrix.build_type}};${{github.workspace}}/build/lib/${{matrix.build_type}};$env:PATH"

- name: Run single failing test example-hello-world
working-directory: ${{github.workspace}}/build
run: ctest -R "example-hello" -C ${{matrix.build_type}} --verbose

- name: Check VC tools dir
run: ls "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\"

- name: Test
working-directory: ${{github.workspace}}/build
Expand Down
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ include(Assertions)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)

# Define rpath for libraries so that adapters can be found automatically
set(CMAKE_BUILD_RPATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
Expand Down
1 change: 1 addition & 0 deletions examples/hello_world/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ if(MSVC)
VS_DEBUGGER_COMMAND_ARGUMENTS ""
VS_DEBUGGER_WORKING_DIRECTORY "$(OutDir)"
)
set_target_properties (${NAME} PROPERTIES PREFIX "../")
endif()

target_link_libraries(${TARGET_NAME} PRIVATE
Expand Down
5 changes: 2 additions & 3 deletions source/common/windows/ur_lib_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,15 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) {

std::unique_ptr<HMODULE, LibLoader::lib_dtor>
LibLoader::loadAdapterLibrary(const char *name) {
logger::info(
"Trying to load a library from {}",
name);
logger::info("Trying to load a library from {}", name);
auto handle = std::unique_ptr<HMODULE, LibLoader::lib_dtor>(
LoadLibraryExA(name, nullptr, 0));
logger::info("loaded adapter 0x{} ({})", handle, name);
return handle;
}

void *LibLoader::getFunctionPtr(HMODULE handle, const char *func_name) {
logger::info("Getting function ptr for {}", func_name);
return reinterpret_cast<void *>(GetProcAddress(handle, func_name));
}

Expand Down
2 changes: 1 addition & 1 deletion source/loader/windows/adapter_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace ur_loader {
std::optional<fs::path> getLoaderLibPath() {
HMODULE hModule = NULL;
char pathStr[MAX_PATH_LEN_WIN];

logger::info("Getting loader library path!");
if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
reinterpret_cast<LPCSTR>(&getLoaderLibPath),
Expand Down

0 comments on commit bd48d8f

Please sign in to comment.