Skip to content

Commit

Permalink
feat: move cmake files into src/spl_core
Browse files Browse the repository at this point in the history
  • Loading branch information
Akshit-MQ authored and cuinixam committed Mar 7, 2025
1 parent 980bee1 commit 9f89f09
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function Invoke-CommandLine {

function Invoke-Bootstrap {
# Download bootstrap scripts from external repository
Invoke-RestMethod https://raw.githubusercontent.com/avengineers/bootstrap-installer/v1.15.1/install.ps1 | Invoke-Expression
Invoke-RestMethod https://raw.githubusercontent.com/avengineers/bootstrap-installer/v1.16.0/install.ps1 | Invoke-Expression
# Execute bootstrap script
. .\.bootstrap\bootstrap.ps1
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/spl_core/kickstart/templates/project/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ include(FetchContent)
# Include spl-core
if(DEFINED ENV{SPLCORE_PATH})
message(WARNING "SPLCORE_PATH defined! Use fixed SPL-CORE version from: $ENV{SPLCORE_PATH}")
include($ENV{SPLCORE_PATH}/cmake/spl.cmake)
include($ENV{SPLCORE_PATH}/spl.cmake)
else()
# Fetch spl-core
FetchContent_Declare(
Expand Down
8 changes: 4 additions & 4 deletions cmake/spl.cmake → src/spl_core/spl.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Define the SPL Core root directory to be used to refer to files
# relative to the SPL Core installation directory.
set(SPL_CORE_ROOT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/..)
set(SPL_CORE_CMAKE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
set(SPL_CORE_PYTHON_DIRECTORY ${SPL_CORE_ROOT_DIRECTORY}/src/spl_core)
set(SPL_CORE_ROOT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
set(SPL_CORE_CMAKE_DIRECTORY ${SPL_CORE_ROOT_DIRECTORY})
set(SPL_CORE_PYTHON_DIRECTORY ${SPL_CORE_ROOT_DIRECTORY})

# Always create a compile_commands.json file for C/C++ intellisense / CMake Tools extension
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
Expand All @@ -23,7 +23,7 @@ foreach(ENVVAR IN LISTS ENVVARS)
endforeach()

# Include common CMake functions and macros
include(${CMAKE_CURRENT_LIST_DIR}/common.cmake)
include(${SPL_CORE_CMAKE_DIRECTORY}/common.cmake)

# Include and run KConfig
include(${SPL_CORE_CMAKE_DIRECTORY}/kconfig.cmake)
Expand Down
2 changes: 1 addition & 1 deletion tests/cmake/common.cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set(VARIANT mytestvariant)
set(BUILD_KIT prod)

# ## IUT ####################################
include(${CMAKE_CURRENT_LIST_DIR}/../../../cmake/common.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/../../../src/spl_core/common.cmake)

# ## test: _spl_slash_to_underscore #########
# given
Expand Down
2 changes: 1 addition & 1 deletion tests/cmake/spl.cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ set(LINKER_BYPRODUCTS_EXTENSIONS "hex")
set(LINKER_BYPRODUCT_HEX bibi.hex tina.map amadeus.mdf)

# when
include(${CMAKE_CURRENT_LIST_DIR}/../../../cmake/spl.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/../../../src/spl_core/spl.cmake)

# expect
if(NOT LINK_TARGET_NAME STREQUAL "link")
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def create_cli_for_spl_project(project_dir: Path) -> CommandLineExecutor:
The SPL-Core repository is used as a Python dependency and forces the usage of the project directory virtual environment.
"""
env = os.environ.copy()
env["SPLCORE_PATH"] = this_repository_root_dir().as_posix()
env["SPLCORE_PATH"] = this_repository_root_dir().joinpath("src/spl_core").as_posix()
# Force the usage of the project directory virtual environment
env["PIPENV_IGNORE_VIRTUALENVS"] = "1"
# Make sure the project directory virtual environment is used
Expand Down

0 comments on commit 9f89f09

Please sign in to comment.