-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
75 lines (63 loc) · 1.55 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR)
set(CMAKE_SYSTEM_VERSION 10.0 CACHE STRING "" FORCE)
set(PROJECT_NAME chefc)
project(chefc CXX)
if(NOT CMAKE_VS_PLATFORM_NAME)
set(CMAKE_VS_PLATFORM_NAME "x64")
endif()
message("${CMAKE_VS_PLATFORM_NAME} architecture in use")
if(NOT ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64"
OR "${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x86"))
message(FATAL_ERROR "${CMAKE_VS_PLATFORM_NAME} arch is not supported!")
endif()
set(CMAKE_CONFIGURATION_TYPES
"Debug"
"Release"
CACHE STRING "" FORCE
)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
####################################
# Lexer #
####################################
set(Lexer_Headers
"src/lexer/utils.h"
)
set(Lexer_Source
"src/lexer/utils.cpp"
)
####################################
# Source #
####################################
set(Header_Files
"src/argparse.h"
"src/core.h"
)
set(Source_Files
"src/main.cpp"
"src/core.cpp"
"src/argparse.cpp"
)
set(ALL_FILES
${Lexer_Headers}
${Header_Files}
${Lexer_Source}
${Source_Files}
)
add_executable(${PROJECT_NAME} ${ALL_FILES})
if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE
$<$<CONFIG:Release>:
/Oi;
/Gy
>
/permissive-;
/sdl;
/W3;
/std:c++20;
)
endif()
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
target_include_directories(${PROJECT_NAME} PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/src"
)