summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDetermineHIPCompiler.cmake11
-rw-r--r--Modules/CMakeDetermineSystem.cmake22
-rw-r--r--Modules/FindProtobuf.cmake6
3 files changed, 35 insertions, 4 deletions
diff --git a/Modules/CMakeDetermineHIPCompiler.cmake b/Modules/CMakeDetermineHIPCompiler.cmake
index 5e54502..9a40e82 100644
--- a/Modules/CMakeDetermineHIPCompiler.cmake
+++ b/Modules/CMakeDetermineHIPCompiler.cmake
@@ -124,7 +124,10 @@ unset(_CMAKE_HIP_COMPILER_ID_IMPLICIT_FWKS)
unset(_CMAKE_HIP_COMPILER_ID_IMPLICIT_LOG)
if(NOT CMAKE_HIP_COMPILER_ROCM_LIB)
- set(_CMAKE_HIP_COMPILER_ROCM_LIB_DIRS "${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib")
+ set(_CMAKE_HIP_COMPILER_ROCM_LIB_DIRS
+ "${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib"
+ "${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib64"
+ )
if(CMAKE_HIP_LIBRARY_ARCHITECTURE)
list(APPEND _CMAKE_HIP_COMPILER_ROCM_LIB_DIRS "${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib/${CMAKE_HIP_LIBRARY_ARCHITECTURE}")
endif()
@@ -146,6 +149,12 @@ if(NOT CMAKE_HIP_COMPILER_ROCM_LIB)
endif()
unset(_CMAKE_HIP_COMPILER_ROCM_LIB_DIRS)
endif()
+if(CMAKE_HIP_COMPILER_ROCM_LIB MATCHES "/lib64$" AND NOT DEFINED CMAKE_SIZEOF_VOID_P)
+ # We have not yet determined the target ABI but we need 'find_package' to
+ # search lib64 directories to find hip-lang CMake package dependencies.
+ # This will be replaced by ABI detection later.
+ set(CMAKE_HIP_SIZEOF_DATA_PTR 8)
+endif()
if (NOT _CMAKE_TOOLCHAIN_LOCATION)
get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_HIP_COMPILER}" PATH)
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
index 386be73..fff4e9d 100644
--- a/Modules/CMakeDetermineSystem.cmake
+++ b/Modules/CMakeDetermineSystem.cmake
@@ -47,6 +47,28 @@ if(CMAKE_HOST_UNIX)
set(CMAKE_HOST_SYSTEM_VERSION "${_CMAKE_HOST_SYSTEM_MAJOR_VERSION}.${_CMAKE_HOST_SYSTEM_MINOR_VERSION}")
unset(_CMAKE_HOST_SYSTEM_MAJOR_VERSION)
unset(_CMAKE_HOST_SYSTEM_MINOR_VERSION)
+ elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android")
+ execute_process(COMMAND getprop ro.build.version.sdk
+ OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_QUIET)
+
+ if(NOT DEFINED CMAKE_SYSTEM_VERSION)
+ set(_ANDROID_API_LEVEL_H $ENV{PREFIX}/include/android/api-level.h)
+ set(_ANDROID_API_REGEX "#define __ANDROID_API__ ([0-9]+)")
+ file(READ ${_ANDROID_API_LEVEL_H} _ANDROID_API_LEVEL_H_CONTENT)
+ string(REGEX MATCH ${_ANDROID_API_REGEX} _ANDROID_API_LINE "${_ANDROID_API_LEVEL_H_CONTENT}")
+ string(REGEX REPLACE ${_ANDROID_API_REGEX} "\\1" _ANDROID_API "${_ANDROID_API_LINE}")
+ if(_ANDROID_API)
+ set(CMAKE_SYSTEM_VERSION "${_ANDROID_API}")
+ endif()
+
+ unset(_ANDROID_API_LEVEL_H)
+ unset(_ANDROID_API_LEVEL_H_CONTENT)
+ unset(_ANDROID_API_REGEX)
+ unset(_ANDROID_API_LINE)
+ unset(_ANDROID_API)
+ endif()
else()
execute_process(COMMAND ${CMAKE_UNAME} -r
OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index 3455412..0b9bd1f 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -655,7 +655,7 @@ if(Protobuf_INCLUDE_DIR)
INTERFACE_COMPILE_FEATURES cxx_std_11
)
endif()
- if (MSVC AND NOT Protobuf_USE_STATIC_LIBS)
+ if (WIN32 AND NOT Protobuf_USE_STATIC_LIBS)
set_property(TARGET protobuf::libprotobuf APPEND PROPERTY
INTERFACE_COMPILE_DEFINITIONS "PROTOBUF_USE_DLLS"
)
@@ -688,7 +688,7 @@ if(Protobuf_INCLUDE_DIR)
set_target_properties(protobuf::libprotobuf-lite PROPERTIES
IMPORTED_LOCATION_DEBUG "${Protobuf_LITE_LIBRARY_DEBUG}")
endif()
- if (MSVC AND NOT Protobuf_USE_STATIC_LIBS)
+ if (WIN32 AND NOT Protobuf_USE_STATIC_LIBS)
set_property(TARGET protobuf::libprotobuf-lite APPEND PROPERTY
INTERFACE_COMPILE_DEFINITIONS "PROTOBUF_USE_DLLS"
)
@@ -726,7 +726,7 @@ if(Protobuf_INCLUDE_DIR)
INTERFACE_COMPILE_FEATURES cxx_std_11
)
endif()
- if (MSVC AND NOT Protobuf_USE_STATIC_LIBS)
+ if (WIN32 AND NOT Protobuf_USE_STATIC_LIBS)
set_property(TARGET protobuf::libprotoc APPEND PROPERTY
INTERFACE_COMPILE_DEFINITIONS "PROTOBUF_USE_DLLS"
)