-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathCMakeLists.txt
36 lines (29 loc) · 1.01 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
cmake_minimum_required(VERSION 3.5)
project(MimiC VERSION "0.0.1")
# # set compiler path
# set(CMAKE_C_COMPILER "/usr/local/opt/gcc/bin/gcc-10")
# set(CMAKE_CXX_COMPILER "/usr/local/opt/gcc/bin/g++-10")
# set(CMAKE_CXX_COMPILER_ID "GNU")
# C++17 standard support
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# enable all warnings and treat them as errors
if(MSVC)
add_compile_options(/W3 /WX)
else()
add_compile_options(-Wall -Werror)
endif()
# some definitions
add_compile_definitions(APP_NAME="MimiC Compiler")
add_compile_definitions(APP_VERSION="${PROJECT_VERSION}")
add_compile_definitions(APP_VERSION_MAJOR=${PROJECT_VERSION_MAJOR})
add_compile_definitions(APP_VERSION_MINOR=${PROJECT_VERSION_MINOR})
add_compile_definitions(APP_VERSION_PATCH=${PROJECT_VERSION_PATCH})
# project include directories
include_directories(src)
include_directories(3rdparty/xstl)
# all of C++ source files
file(GLOB_RECURSE SOURCES "src/*.cpp")
# executable
add_executable(mmcc ${SOURCES})