Bug 5133197: Add cmake toolchain and and update the CMakeList of some sample for tegra linux cross build

This commit is contained in:
shawnz
2025-03-19 18:17:17 +08:00
parent ab9166a6b2
commit bd0f630bf4
20 changed files with 205 additions and 176 deletions

View File

@@ -28,9 +28,13 @@ include(CheckIncludeFile)
check_include_file("GLFW/glfw3.h" HAVE_GLFW3_H)
# Find GLFW header and lib for Windows
if(WIN32)
find_file(GLFW3_H "GLFW/glfw3.h" PATH "${GLFW_INCLUDE_DIR}")
find_library(GLFW3_LIB "glfw3" PATH "${GLFW_LIB_DIR}")
if(WIN32 OR CMAKE_CROSSCOMPILING)
set(GLFW_INCLUDE_DIRS "${GLFW_INCLUDE_DIR}" "${CMAKE_INCLUDE_PATH}")
find_file(GLFW3_H "GLFW/glfw3.h" PATHS ${GLFW_INCLUDE_DIRS})
find_library(GLFW3_LIB
NAMES glfw3 glfw
PATHS "${GLFW_LIB_DIR}"
PATH_SUFFIXES lib lib64)
if(GLFW3_H AND GLFW3_LIB)
message(STATUS "Found GLFW/glfw3.h and GLFW library.")
set(HAVE_GLFW3_H 1)
@@ -58,9 +62,9 @@ if(${Vulkan_FOUND})
${Vulkan_LIBRARIES}
OpenGL::GL
)
if(WIN32)
if(WIN32 OR CMAKE_CROSSCOMPILING)
target_include_directories(simpleVulkan PUBLIC
${GLFW_INCLUDE_DIR}
${GLFW_INCLUDE_DIRS}
)
target_link_libraries(simpleVulkan
${GLFW3_LIB}