rve/CMakeLists.txt

38 lines
832 B
CMake

cmake_minimum_required(VERSION 3.28)
project(rve)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_EXPORT_COMPILE_COMMANDS true)
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
set (CMAKE_CXX_FLAGS "-static-libgcc -static-libstdc++ -Werror -Wall -Wunused-result -Wno-unused-function -Wno-unused-variable -fno-omit-frame-pointer -Wno-c99-designator")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
endif()
find_package(SDL2 REQUIRED)
add_library(vm_lib)
target_sources(vm_lib
PRIVATE
src/vm.cpp
src/debug.cpp
src/elf.cpp
src/framebuffer.cpp
PUBLIC
FILE_SET HEADERS
BASE_DIRS src
FILES
src/vm.hpp
src/debug.hpp
src/elf.hpp
)
add_executable(rve src/rve.cpp)
target_link_libraries(rve vm_lib)
target_link_libraries(rve ${SDL2_LIBRARIES})
install(TARGETS rve)