Skip to content

Commit

Permalink
CMake: check platform variables directly
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Heider <[email protected]>
  • Loading branch information
Axel Heider committed Jan 29, 2024
1 parent 797190a commit 66a4651
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 19 deletions.
4 changes: 2 additions & 2 deletions apps/Arm/vm_cross_connector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ include(ExternalProject)
include(external-project-helpers)

# Create our CPP Flags based on ARM VM config variables
if("${KernelARMPlatform}" STREQUAL "exynos5422")
if(KernelPlatformExynos5422)
set(cpp_flags "-DKERNELARMPLATFORM_EXYNOS5422")
set(linux_repo "https://github.com/hardkernel/linux.git")
set(linux_tag "4.14.87-153")
set(linux_arch "arm")
set(linux_cross_compile "arm-linux-gnueabi-")
elseif("${KernelARMPlatform}" STREQUAL "qemu-arm-virt")
elseif(KernelPlatformQEMUArmVirt)
set(cpp_flags "-DKERNELARMPLATFORM_QEMU-ARM-VIRT")
set(linux_repo "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git")
set(linux_tag "v4.9.189")
Expand Down
4 changes: 2 additions & 2 deletions apps/Arm/vm_introspect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ include(${CAMKES_VM_LINUX_MODULE_HELPERS_PATH})
include(ExternalProject)
include(external-project-helpers)

if("${KernelARMPlatform}" STREQUAL "exynos5422")
if(KernelPlatformExynos5422)
set(cpp_flags "-DKERNELARMPLATFORM_EXYNOS5422")
set(linux_repo "https://github.com/hardkernel/linux.git")
set(linux_tag "4.14.87-153")
Expand All @@ -33,7 +33,7 @@ if("${KernelARMPlatform}" STREQUAL "exynos5422")
# Generate overlayed rootfs
set(rootfs_file "${CAMKES_VM_IMAGES_DIR}/exynos5422/rootfs.cpio.gz")

elseif("${KernelARMPlatform}" STREQUAL "qemu-arm-virt")
elseif(KernelPlatformQEMUArmVirt)
set(cpp_flags "-DKERNELARMPLATFORM_QEMU-ARM-VIRT")
set(linux_repo "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git")
set(linux_tag "v4.9.189")
Expand Down
14 changes: 7 additions & 7 deletions apps/Arm/vm_minimal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ include(${CAMKES_ARM_VM_HELPERS_PATH})
set(cpp_includes "${CAMKES_VM_DIR}/components/VM_Arm")

# Create our CPP Flags based on ARM VM config variables
if("${KernelARMPlatform}" STREQUAL "tk1")
if(KernelPlatformTK1)
set(cpp_flags "-DKERNELARMPLATFORM_TK1")

# Different device tree if compiling with Tk1Insecure
Expand Down Expand Up @@ -42,13 +42,13 @@ if("${KernelARMPlatform}" STREQUAL "tk1")
AddToFileServer("linux" "${CAMKES_ARM_LINUX_DIR}/${linux_binary_name}")
AddToFileServer("linux-dtb" "${CMAKE_CURRENT_BINARY_DIR}/linux/linux-dtb" DEPENDS set_dtb)

elseif("${KernelARMPlatform}" STREQUAL "tx1")
elseif(KernelPlatformTx1)
set(cpp_flags "-DKERNELARMPLATFORM_TX1")

AddToFileServer("linux" "${CAMKES_VM_IMAGES_DIR}/tx1/linux")
AddToFileServer("linux-dtb" "${CAMKES_VM_IMAGES_DIR}/tx1/linux-dtb")

elseif("${KernelARMPlatform}" STREQUAL "exynos5422")
elseif(KernelPlatformExynos5422)
find_package(camkes-vm-linux REQUIRED)
include(${CAMKES_VM_LINUX_HELPERS_PATH})
set(cpp_flags "-DKERNELARMPLATFORM_EXYNOS5422")
Expand All @@ -67,7 +67,7 @@ elseif("${KernelARMPlatform}" STREQUAL "exynos5422")
)
AddToFileServer("linux-dtb" "${output_dtb_location}" DEPENDS dtb_gen_target)

