build: reduce scope of NS3_ENABLE_EXAMPLES flag
Prevents recompilation of modules when tests are enabled
This commit is contained in:
@@ -97,6 +97,19 @@ function(build_lib)
|
||||
${CMAKE_HEADER_OUTPUT_DIRECTORY}/version-defines.h
|
||||
)
|
||||
endif()
|
||||
|
||||
# Enable examples as tests suites
|
||||
if(${ENABLE_EXAMPLES} AND ${ENABLE_TESTS})
|
||||
if(NOT ${XCODE})
|
||||
target_compile_definitions(
|
||||
${lib${BLIB_LIBNAME}}-obj PRIVATE NS3_ENABLE_EXAMPLES
|
||||
)
|
||||
else()
|
||||
target_compile_definitions(
|
||||
${lib${BLIB_LIBNAME}} PRIVATE NS3_ENABLE_EXAMPLES
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
set_target_properties(
|
||||
${lib${BLIB_LIBNAME}}
|
||||
|
||||
@@ -1156,12 +1156,6 @@ macro(process_options)
|
||||
add_definitions(-DNS3_ASSERT_ENABLE)
|
||||
endif()
|
||||
|
||||
# Enable examples as tests suites
|
||||
if(${ENABLE_EXAMPLES})
|
||||
set(NS3_ENABLE_EXAMPLES "1")
|
||||
add_definitions(-DNS3_ENABLE_EXAMPLES -DCMAKE_EXAMPLE_AS_TEST)
|
||||
endif()
|
||||
|
||||
set(ENABLE_TAP OFF)
|
||||
if(${NS3_TAP})
|
||||
set(ENABLE_TAP ON)
|
||||
|
||||
Reference in New Issue
Block a user