Skip to content

Commit

Permalink
cmake: optimize dependencies with sc-machine
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaZotov committed Apr 9, 2024
1 parent 9e2e986 commit fab99c2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
6 changes: 2 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.11)
project(ostis-metasystem)
set(CMAKE_CXX_STANDARD 17)

option(SC_BUILD_TESTS "Flag to build unit tests" OFF)
option(SC_BUILD_TESTS "Flag to build unit tests" ON)
option(SC_CLANG_FORMAT_CODE "Flag to add clangformat and clangformat_check targets" OFF)

if(NOT SC_BIN_PATH)
Expand All @@ -25,8 +25,6 @@ set(SC_MEMORY_SRC "${SC_MACHINE_PATH}/sc-memory/")
set(SC_KPM_SRC "${SC_MACHINE_PATH}/sc-kpm/")
set(SC_TOOLS_SRC "${SC_MACHINE_PATH}/sc-tools/")

include_directories(${SC_MEMORY_SRC} ${SC_KPM_SRC} ${SC_TOOLS_SRC})

include("${CMAKE_CURRENT_SOURCE_DIR}/dependencies.cmake")
sc_target_dependencies()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ set(SOURCES
"identifiers_module.hpp"
)

include_directories(
${CMAKE_CURRENT_LIST_DIR}
${SC_MEMORY_SRC}
${SC_KPM_SRC}
)

add_library(identifiers SHARED ${SOURCES})
target_link_libraries(identifiers sc-core sc-memory sc-agents-common)
target_link_libraries(identifiers
LINK_PUBLIC sc-memory
LINK_PUBLIC sc-agents-common
)
target_include_directories(identifiers
PRIVATE ${CMAKE_CURRENT_LIST_DIR}
PUBLIC ${SC_MEMORY_SRC}
PUBLIC ${SC_KPM_SRC}
)

sc_codegen_ex(identifiers ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_CURRENT_LIST_DIR}/generated)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
make_tests_from_folder(${CMAKE_CURRENT_LIST_DIR}/units
NAME identifiers-module-test-starter
DEPENDS sc-agents-common identifiers sc-builder-lib
INCLUDES ${SC_MEMORY_SRC}/tests/sc-memory/_test ${CMAKE_CURRENT_LIST_DIR}/.. ${SC_TOOLS_SRC}/sc-builder/src ${SC_MEMORY_SRC}/sc-memory
DEPENDS sc-core sc-agents-common identifiers sc-builder-lib
INCLUDES ${SC_MEMORY_SRC} ${SC_MEMORY_SRC}/tests/sc-memory/_test ${CMAKE_CURRENT_LIST_DIR}/.. ${SC_TOOLS_SRC}/sc-builder/src
)

add_definitions(-DMODULE_TEST_SRC_PATH="${CMAKE_CURRENT_LIST_DIR}")
Expand Down

0 comments on commit fab99c2

Please sign in to comment.