forked from edrickhong/Cu_std
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RefCMakeLists.txt
69 lines (47 loc) · 1.7 KB
/
RefCMakeLists.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
option(IS_INDEPENDENT "" ON)
if(IS_INDEPENDENT)
cmake_minimum_required(VERSION 3.9)
project(cu_std)
message(STATUS "CU_STD STAND ALONE")
set(CU_STD_DIR "${CMAKE_SOURCE_DIR}/")
option(BUILD_STEP "" ON)
option(DEBUG "" ON)
# kept because we change these often (Linux compiler flags)
if(UNIX)
if(DEBUG)
# -mavx
set(OPT_FLAGS "-g -O0 -fno-omit-frame-pointer -fstack-protector-strong")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(
FLAGS
"-msse4.1 -mfma -fdiagnostics-absolute-paths -fvisibility=hidden -march=x86-64 -fno-fast-math -fno-exceptions -fno-rtti -std=c++14 ${OPT_FLAGS} ${STRICT_FLAGS} ${CLANG_DEBUG}"
)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(
FLAGS
"-msse4.1 -mfma -fvisibility=hidden -march=x86-64 -fno-fast-math -fno-exceptions -fno-rtti -std=c++14 ${OPT_FLAGS}"
)
endif()
endif(UNIX)
set(CMAKE_CXX_FLAGS ${FLAGS})
# Output Directory Variables
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CU_STD_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CU_STD_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CU_STD_DIR}/bin)
else()
message(STATUS "CU_STD DEPENDENT")
endif()
# sets internal libs paths and flags
include(${CU_STD_DIR}/cmake/cu.cmake)
generatewaylandextensionfiles()
# Include Directories
include_directories("${CU_STD_DIR}/include"
"${CU_STD_DIR}/include/cu"
"${CU_STD_DIR}/include/cu/amd64/"
${MODE_INCLUDE}
${PLATFORM_INCLUDES})
# source files. all unity builds
file(GLOB CU_STD ${CU_STD_DIR}/src/cu_std/cu/gui_bin.cpp
${CU_STD_DIR}/src/cu_std/cu/main.cpp ${PLATFORM_SRC})
add_library(cu_std STATIC ${CU_STD})