-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
68 lines (54 loc) · 1.68 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
cmake_minimum_required(VERSION 3.19)
# CMake modules search path
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(GitVersionDetect)
include(CheckLanguage)
set(ARFMINESWEEPER_VERSION_MAJOR ${GITVERSIONDETECT_VERSION_MAJOR})
set(ARFMINESWEEPER_VERSION_MINOR ${GITVERSIONDETECT_VERSION_MINOR})
set(ARFMINESWEEPER_VERSION_PATCH ${GITVERSIONDETECT_VERSION_PATCH})
set(ARFMINESWEEPER_VERSION ${ARFMINESWEEPER_VERSION_MAJOR}.${ARFMINESWEEPER_VERSION_MINOR}.${ARFMINESWEEPER_VERSION_PATCH})
set(ARFMINESWEEPER_NUM_COMMIT ${GITVERSIONDETECT_VERSION_COMMIT_NUM}-${GITVERSIONDETECT_VERSION_COMMIT_SHA})
message(STATUS "Git version ${ARFMINESWEEPER_VERSION}")
project(
arfminesweeper
VERSION ${ARFMINESWEEPER_VERSION}
DESCRIPTION "Minesweeper, but in every way possible"
HOMEPAGE_URL "http://github.org/arf20/arfminesweeper"
LANGUAGES C CXX ASM ASM_NASM
)
check_language(C)
if(CMAKE_C_COMPILER)
enable_language(C)
else()
message(STATUS "No C support")
endif()
check_language(CXX)
if(CMAKE_CXX_COMPILER)
enable_language(CXX)
else()
message(STATUS "No CXX support")
endif()
check_language(ASM)
if(CMAKE_ASM_COMPILER)
enable_language(ASM)
else()
message(STATUS "No ASM support")
endif()
check_language(ASM_NASM)
if(CMAKE_ASM_NASM_COMPILER)
enable_language(ASM_NASM)
else()
message(STATUS "No ASM_NASM support")
endif()
add_subdirectory("main_src")
if (LINUX)
add_subdirectory("mod_src")
else()
message(STATUS "Not building linux kernel module on non-linux")
endif()
if(CMAKE_ASM_NASM_COMPILER)
add_subdirectory("kernel_src")
else()
message(STATUS "Not building kernel without NASM")
endif()
add_subdirectory("efi_src")