OpenCores
URL https://opencores.org/ocsvn/s80186/s80186/trunk

Subversion Repositories s80186

[/] [s80186/] [trunk/] [CMakeLists.txt] - Rev 2

Compare with Previous | Blame | View Log

cmake_minimum_required(VERSION 2.8)
project(s80x86 C CXX ASM)

set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_NAME "s80x86")
set(CPACK_PACKAGE_CONTACT "jamie@jamieiles.com")
set(CPACK_STRIP_FILES ON)
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_COMPONENTS_ALL simulator)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-python1.58.0, python3, libsdl2-2.0.0")
include(CPack)
include(InstallRequiredSystemLibraries)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake/")

find_package(Nasm)
find_package(Verilator)
find_program(CCACHE_FOUND ccache)
find_package(Asciidoctor REQUIRED)
find_package(Quartus REQUIRED)

if(CCACHE_FOUND)
    set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
    set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(CMAKE_LINK_DEPENDS_NO_SHARED 1)
set(CMAKE_CONFIGURATION_TYPES "Coverage;Release;Debug")

set(CMAKE_CXX_FLAGS "-Weffc++ -march=native -Wall -Wextra -Werror -ggdb3 -std=c++14 ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_COVERAGE "-O0 -fprofile-arcs -ftest-coverage -fno-elide-constructors ${CMAKE_CXX_FLAGS_COVERAGE} -DCOVERAGE")
set(CMAKE_EXE_LINKER_FLAGS_COVERAGE "--coverage")
set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "--coverage")
set(CMAKE_CXX_FLAGS_RELEASE "-Os ${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_DEBUG "-DDEBUG -ggdb3 -O0 ${CMAKE_CXX_FLAGS_DEBUG}")

set(POISON_MEMORY_VALUE "0x00" CACHE STRING "Poison all memory with this value in tests")
add_definitions(-DMEM_INT_BYTE_VAL=${POISON_MEMORY_VALUE})

option(BUILD_DE0_CV "Build an image for the DE0-CV board" OFF)
option(BUILD_DE0_NANO "Build an image for the DE0-nano board" OFF)
option(S80X86_TRAP_ESCAPE "Trap on ESC opcodes" OFF)

configure_file(config.h.in config.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})

enable_testing()

add_subdirectory(vendor/googletest)
add_subdirectory(rtl)
add_subdirectory(python)
add_subdirectory(sim)
add_subdirectory(tests)
add_subdirectory(documentation)

if(${BUILD_DE0_CV})
add_subdirectory(fpga/de0-cv)
endif()

if(${BUILD_DE0_NANO})
add_subdirectory(fpga/de0-nano)
endif()

include(CTest)

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.