elseif("${KernelARMPlatform}" STREQUAL "tx2")
elseif(KernelPlatformTx2)
find_package(camkes-vm-linux REQUIRED)
include(${CAMKES_VM_LINUX_HELPERS_PATH})
set(cpp_flags "-DKERNELARMPLATFORM_TX2")
Expand All @@ -85,7 +85,7 @@ elseif("${KernelARMPlatform}" STREQUAL "tx2")
)
AddToFileServer("linux-dtb" "${output_dtb_location}" DEPENDS dtb_gen_target)

elseif("${KernelARMPlatform}" STREQUAL "qemu-arm-virt")
elseif(KernelPlatformQEMUArmVirt)
find_package(camkes-vm-linux REQUIRED)
include(${CAMKES_VM_LINUX_HELPERS_PATH})
set(cpp_flags "-DKERNELARMPLATFORM_QEMU-ARM-VIRT")
Expand All @@ -108,7 +108,7 @@ elseif("${KernelARMPlatform}" STREQUAL "qemu-arm-virt")
GenerateSimulateScript()
endif()

elseif("${KernelARMPlatform}" STREQUAL "odroidc2")
elseif(KernelPlatformOdroidc2)
find_package(camkes-vm-linux REQUIRED)
include(${CAMKES_VM_LINUX_HELPERS_PATH})
set(cpp_flags "-DKERNELARMPLATFORM_ODROIDC2")
Expand All @@ -130,7 +130,7 @@ elseif("${KernelARMPlatform}" STREQUAL "odroidc2")
)
AddToFileServer("linux-dtb" "${output_dtb_location}" DEPENDS dtb_gen_target)

elseif("${KernelARMPlatform}" STREQUAL "zcu102")
elseif(KernelPlatformZynqmpZcu102)

if("${VmZynqmpPetalinuxVersion}" STREQUAL "")
message(
Expand Down
4 changes: 2 additions & 2 deletions apps/Arm/vm_multi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ include(${CAMKES_ARM_VM_HELPERS_PATH})
find_package(camkes-vm-linux REQUIRED)
include(${CAMKES_VM_LINUX_HELPERS_PATH})

if("${PLATFORM}" STREQUAL "exynos5422")
if(KernelPlatformExynos5422)
# Create our CPP Flags based on ARM VM config variables
set(cpp_flags "-DKERNELARMPLATFORM_EXYNOS5422")
elseif("${PLATFORM}" STREQUAL "qemu-arm-virt")
elseif(KernelPlatformQEMUArmVirt)
set(cpp_flags "-DKERNELARMPLATFORM_QEMU-ARM-VIRT")
set(SIMULATION ON CACHE BOOL "Generate simulation script to run qemu with the proper arguments")
include(simulation)
Expand Down
4 changes: 2 additions & 2 deletions apps/Arm/vm_virtio_net/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ include(${CAMKES_VM_LINUX_HELPERS_PATH})
set(dtb_file "${CAMKES_VM_IMAGES_DIR}/${KernelARMPlatform}/linux-dtb")
set(rootfs_file "${CAMKES_VM_IMAGES_DIR}/${KernelARMPlatform}/rootfs.cpio.gz")

if("${KernelARMPlatform}" STREQUAL "exynos5422")
if(KernelPlatformExynos5422)
# Create our CPP Flags based on ARM VM config variables
set(cpp_flags "-DKERNELARMPLATFORM_EXYNOS5422")
set(rootfs_address "0x4d700000")

elseif("${KernelARMPlatform}" STREQUAL "tx2")
elseif(KernelPlatformTx2)
set(cpp_flags "-DKERNELARMPLATFORM_TX2")
set(rootfs_address "0xf7000000")
set(dtb_file "${CAMKES_VM_IMAGES_DIR}/${KernelARMPlatform}/linux-pci-dtb")
Expand Down
5 changes: 1 addition & 4 deletions settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ if(AppArch STREQUAL "Arm")

# We dont support SMP configurations on the exynos5422, exynos5410 or TK1
if(
("${KernelARMPlatform}" STREQUAL "exynos5422"
OR "${KernelARMPlatform}" STREQUAL "exynos5410"
OR "${KernelARMPlatform}" STREQUAL "tk1"
)
(KernelPlatformExynos5422 OR KernelPlatformExynos5410 OR KernelPlatformTK1)
AND (${KernelMaxNumNodes} GREATER 1)
)
message(FATAL_ERROR "${KernelARMPlatform} does not support SMP VMs")
Expand Down

0 comments on commit 66a4651

Please sign in to comment.