Skip to content

Commit

Permalink
fixup! stack: Refactor stack into its own library
Browse files Browse the repository at this point in the history
  • Loading branch information
cassava committed Jul 9, 2024
1 parent 48f09f0 commit 0774888
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 40 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ add_subdirectory(runtime)
add_subdirectory(models)
add_subdirectory(osi)
add_subdirectory(oak)
add_subdirectory(stack)
add_subdirectory(engine)
add_subdirectory(plugins)

Expand Down
4 changes: 3 additions & 1 deletion Makefile.all
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ ALL_PKGS := \
fable \
runtime \
models \
stack \
osi \
oak \
engine \
Expand Down Expand Up @@ -77,7 +78,8 @@ runtime: fable
models: runtime
osi: runtime models
oak: runtime
engine: models oak
stack: runtime models
engine: models oak stack
$(PLUGIN_PKGS): runtime models
plugins/esmini: osi

Expand Down
37 changes: 7 additions & 30 deletions engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ if(CLOE_FIND_PACKAGES)
find_package(fable REQUIRED QUIET)
find_package(cloe-runtime REQUIRED QUIET)
find_package(cloe-models REQUIRED QUIET)
find_package(cloe-stack REQUIRED QUIET)
endif()
find_package(Boost REQUIRED QUIET)
find_package(CLI11 REQUIRED QUIET)
Expand All @@ -22,33 +23,6 @@ string(TIMESTAMP CLOE_ENGINE_TIMESTAMP "%Y-%m-%d")
set(CLOE_ENGINE_VERSION ${CLOE_PROJECT_VERSION})
set(PROJECT_GIT_REF "unknown")

# Library libstack ---------------------------------------------------
message(STATUS "Building cloe-stacklib library.")

include(CTest)
if(BUILD_TESTING)
find_package(GTest REQUIRED QUIET)
include(GoogleTest)

message(STATUS "Building test-stacklib executable.")
add_executable(test-stacklib
src/stack_test.cpp
src/stack_component_test.cpp
)
set_target_properties(test-stacklib PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
)
target_link_libraries(test-stacklib
GTest::gtest
GTest::gtest_main
Boost::boost
cloe::models
cloe::stacklib
)
gtest_add_tests(TARGET test-stacklib)
endif()

# Library libengine ----------------------------------------------
message(STATUS "Building cloe-enginelib library.")
add_library(cloe-enginelib STATIC
Expand Down Expand Up @@ -123,7 +97,7 @@ target_include_directories(cloe-enginelib
)
target_link_libraries(cloe-enginelib
PUBLIC
cloe::stacklib
cloe::stack
cloe::models
cloe::runtime
fable::fable
Expand Down Expand Up @@ -157,6 +131,8 @@ endif()

if(BUILD_TESTING)
message(STATUS "Building test-enginelib executable.")
find_package(GTest REQUIRED QUIET)
include(GoogleTest)
add_executable(test-enginelib
src/lua_stack_test.cpp
src/lua_setup_test.cpp
Expand All @@ -170,11 +146,12 @@ if(BUILD_TESTING)
CXX_STANDARD_REQUIRED ON
)
target_link_libraries(test-enginelib
PRIVATE
GTest::gtest
GTest::gtest_main
Boost::boost
cloe::models
cloe::stacklib
cloe::stack
cloe::enginelib
)
gtest_add_tests(TARGET test-enginelib)
Expand Down Expand Up @@ -211,7 +188,7 @@ target_include_directories(cloe-engine
)
target_link_libraries(cloe-engine
PRIVATE
cloe::stacklib
cloe::stack
cloe::enginelib
CLI11::CLI11
linenoise::linenoise
Expand Down
14 changes: 7 additions & 7 deletions stack/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.15...3.27 FATAL_ERROR)

project(cloe-stack LANGUAGES CXX)
project(cloe_stack LANGUAGES CXX)

include(GNUInstallDirs)
include(TargetLinting)
Expand All @@ -19,9 +19,9 @@ message(STATUS "Building cloe-stack library.")
file(GLOB cloe-stack_PUBLIC_HEADERS "include/**/*.hpp")
add_library(cloe-stack STATIC
${cloe-stack_PUBLIC_HEADERS}
src/stack.cpp
src/stack_factory.cpp
src/plugin_loader.cpp
src/cloe/stack.cpp
src/cloe/stack_factory.cpp
src/cloe/plugin_loader.cpp
)
add_library(cloe::stack ALIAS cloe-stack)
set_target_properties(cloe-stack PROPERTIES
Expand All @@ -48,17 +48,17 @@ include(CTest)
if(BUILD_TESTING)
find_package(GTest REQUIRED QUIET)
include(GoogleTest)

message(STATUS "Building test-stack executable.")
add_executable(test-stack
src/stack_test.cpp
src/stack_component_test.cpp
src/cloe/stack_test.cpp
src/cloe/stack_component_test.cpp
)
set_target_properties(test-stack PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
)
target_link_libraries(test-stack
PRIVATE
GTest::gtest
GTest::gtest_main
Boost::boost
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
/**
* \file plugin.cpp
* \see plugin.hpp
* \file cloe/plugin_loader.cpp
* \see cloe/plugin_loader.hpp
*/

#include "cloe/plugin_loader.hpp"
Expand Down

0 comments on commit 0774888

Please sign in to comment.