-
Notifications
You must be signed in to change notification settings - Fork 450
/
CMakeLists.txt
78 lines (63 loc) · 2.04 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
73
74
75
76
77
78
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2019-2021 Xilinx, Inc. All rights reserved.
#
# Note: Add Windows compilation directives at the END of this file
if( NOT WIN32)
if(${CMAKE_BUILD_TYPE} STREQUAL "Release" AND ${XRT_NATIVE_BUILD} STREQUAL "yes")
add_subdirectory(doc)
endif()
option(XOCL_VERBOSE "Enable xocl verbosity" OFF)
option(XRT_VERBOSE "Enable xrt verbosity" OFF)
if (XOCL_VERBOSE)
add_compile_options("-DXOCL_VERBOSE")
endif()
if(XRT_VERBOSE)
add_compile_options("-DXRT_VERBOSE")
endif()
add_compile_options("-fPIC")
if (XRT_ENABLE_WERROR)
list(APPEND XRT_WARN_OPTS "-Werror")
endif(XRT_ENABLE_WERROR)
if (${XRT_NATIVE_BUILD} STREQUAL "yes")
add_compile_options( ${XRT_WARN_OPTS} )
endif()
add_subdirectory(xdp)
add_subdirectory(tools/xclbinutil)
add_subdirectory(xocl)
add_subdirectory(xrt)
add_subdirectory(ert)
if (${XRT_NATIVE_BUILD} STREQUAL "yes")
# Only for host native build.
# For embedded, headers and libraries are installed in /usr
# Not requeired setup.sh/.csh
add_subdirectory(tools/scripts)
endif()
# Attach to the user's linker flags
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic")
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs")
add_subdirectory(core)
else()
# = WINDOWS ===================================================================
# Enable ALL warnings and make them errors if they occur
if (MSVC)
# warning level 4 and all warnings are errors
add_compile_options(/WX /W4)
if (DEFINED MSVC_PARALLEL_JOBS)
string(CONCAT MP_OPTION "/MP" ${MSVC_PARALLEL_JOBS})
add_compile_options(${MP_OPTION})
endif()
else()
# lots of warnings and all warnings as errors
# add_compile_options(-Wall -Wextra -pedantic -Werror)
add_compile_options( ${XRT_WARN_OPTS} )
endif()
# Build Subdirectories
if (NOT MCDM)
add_subdirectory(xocl)
add_subdirectory(xrt)
add_subdirectory(tools/xclbinutil)
add_subdirectory(xdp)
endif (NOT MCDM)
add_subdirectory(tools/scripts)
add_subdirectory(core)
endif()