From 4f5b356517acd7520fd3b96de5ecef34dd7cfc40 Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Sat, 24 Aug 2024 21:26:04 +0200 Subject: [PATCH] build: Remove NS3_ENABLE_EXAMPLES flag examples_as_tests_dependencies macro adds examples called by tests as CMake target dependencies --- build-support/custom-modules/ns3-module-macros.cmake | 4 ---- src/core/model/example-as-test.cc | 3 --- 2 files changed, 7 deletions(-) diff --git a/build-support/custom-modules/ns3-module-macros.cmake b/build-support/custom-modules/ns3-module-macros.cmake index 9d3597852..a0bb08310 100644 --- a/build-support/custom-modules/ns3-module-macros.cmake +++ b/build-support/custom-modules/ns3-module-macros.cmake @@ -183,10 +183,6 @@ function(build_lib) target_precompile_headers(${BLIB_LIBNAME} REUSE_FROM stdlib_pch) endif() - if(${ENABLE_EXAMPLES} AND ${ENABLE_TESTS}) - target_compile_definitions(${BLIB_LIBNAME} PRIVATE NS3_ENABLE_EXAMPLES) - endif() - # Associate public headers with library for installation purposes set_target_properties( ${BLIB_LIBNAME} diff --git a/src/core/model/example-as-test.cc b/src/core/model/example-as-test.cc index a53353a94..05817027b 100644 --- a/src/core/model/example-as-test.cc +++ b/src/core/model/example-as-test.cc @@ -42,7 +42,6 @@ namespace ns3 NS_LOG_COMPONENT_DEFINE("ExampleAsTestCase"); // Running tests as examples currently requires Python. -#if defined(NS3_ENABLE_EXAMPLES) ExampleAsTestCase::ExampleAsTestCase(const std::string name, const std::string program, @@ -161,6 +160,4 @@ ExampleAsTestSuite::ExampleAsTestSuite(const std::string name, AddTestCase(new ExampleAsTestCase(name, program, dataDir, args, shouldNotErr), duration); } -#endif // NS3_ENABLE_EXAMPLES - } // namespace ns3