Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
cmake_minimum_required(VERSION 3.15)

project(SquidTasks)

add_library(${PROJECT_NAME} INTERFACE)

# There doesn't seem to be a coroutines feature in CMAKE_CXX_KNOWN_FEATURES

# Some errors in Sample_TextGame with std_20
#target_compile_features(${PROJECT_NAME} INTERFACE "cxx_std_20")

if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(${PROJECT_NAME} INTERFACE "-fcoroutines-ts")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.10)
# Seems like we should use /await:strict here, but seems to fail.
#target_compile_options(${PROJECT_NAME} INTERFACE "/await:strict")
target_compile_options(${PROJECT_NAME} INTERFACE "/await")
else()
target_compile_options(${PROJECT_NAME} INTERFACE "/await")
endif()
endif()

target_include_directories(${PROJECT_NAME} INTERFACE include)

target_sources(${PROJECT_NAME} INTERFACE
include/Task.h
include/TaskManager.h
include/TasksConfig.h
include/TokenList.h
include/TaskFSM.h
include/FunctionGuard.h
# Private
include/Private/TaskPrivate.h
include/Private/TaskFSMPrivate.h
include/Private/TasksCommonPrivate.h
include/Private/tl/optional.hpp
)

option(SQUIDTASKS_BUILD_SAMPLES "Enable building with samples." OFF)

if(SQUIDTASKS_BUILD_SAMPLES)
add_subdirectory(samples/Sample_Tests)
add_subdirectory(samples/Sample_Template)
add_subdirectory(samples/Sample_TextGame)
endif()
10 changes: 10 additions & 0 deletions samples/Sample_Template/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
add_executable(Sample_Template)

target_link_libraries(Sample_Template SquidTasks)

target_include_directories(Sample_Template PRIVATE ../Common)

target_sources(Sample_Template PRIVATE
../Common/TimeSystem.h
Main.cpp
)
10 changes: 10 additions & 0 deletions samples/Sample_Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
add_executable(Sample_Tests)

target_link_libraries(Sample_Tests SquidTasks)

target_include_directories(Sample_Tests PRIVATE ../Common)

target_sources(Sample_Tests PRIVATE
../Common/TimeSystem.h
Main.cpp
)
12 changes: 12 additions & 0 deletions samples/Sample_TextGame/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
add_executable(Sample_TextGame)

target_link_libraries(Sample_TextGame SquidTasks)

target_include_directories(Sample_TextGame PRIVATE ../Common)

target_sources(Sample_TextGame PRIVATE
../Common/TimeSystem.h
TextGame.h
TextInput.h
Main.cpp
)