[go: up one dir, main page]

0% found this document useful (0 votes)
12 views2 pages

C Make Lists

This CMake configuration file sets up a project named 'mockturtle' with a minimum required version of CMake 3.8 and specifies C++17 as the standard. It includes options for building examples, tests, and experiments, as well as enabling various libraries and sanitizers. The file also contains platform-specific configurations for UNIX and MSVC compilers, and manages subdirectories for include files, libraries, examples, tests, and experiments.

Uploaded by

f981128s
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

C Make Lists

This CMake configuration file sets up a project named 'mockturtle' with a minimum required version of CMake 3.8 and specifies C++17 as the standard. It includes options for building examples, tests, and experiments, as well as enabling various libraries and sanitizers. The file also contains platform-specific configurations for UNIX and MSVC compilers, and manages subdirectories for include files, libraries, examples, tests, and experiments.

Uploaded by

f981128s
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

cmake_minimum_required(VERSION 3.

8)
project(mockturtle LANGUAGES CXX)

set(MOCKTURTLE_CXX_STANDARD "17" CACHE STRING "C++ standard")


set(CMAKE_CXX_STANDARD ${MOCKTURTLE_CXX_STANDARD})
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Options
option(MOCKTURTLE_EXAMPLES "Build examples" ON)
option(MOCKTURTLE_TEST "Build tests" OFF)
option(MOCKTURTLE_EXPERIMENTS "Build experiments" OFF)
option(BILL_Z3 "Enable Z3 interface for bill library" OFF)
option(ENABLE_COVERAGE "Enable coverage reporting for gcc/clang" OFF)
option(ENABLE_MATPLOTLIB "Enable matplotlib library in experiments" OFF)
option(ENABLE_NAUTY "Enable the Nauty library for percy" OFF)
option(ENABLE_ABC "Enable linking ABC as a static library" OFF)
option(ENABLE_ASAN, "Enable ASAN sanitizer" OFF)

if(UNIX)
# show quite some warnings (but remove some intentionally)
include(CheckCXXCompilerFlag)
add_compile_options(-W -Wall -Wextra)
foreach (WARNING unknown-pragmas gnu-anonymous-struct nested-anon-types)
check_cxx_compiler_flag("-Wno-${WARNING}" HAS_WNO_${WARNING})
if (HAS_WNO_${WARNING})
add_compile_options(-Wno-${WARNING})
endif()
endforeach()
if (ENABLE_COVERAGE)
add_compile_options(-O0 -g --coverage -fprofile-arcs -ftest-coverage)
endif()
if (ENABLE_ASAN)
add_compile_options(-fsanitize=address -fno-omit-frame-pointer -
DADDRESS_SANITIZER)
add_link_options(-fsanitize=address)
endif()
endif()
if(MSVC)
add_compile_options(/EHsc /bigobj)
endif()
if (WIN32)
set(ENABLE_NAUTY OFF)
endif()

add_subdirectory(include)
add_subdirectory(lib)

if(ENABLE_NAUTY)
add_definitions(-DENABLE_NAUTY)
endif()

if (ENABLE_ABC)
if (NOT EXISTS ${PROJECT_SOURCE_DIR}/lib/abc_static/libabc.a)
message(FATAL_ERROR "Cannot find libabc.a in lib/abc_static/. For more info,
see https://github.com/lsils/abc-staticlib")
endif()
endif()

if(MOCKTURTLE_EXAMPLES)
add_subdirectory(examples)
endif()

if(MOCKTURTLE_TEST)
add_subdirectory(test)
endif()

if(MOCKTURTLE_EXPERIMENTS)
add_subdirectory(experiments)
endif()

You might also like