forked from VowpalWabbit/reinforcement_learning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
83 lines (65 loc) · 2.79 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
79
80
81
82
83
cmake_minimum_required(VERSION 3.5)
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
if(WIN32)
# Due to needing to configure the CMAKE platform, this needs to be included before the
# top-level project() declaration.
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/platforms/win32.cmake)
message(STATUS "WinSDK Version: ${CMAKE_SYSTEM_VERSION}")
endif()
project(reinforcement_learning)
set(CMAKE_CXX_STANDARD 11)
option(RL_BUILD_PYTHON "Build the Python bindings" OFF)
option(USE_ZSTD "Whether to enable usage of zstandard compression" ON)
option(RL_STATIC_DEPS "Only use static dependencies" OFF)
option(RL_BUILD_BENCHMARKS "Build benchmarks" OFF)
option(vw_USE_AZURE_FACTORIES "Whether to compile with the azure factories components" ON)
# TODO Compile cpprest into its own separate lib so that it doesn't have to be consumed
if (vw_USE_AZURE_FACTORIES)
find_package(cpprestsdk REQUIRED)
endif()
if(RL_STATIC_DEPS)
if(WIN32)
set(STATIC_LIB_SUFFIXES ".lib" ".a")
else()
set(STATIC_LIB_SUFFIXES ".a")
endif()
set(BUILD_SHARED_LIBS OFF)
set(STATIC_LINK_VW_JAVA ON CACHE BOOL "")
set(Boost_USE_STATIC_LIBS ON)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${STATIC_LIB_SUFFIXES})
endif()
find_package(OpenSSL REQUIRED)
# We also require Boost::uuid, but that is a header-only dependency and is unable to be found
# using find_package as a component, which means it is possible to have a successfully configured
# build that will nonetheless not work due to missing dependencies.
find_package(Boost COMPONENTS unit_test_framework system program_options thread REQUIRED)
# On MacOS, Boost::thread needs to be linked separately.
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
find_package(Boost COMPONENTS thread REQUIRED)
endif()
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
set(CMAKE_CONFIGURATION_TYPES Debug Release CACHE TYPE INTERNAL FORCE)
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build, options are: Debug, Release" FORCE)
include(ProcessorCount)
ProcessorCount(NumProcessors)
message("Number of processors: ${NumProcessors}")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/nprocs.txt ${NumProcessors})
include(ext_libs/ext_libs.cmake)
add_subdirectory(rlclientlib)
add_subdirectory(rlclientlib/extensions)
add_subdirectory(examples)
add_subdirectory(test_tools/joiner)
add_subdirectory(test_tools/sender_test)
add_subdirectory(test_tools/example_gen)
# enable_testing should be run after ext_libs so that the vw unit tests arent turned on.
enable_testing()
# Since bindings will add tests, if appropriate, it needs to be included after enable_testing().
add_subdirectory(bindings)
add_subdirectory(unit_test)
add_subdirectory(unit_test/extensions)
if(RL_BUILD_BENCHMARKS)
add_subdirectory(benchmarks)
endif()