Skip to content

Commit

Permalink
[Windows] make BZip2 a required package (#2566)
Browse files Browse the repository at this point in the history
  • Loading branch information
apwojcik authored Dec 25, 2023
1 parent c616417 commit 25a399f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ if(MIOPEN_ENABLE_SQLITE)
# MIOpen now depends on SQLite as well
find_package(SQLite3 REQUIRED)
endif()
find_package(BZip2)
find_package(BZip2 REQUIRED)
find_package(nlohmann_json 3.9.1 REQUIRED)
if(MIOPEN_ENABLE_SQLITE_KERN_CACHE AND NOT MIOPEN_ENABLE_SQLITE)
message(FATAL_ERROR "MIOPEN_ENABLE_SQLITE_KERN_CACHE requires MIOPEN_ENABLE_SQLITE")
Expand Down
5 changes: 2 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -718,10 +718,9 @@ if(WIN32)
endif()

target_include_directories(MIOpen SYSTEM PUBLIC $<BUILD_INTERFACE:${HALF_INCLUDE_DIR}>)
target_include_directories(MIOpen SYSTEM PRIVATE ${BZIP2_INCLUDE_DIR})
# Workaround : change in rocm-cmake was causing linking error so had to add ${CMAKE_DL_LIBS}
# Workaround : change in rocm-cmake was causing linking error so had to add ${CMAKE_DL_LIBS}
# We can remove ${CMAKE_DL_LIBS} once root cause is identified.
target_link_libraries(MIOpen PRIVATE ${CMAKE_DL_LIBS} Threads::Threads ${BZIP2_LIBRARIES} ${MIOPEN_CK_LINK_FLAGS})
target_link_libraries(MIOpen PRIVATE ${CMAKE_DL_LIBS} Threads::Threads BZip2::BZip2 ${MIOPEN_CK_LINK_FLAGS})
miopen_generate_export_header(MIOpen)

if(BUILD_TESTING)
Expand Down
2 changes: 1 addition & 1 deletion test/gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function(add_gtest TEST_NAME TEST_CPP)
# Extend GTest DISCOVERY_TIMEOUT to 5 mins
gtest_discover_tests(${TEST_NAME} DISCOVERY_TIMEOUT 300 PROPERTIES ENVIRONMENT "MIOPEN_USER_DB_PATH=${CMAKE_CURRENT_BINARY_DIR};MIOPEN_TEST_FLOAT_ARG=${MIOPEN_TEST_FLOAT_ARG};MIOPEN_TEST_ALL=${MIOPEN_TEST_ALL};MIOPEN_TEST_MLIR=${MIOPEN_TEST_MLIR};MIOPEN_TEST_COMPOSABLEKERNEL=${MIOPEN_TEST_COMPOSABLEKERNEL};CODECOV_TEST=${CODECOV_TEST};MIOPEN_TEST_DBSYNC=${MIOPEN_TEST_DBSYNC}")
endif()

target_link_libraries(${TEST_NAME} BZip2::BZip2)
if(WIN32)
# Refer to https://en.cppreference.com/w/cpp/language/types for details.
target_compile_options(${TEST_NAME} PRIVATE $<BUILD_INTERFACE:$<$<CXX_COMPILER_ID:Clang>:-U__LP64__>>)
Expand Down

0 comments on commit 25a399f

Please sign in to comment.