Debian Codegraph @

docpages/example_code/CMakeLists.txt

raw
1 #
2 # D++ (DPP), The Lightweight C++ Discord Library
3 #
4 # Copyright 2021 Craig Edwards <[email protected]>
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18
19 # Example programs test compilation
20 # This build script is executed by a GitHub action to ensure all example
21 # programs compile correctly. It does not attempt to run them, as there
22 # is no way to know if the program successfully did its thing, plus
23 # examples do not have a valid token. This build script assumes the
24 # following system dependencies are available:
25 #
26 # g++-12 or later
27 # liboggz-dev
28 # libmpg123-dev
29 # dpp latest master with -DDPP_CORO=ON installed sytemwide
30
31 cmake_minimum_required (VERSION 3.16)
32 project(documentation_tests)
33
34 include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/colour.cmake")
35
36 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDPP_CORO -std=c++20 -pthread -O0 -fPIC -rdynamic -DFMT_HEADER_ONLY -Wall -Wextra -Wpedantic -Werror -Wno-unused-parameter -Wno-deprecated-declarations")
37 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
38
39 file(GLOB example_list ./*.cpp)
40 foreach (example ${example_list})
41 get_filename_component(examplename ${example} NAME)
42 message(STATUS "Found example '${BoldBlue}${examplename}${ColourReset}'")
43 add_executable(${examplename}_out ${example})
44 target_link_libraries(${examplename}_out dl dpp mpg123 oggz ogg opusfile opus)
45 include_directories(/usr/include/opus)
46 endforeach(example)