-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
72 lines (40 loc) · 1.75 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
# stop if cmake version below 3.5
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(cedar C CXX ASM)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
set (CMAKE_CXX_STANDARD 17)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
SET(CMAKE_ASM_FLAGS "${CFLAGS} -x assembler-with-cpp")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DBUILD_MODE=Debug -fno-omit-frame-pointer")
set(CMAKE_C_FLAGS_DEBUG "-g -O0 -DBUILD_MODE=Debug -fno-omit-frame-pointer")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DBUILD_MODE=Release")
set(CMAKE_C_FLAGS_RELEASE "-O3 -DBUILD_MODE=Release")
set(ASMJIT_STATIC TRUE)
set(ASMJIT_RELEASE TRUE)
add_definitions(-DPOINTER_MASK=0x0007FFFFFFFFFFFF)
add_definitions(-DASMJIT_CUSTOM_ALLOC=GC_MALLOC)
add_definitions(-DASMJIT_CUSTOM_REALLOC=GC_REALLOC)
add_definitions(-DASMJIT_CUSTOM_FREE=GC_FREE)
# build dependencies before setting up project deets
add_subdirectory(dep/libuv)
add_subdirectory(src/asmjit)
set(BUILD_SHARED_LIBS OFF)
option(REPLXX_BuildExamples "Build the examples." OFF)
set(REPLXX_BuildExamples OFF)
add_subdirectory(dep/replxx)
# add_subdirectory(dep/bdwgc EXCLUDE_FROM_ALL)
link_directories(/usr/local/lib)
include_directories(/usr/local/include)
include_directories(dep/bdwgc/include)
include_directories(dep/libuv/include)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
add_definitions(-DBUILD_DIR="${BUILD_DIR}")
message(STATUS "Build Mode: ${CMAKE_BUILD_TYPE}")
add_compile_options(-frtti)
include_directories(${CMAKE_SOURCE_DIR}/include)
include(${CMAKE_SOURCE_DIR}/src/cedar/CMakeLists.txt)
target_compile_options(cedar PRIVATE -Wall -Wextra -Wno-unused-parameter -Wno-strict-aliasing)
install(TARGETS cedar DESTINATION bin CONFIGURATIONS Release)
install(TARGETS cedar-lib DESTINATION lib CONFIGURATIONS Release)