-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
40 lines (32 loc) · 967 Bytes
/
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
cmake_minimum_required(VERSION 3.10.2)
project(AheuiJIT)
set(AHEUIJIT_TRAGET "X86" CACHE STRING "")
option(ENABLE_ASAN "turn on address santiziers and various debug flags" OFF)
if (ENABLE_ASAN)
add_compile_options(-fsanitize=address,undefined -g)
add_link_options(-fsanitize=address,undefined -g)
endif()
if(EMSCRIPTEN)
set(WASM ON)
elseif(${AHEUIJIT_TRAGET} STREQUAL "X86" )
set(X86 ON)
add_definitions(-DX86)
elseif(${AHEUIJIT_TRAGET} STREQUAL "AARCH")
set(AARCH ON)
add_definitions(-DAARCH)
endif()
if(WASM)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/wasm)
add_compile_options(-O3 -s DISABLE_EXCEPTION_CATCHING=1)
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
add_subdirectory(external)
add_subdirectory(src/AheuiJIT)
if(WASM)
add_subdirectory(src/AheuiJIT/Wasm)
else()
add_subdirectory(src/AheuiJIT/Cli)
endif()