-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
76 lines (68 loc) · 2.12 KB
/
Copy pathCMakeLists.txt
File metadata and controls
76 lines (68 loc) · 2.12 KB
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
76
cmake_minimum_required(VERSION 3.20)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 20)
set(TARGET_BINARY_NAME electra)
if(NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
project(ElectraLang VERSION 1.0.0)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Emscripten")
set(WASM TRUE)
endif()
set(SOURCE_FILES
src/components/ArithmeticalUnit.cpp
src/components/Bomb.cpp
src/components/Cable.cpp
src/components/Cloner.cpp
src/components/CloningDynamicComponent.cpp
src/components/Component.cpp
src/components/ConditionalUnit.cpp
src/components/ConstantAdder.cpp
src/components/ConstantPusher.cpp
src/components/Eraser.cpp
src/components/FileCloser.cpp
src/components/FileOpener.cpp
src/components/FileReader.cpp
src/components/FileWriter.cpp
src/components/Key.cpp
src/components/NonCloningDynamicComponent.cpp
src/components/Portal.cpp
src/components/Printer.cpp
src/components/Reader.cpp
src/components/Reverser.cpp
src/components/StackChecker.cpp
src/components/StackSwitcher.cpp
src/components/Swapper.cpp
src/utility/Argparser.cpp
src/utility/FileDescriptorManager.cpp
src/utility/Global.cpp
src/utility/LineRange.cpp
src/utility/Logger.cpp
src/utility/StringUtilities.cpp
src/Current.cpp
src/Direction.cpp
src/Electra.cpp
src/Generator.cpp
src/main.cpp
)
add_executable(${TARGET_BINARY_NAME} ${SOURCE_FILES})
target_include_directories(${TARGET_BINARY_NAME} PUBLIC include)
set(BOOST_REGEX_STANDALONE ON)
add_subdirectory(include/thirdparty/regex)
target_link_libraries(${TARGET_BINARY_NAME} PRIVATE Boost::regex)
if (WASM)
set(CMAKE_EXECUTABLE_SUFFIX ".js")
target_link_options(${TARGET_BINARY_NAME} PRIVATE
-sMODULARIZE=1
-sEXPORT_ES6=1
-sALLOW_MEMORY_GROWTH=1
-sENVIRONMENT=web
-sEXPORTED_RUNTIME_METHODS=run
)
target_link_options(${TARGET_BINARY_NAME} PRIVATE --bind)
else()
if(MSVC)
target_compile_options(${TARGET_BINARY_NAME} PRIVATE /utf-8)
endif()
install(TARGETS ${TARGET_BINARY_NAME} DESTINATION bin)
endif()