From 5dec262eb4271d5db2c2ecf389619a981001c916 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Tue, 9 Dec 2025 07:58:06 +0100 Subject: [PATCH] removes scc git submodule and adds as FetchContent --- .gitmodules | 3 --- CMakeLists.txt | 24 ++++++++++++++++++++++-- scc | 1 - 3 files changed, 22 insertions(+), 6 deletions(-) delete mode 160000 scc diff --git a/.gitmodules b/.gitmodules index 1ddda03..a836f0d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "scc"] - path = scc - url = https://github.com/Minres/SystemC-Components.git [submodule "cmake-conan"] path = cmake-conan url = https://github.com/conan-io/cmake-conan.git diff --git a/CMakeLists.txt b/CMakeLists.txt index ed26e15..a49bf95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,4 @@ cmake_minimum_required(VERSION 3.16) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/scc/cmake) cmake_policy(SET CMP0110 NEW) project(SCC_Test) @@ -11,6 +10,22 @@ option(ENABLE_CLANG_FORMAT "Enable clang-format targets" OFF) option(THREAD_SANITIZER "Enable thread sanitizer TSan" OFF) option(ADDR_SANITIZER "Enable address sanitizer ASan" OFF) +if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/scc") + list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/scc/cmake) +else() + include(FetchContent) + FetchContent_Declare( + scc_git + GIT_REPOSITORY https://github.com/Minres/SystemC-Components.git + GIT_TAG develop + ) + FetchContent_GetProperties(scc_git) + if(NOT scc_git_POPULATED) + FetchContent_Populate(scc_git) + endif() + list(APPEND CMAKE_MODULE_PATH ${scc_git_SOURCE_DIR}/cmake) +endif() + include(GNUInstallDirs) include(BuildType) @@ -72,6 +87,11 @@ include(CTest) include(Catch) enable_testing() set(WITH_SCP4SCC ON) -add_subdirectory(scc) + +if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/scc") + add_subdirectory(scc) +else() + add_subdirectory(${scc_git_SOURCE_DIR}) +endif() add_subdirectory(src) add_subdirectory(tests) diff --git a/scc b/scc deleted file mode 160000 index a1704aa..0000000 --- a/scc +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a1704aa0d60b772af7e5c6a4c95d2c5db056eecc