From 772d12d2a46002d078b849cdd8ae576967eb7af8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20M=C3=A6hlum?= Date: Mon, 16 Sep 2024 19:51:37 +0200 Subject: [PATCH] Move check on env variables to before including riscv toolchain file. (#101) Co-authored-by: erling --- sdk/CMakeLists.txt | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/sdk/CMakeLists.txt b/sdk/CMakeLists.txt index 3876ddf..2c170b8 100644 --- a/sdk/CMakeLists.txt +++ b/sdk/CMakeLists.txt @@ -1,17 +1,6 @@ cmake_minimum_required(VERSION 3.22) -include($ENV{FP_SDK_PATH}/cmake/riscv-toolchain.cmake) - -project(fp-sdk - DESCRIPTION "Software development kit (SDK) for FlexPRET" - LANGUAGES C ASM - VERSION 0.0.1 -) - -if (NOT DEFINED TARGET) - set(TARGET "emulator" CACHE STRING "Whether to compile SDK to target FlexPRET on emulator or FPGA" FORCE) -endif() - +# Check environment variables are set before anything else set(ENVS FP_PATH FP_SDK_PATH @@ -24,6 +13,18 @@ foreach(env ${ENVS}) endif() endforeach() +include($ENV{FP_SDK_PATH}/cmake/riscv-toolchain.cmake) + +project(fp-sdk + DESCRIPTION "Software development kit (SDK) for FlexPRET" + LANGUAGES C ASM + VERSION 0.0.1 +) + +if (NOT DEFINED TARGET) + set(TARGET "emulator" CACHE STRING "Whether to compile SDK to target FlexPRET on emulator or FPGA" FORCE) +endif() + set(FP_INSTALLED_FILES "flexpret/fp-emu" "flexpret/hwconfig.cmake"