CMakeLists.txt 3.8 KB
Newer Older
1 2
# List all required files here (cmake best practice to NOT automate this step!)
add_library(pls STATIC
3
        include/pls/algorithms/loop_partition_strategy.h
4 5 6 7 8
        include/pls/algorithms/for_each.h include/pls/algorithms/for_each_impl.h
        include/pls/algorithms/invoke.h include/pls/algorithms/invoke_impl.h
        include/pls/algorithms/loop_partition_strategy.h
        include/pls/algorithms/reduce.h include/pls/algorithms/reduce_impl.h

FritzFlorian committed
9
        include/pls/internal/base/spin_lock.h
10 11 12 13
        include/pls/internal/base/tas_spin_lock.h src/internal/base/tas_spin_lock.cpp
        include/pls/internal/base/ttas_spin_lock.h src/internal/base/ttas_spin_lock.cpp
        include/pls/internal/base/swmr_spin_lock.h src/internal/base/swmr_spin_lock.cpp
        include/pls/internal/base/barrier.h src/internal/base/barrier.cpp
14
        include/pls/internal/base/system_details.h src/internal/base/system_details.cpp
15
        include/pls/internal/base/error_handling.h src/internal/base/error_handling.cpp
16
        include/pls/internal/base/alignment.h src/internal/base/alignment.cpp
17
        include/pls/internal/base/stack_allocator.h src/internal/base/stack_allocator.cpp
18

19 20 21
        include/pls/internal/data_structures/aligned_stack.h src/internal/data_structures/aligned_stack.cpp
        include/pls/internal/data_structures/aligned_stack_impl.h
        include/pls/internal/data_structures/stamped_integer.h
22
        include/pls/internal/data_structures/delayed_initialization.h
23 24 25
        include/pls/internal/data_structures/bounded_trading_deque.h
        include/pls/internal/data_structures/bounded_ws_deque.h
        include/pls/internal/data_structures/optional.h
26 27 28

        include/pls/internal/helpers/prohibit_new.h
        include/pls/internal/helpers/profiler.h
FritzFlorian committed
29
        include/pls/internal/helpers/unique_id.h
30
        include/pls/internal/helpers/range.h
31
        include/pls/internal/helpers/seqence.h
32
        include/pls/internal/helpers/member_function.h
33

34
        include/pls/internal/scheduling/scheduler.h include/pls/internal/scheduling/scheduler_impl.h src/internal/scheduling/scheduler.cpp
35 36 37 38 39 40 41
        include/pls/internal/scheduling/base_task.h src/internal/scheduling/base_task.cpp
        include/pls/internal/scheduling/thread_state.h src/internal/scheduling/thread_state.cpp
        include/pls/internal/scheduling/task_manager.h

        include/pls/internal/scheduling/lock_free/task.h
        include/pls/internal/scheduling/lock_free/task_manager.h src/internal/scheduling/lock_free/task_manager.cpp
        include/pls/internal/scheduling/lock_free/external_trading_deque.h src/internal/scheduling/lock_free/external_trading_deque.cpp
42
        include/pls/internal/scheduling/lock_free/traded_cas_field.h src/internal/scheduling/lock_free/task.cpp)
43

44 45 46 47 48 49 50
# Dependencies for pls
target_link_libraries(pls Threads::Threads)
target_link_libraries(pls context_switcher)
if (EASY_PROFILER)
    target_link_libraries(pls easy_profiler)
endif ()

51 52 53
# Add everything in `./include` to be in the include path of this project
target_include_directories(pls
        PUBLIC
54 55
        $<INSTALL_INTERFACE:include>
        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
56
        PRIVATE
57 58
        ${CMAKE_CURRENT_SOURCE_DIR}/src # TODO: Set this up when we require private headers
        )
59

60
# Rules for installing the library on a system
61
# ...binaries
62
INSTALL(TARGETS pls
63
        EXPORT pls-targets
64 65
        LIBRARY DESTINATION lib/pls
        ARCHIVE DESTINATION lib/pls
66
        )
67
# ...all headers in `include`
68 69
INSTALL(
        DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/pls
70 71 72
        DESTINATION include
        FILES_MATCHING PATTERN "*.h*"
)
73 74 75 76 77 78 79 80 81 82 83
# ...allow our project to be a cmake dependency
install(
        EXPORT pls-targets
        FILE plsTargets.cmake
        NAMESPACE pls::
        DESTINATION lib/pls
)
INSTALl(
        FILES pls-config.cmake
        DESTINATION lib/pls
)