Skip to content

Commit

Permalink
add cmake option to enable/disable example generation
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Beichler <[email protected]>
  • Loading branch information
BenjaminBeichler committed Jan 5, 2023
1 parent 3974007 commit 0731d1a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@
# to find the SystemC libraries under
# lib-<target-arch>. (default: OFF)
#
# ENABLE_EXAMPLES Build examples and tests. (default: OFF)
#
# Other configuration variables will be proposed by CMake depending on the OS
# and detected processor, compiler, and libraries. For more information, please
# refer to the CMake documentation or <http://www.cmake.org/>.
Expand Down Expand Up @@ -325,6 +327,8 @@ option (ENABLE_LEGACY_MEM_MGMT
"Use of std::malloc or posix_memalign instead of mmap to allocate coroutine stack. Breaks ASAN."
OFF)

option (ENABLE_EXAMPLES "Build examples and tests." OFF)

if (NOT INSTALL_TO_LIB_BUILD_TYPE_DIR)
option (INSTALL_TO_LIB_TARGET_ARCH_DIR "Install the libraries to lib-<target-arch> to facilitate linking applications, which build systems assume to find SystemC in lib-<target-arch>. (default: OFF)" OFF)
else (NOT INSTALL_TO_LIB_BUILD_TYPE_DIR)
Expand Down Expand Up @@ -682,6 +686,7 @@ message (STATUS "SystemCTLM_VERSION = ${SystemCTLM_VERSION}")
message (STATUS "INSTALL_TO_LIB_BUILD_TYPE_DIR = ${INSTALL_TO_LIB_BUILD_TYPE_DIR}")
message (STATUS "INSTALL_TO_LIB_TARGET_ARCH_DIR = ${INSTALL_TO_LIB_TARGET_ARCH_DIR}")
message (STATUS "INSTALL_LIB_TARGET_ARCH_SYMLINK = ${INSTALL_LIB_TARGET_ARCH_SYMLINK}")
message (STATUS "ENABLE_EXAMPLES = ${ENABLE_EXAMPLES}")
message (STATUS "------------------------------------------------------------------------")
message (STATUS "CMAKE_CXX_STANDARD = ${CMAKE_CXX_STANDARD}")
message (STATUS "CMAKE_CXX_STANDARD_REQUIRED = ${CMAKE_CXX_STANDARD_REQUIRED}")
Expand Down Expand Up @@ -724,7 +729,9 @@ message (STATUS "===============================================================
###############################################################################

add_subdirectory (src)
add_subdirectory (examples)
if (${ENABLE_EXAMPLES})
add_subdirectory (examples)
endif()


###############################################################################
Expand Down

0 comments on commit 0731d1a

Please sign in to comment.