-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modernize CMakeLists.txt for Simulator
- Loading branch information
1 parent
af78c6a
commit d4214b5
Showing
3 changed files
with
83 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,89 @@ | ||
list( APPEND srcs | ||
# HEADERS | ||
src/Analyser.hpp | ||
src/AstAnalyserVisitor.hpp | ||
src/DefsAnalyserVisitor.hpp | ||
src/FlatAnalyserVisitor.hpp | ||
src/Simulator.hpp | ||
src/SimulatorVisitor.hpp | ||
# SOURCES | ||
src/Analyser.cpp | ||
src/AstAnalyserVisitor.cpp | ||
src/DefsAnalyserVisitor.cpp | ||
src/FlatAnalyserVisitor.cpp | ||
src/Simulator.cpp | ||
src/SimulatorVisitor.cpp | ||
) | ||
ecbuild_add_library( TARGET libsimu | ||
NOINSTALL | ||
TYPE STATIC | ||
SOURCES ${srcs} | ||
) | ||
# | ||
# Copyright 2023- ECMWF. | ||
# | ||
# This software is licensed under the terms of the Apache Licence version 2.0 | ||
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. | ||
# In applying this licence, ECMWF does not waive the privileges and immunities | ||
# granted to it by virtue of its status as an intergovernmental organisation | ||
# nor does it submit to any jurisdiction. | ||
# | ||
|
||
target_link_libraries(libsimu node nodeattr core) | ||
target_include_directories(libsimu PUBLIC src | ||
../ACore/src | ||
../ANattr/src | ||
../ANode/src | ||
../Base/src | ||
) | ||
find_package(Threads REQUIRED) | ||
|
||
set(srcs | ||
# Headers | ||
src/Analyser.hpp | ||
src/AstAnalyserVisitor.hpp | ||
src/DefsAnalyserVisitor.hpp | ||
src/FlatAnalyserVisitor.hpp | ||
src/Simulator.hpp | ||
src/SimulatorVisitor.hpp | ||
# Sources | ||
src/Analyser.cpp | ||
src/AstAnalyserVisitor.cpp | ||
src/DefsAnalyserVisitor.cpp | ||
src/FlatAnalyserVisitor.cpp | ||
src/Simulator.cpp | ||
src/SimulatorVisitor.cpp | ||
) | ||
ecbuild_add_library( | ||
TARGET | ||
libsimu | ||
NOINSTALL | ||
TYPE STATIC | ||
SOURCES | ||
${srcs} | ||
PUBLIC_INCLUDES | ||
src | ||
PUBLIC_LIBS | ||
node | ||
nodeattr | ||
core | ||
) | ||
target_clangformat(libsimu) | ||
|
||
list( APPEND test_srcs | ||
# HEADERS | ||
test/TestUtil.hpp | ||
# SOURCES | ||
test/TestAutoArchive.cpp | ||
test/TestAutoCancel.cpp | ||
test/TestAutoRestore.cpp | ||
test/TestMeter.cpp | ||
test/TestTime.cpp | ||
test/TestUtil.cpp | ||
test/TestSimulator.cpp | ||
test/TestAutoCancel.cpp | ||
test/TestRepeat.cpp | ||
test/TestToday.cpp | ||
test/TestAnalysis.cpp | ||
set(test_srcs | ||
# Headers | ||
test/TestUtil.hpp | ||
# Sources | ||
test/TestAnalysis.cpp | ||
test/TestAutoArchive.cpp | ||
test/TestAutoCancel.cpp | ||
test/TestAutoCancel.cpp | ||
test/TestAutoRestore.cpp | ||
test/TestMeter.cpp | ||
test/TestRepeat.cpp | ||
test/TestSimulator.cpp | ||
test/TestTime.cpp | ||
test/TestToday.cpp | ||
test/TestUtil.cpp | ||
) | ||
ecbuild_add_test( | ||
TARGET | ||
c_csim | ||
SOURCES | ||
${test_srcs} | ||
LIBS | ||
libsimu | ||
Threads::Threads | ||
TEST_DEPENDS u_base | ||
) | ||
ecbuild_add_test( TARGET c_csim | ||
SOURCES ${test_srcs} | ||
LIBS libsimu | ||
pthread | ||
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_TEST_EXEC_MONITOR_LIBRARY} ${LIBRT} | ||
INCLUDES ../ANode/test ${Boost_INCLUDE_DIRS} | ||
DEFINITIONS ${BOOST_TEST_DYN_LINK} | ||
TEST_DEPENDS u_base | ||
) | ||
|
||
target_clangformat(c_csim CONDITION ENABLE_TESTS) | ||
|
||
if (ENABLE_ALL_TESTS) | ||
ecbuild_add_test( TARGET c_csim_single | ||
SOURCES test/TestSingleSimulator.cpp test/TestUtil.cpp | ||
LIBS libsimu | ||
pthread | ||
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_TEST_EXEC_MONITOR_LIBRARY} ${LIBRT} | ||
INCLUDES ../ANode/test ${Boost_INCLUDE_DIRS} | ||
DEFINITIONS ${BOOST_TEST_DYN_LINK} | ||
TEST_DEPENDS u_base | ||
) | ||
|
||
ecbuild_add_test( | ||
TARGET | ||
c_csim_single | ||
SOURCES | ||
test/TestSingleSimulator.cpp | ||
test/TestUtil.cpp | ||
LIBS | ||
libsimu | ||
Threads::Threads | ||
TEST_DEPENDS | ||
u_base | ||
) | ||
target_clangformat(c_csim_single CONDITION ENABLE_TESTS) | ||
|
||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters