36 lines
853 B
CMake
36 lines
853 B
CMake
cmake_minimum_required(VERSION 3.15)
|
|
project(JoVa LANGUAGES CXX)
|
|
|
|
# Set output directories for builds
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin/Debug)
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/Release)
|
|
|
|
# Set C++ standard
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
if(MSVC)
|
|
add_compile_options(/W4 /permissive-)
|
|
else()
|
|
add_compile_options(-Wall -Wextra -Wpedantic)
|
|
endif()
|
|
|
|
set(SOURCES
|
|
main.cpp
|
|
src/Vm.cpp
|
|
src/Vm.h
|
|
src/Compiler.cpp
|
|
src/Compiler.h
|
|
)
|
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
|
|
|
|
add_executable(JoVa ${SOURCES})
|
|
|
|
source_group("Source Files" FILES ${SOURCES})
|
|
|
|
# Set default build type to Debug if not specified
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type" FORCE)
|
|
endif()
|