Loading .gitea/workflows/linux-aarch64-gcc.yml +6 −134 Original line number Diff line number Diff line Loading @@ -27,150 +27,22 @@ concurrency: permissions: contents: read jobs: linux-gcc: linux-gcc-aarch64: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 - name: cache-qemu id: cache-qemu uses: actions/cache@v4 with: path: qemu-install key: qemu-aarch64-install-20220502-ubuntu-2004-2 - name: install-qemu-build-deps if: steps.cache-qemu.outputs.cache-hit != 'true' run: | sudo apt-get update -y sudo apt-get install -y autoconf automake autotools-dev ninja-build - name: checkout-qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | mkdir qemu && cd qemu git init git remote add origin https://gitlab.com/qemu-project/qemu.git git fetch --depth=1 origin f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 git checkout f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 # uses: actions/checkout@v4 # with: # repository: qemu/qemu # path: qemu # ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - name: qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | cd qemu ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=aarch64-linux-user --disable-system make -j$(nproc) make install - name: aarch64-gnu-toolchain run: | sudo apt-get update -y sudo apt-get install -y cmake make g++-aarch64-linux-gnu - name: build run: | mkdir build && cd build cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DSLED_BUILD_TESTS=ON -DSLED_BUILD_BENCHMARK=ON cmake --build . -j $(nproc) - name: test run: | export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH cd build TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j $(nproc) linux-gcc-arm82: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 - name: cache-qemu id: cache-qemu uses: actions/cache@v4 with: path: qemu-install key: qemu-aarch64-install-20220502-ubuntu-2004-2 - name: install-qemu-build-deps if: steps.cache-qemu.outputs.cache-hit != 'true' run: | sudo apt-get update -y sudo apt-get install -y autoconf automake autotools-dev ninja-build - name: checkout-qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | mkdir qemu && cd qemu git init git remote add origin https://gitlab.com/qemu-project/qemu.git git fetch --depth=1 origin f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 git checkout f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 # uses: actions/checkout@v4 # with: # repository: qemu/qemu # path: qemu # ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - name: qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | cd qemu ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=aarch64-linux-user --disable-system make -j$(nproc) make install - name: aarch64-gnu-toolchain run: | sudo apt-get update -y sudo apt-get install -y cmake make g++-aarch64-linux-gnu - name: build run: | mkdir build && cd build cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DSLED_BUILD_TESTS=ON -DSLED_BUILD_BENCHMARK=ON cmake --build . -j $(nproc) - name: test run: | export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH cd build TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j $(nproc) linux-gcc-arm86: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: cache-qemu id: cache-qemu uses: actions/cache@v4 with: path: qemu-install key: qemu-aarch64-install-20230717 - name: install-qemu-build-deps if: steps.cache-qemu.outputs.cache-hit != 'true' run: | sudo apt-get update -y sudo apt-get install -y autoconf automake autotools-dev ninja-build - name: checkout-qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | mkdir qemu && cd qemu git init git remote add origin https://gitlab.com/qemu-project/qemu.git git fetch --depth=1 origin f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 git checkout f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 # uses: actions/checkout@v4 # with: # repository: qemu/qemu # path: qemu # ref: ed8ad9728a9c0eec34db9dff61dfa2f1dd625637 - name: qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | cd qemu ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=aarch64-linux-user --disable-system make -j$(nproc) make install - name: aarch64-gnu-toolchain run: | sudo apt-get update -y sudo apt-get install -y cmake make g++-aarch64-linux-gnu sudo apt-get install -y cmake make g++-aarch64-linux-gnu qemu-user-binfmt - name: build run: | mkdir build && cd build cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DSLED_BUILD_TESTS=ON -DSLED_BUILD_BENCHMARK=ON cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DSLED_BUILD_TESTS=ON -DSLED_BUILD_BENCHMARK=ON .. cmake --build . -j $(nproc) - name: test run: |- export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH cd build TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j $(nproc) ln -sf /usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1 /lib/ld-linux-aarch64.so.1 export LD_LIBRARY_PATH=/usr/aarch64-linux-gnu/lib ctest --output-on-failure -j$(nproc) .gitea/workflows/linux-arm-gcc.yml +39 −123 Original line number Diff line number Diff line --- name: linux-arm-gcc on: push: paths: - .gitea/workflows/linux-arm-gcc.yml - 'toolchains/arm-linux-gnueabi.toolchain.cmake' - 'toolchains/arm-linux-gnueabihf.toolchain.cmake' - toolchains/arm-linux-gnueabi.toolchain.cmake - toolchains/arm-linux-gnueabihf.toolchain.cmake - 3party/** - include/** - src/** Loading @@ -16,8 +15,8 @@ on: pull_request: paths: - .gitea/workflows/linux-arm-gcc.yml - 'toolchains/arm-linux-gnueabi.toolchain.cmake' - 'toolchains/arm-linux-gnueabihf.toolchain.cmake' - toolchains/arm-linux-gnueabi.toolchain.cmake - toolchains/arm-linux-gnueabihf.toolchain.cmake - 3party/** - include/** - src/** Loading @@ -27,125 +26,42 @@ on: concurrency: group: linux-arm-gcc-${{ github.ref }} cancel-in-progress: true jobs: linux-gcc-arm: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 - name: cache-qemu id: cache-qemu uses: actions/cache@v4 with: path: qemu-install key: qemu-arm-install-20220502-2 - name: install-qemu-build-deps if: steps.cache-qemu.outputs.cache-hit != 'true' run: | sudo apt-get update -y sudo apt-get install -y autoconf automake autotools-dev ninja-build - name: checkout-qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | mkdir qemu && cd qemu git init git remote add origin https://gitlab.com/qemu-project/qemu.git git fetch --depth=1 origin f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 git checkout f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 # uses: actions/checkout@v4 # with: # repository: qemu/qemu # path: qemu # ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - name: qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | cd qemu ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=arm-linux-user --disable-system make -j$(nproc) make install - name: set-qemu-cache uses: actions/cache/save@v3 if: steps.cache-qemu.outputs.cache-hit != 'true' with: key: qemu-arm-install-20220502-2 path: qemu-install - name: arm-gnu-toolchain run: | sudo apt-get update -y sudo apt-get install -y cmake make g++-arm-linux-gnueabi - name: build run: | mkdir build && cd build cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabi.toolchain.cmake -DSLED_BUILD_TESTS=ON -DSLED_BUILD_TESTS=ON .. cmake --build . -j $(nproc) - name: test run: | export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH cd build TESTS_EXECUTABLE_LOADER=qemu-arm TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/arm-linux-gnueabi" ctest --output-on-failure -j $(nproc) # linux-gcc-arm: # runs-on: ubuntu-20.04 # steps: # - uses: actions/checkout@v4 # - name: arm-gnu-toolchain # run: | # sudo apt-get update -y # sudo apt-get install -y cmake make g++-arm-linux-gnueabi qemu-user-binfmt # - name: build # run: | # mkdir build && cd build # cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabi.toolchain.cmake -DSLED_BUILD_TESTS=ON -DSLED_BUILD_TESTS=ON .. # cmake --build . -j $(nproc) # - name: test # run: | # cd build # ln -sf /usr/arm-linux-gnueabi/lib/ld-linux.so.3 # export LD_LIBRARY_PATH=/usr/arm-linux-gnueabi/lib # qemu-arm ctest --output-on-failure -j$(nproc) linux-gcc-armhf: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 - name: cache-qemu id: cache-qemu uses: actions/cache@v4 with: path: qemu-install key: qemu-arm-install-20220502-2 - name: install-qemu-build-deps if: steps.cache-qemu.outputs.cache-hit != 'true' run: | sudo apt-get update -y sudo apt-get install -y autoconf automake autotools-dev ninja-build - name: checkout-qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | mkdir qemu && cd qemu git init git remote add origin https://gitlab.com/qemu-project/qemu.git git fetch --depth=1 origin f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 git checkout f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 # uses: actions/checkout@v4 # with: # repository: qemu/qemu # path: qemu # ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - name: qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | cd qemu ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=arm-linux-user --disable-system make -j$(nproc) make install - name: set-qemu-cache uses: actions/cache/save@v3 if: steps.cache-qemu.outputs.cache-hit != 'true' with: key: qemu-arm-install-20220502-2 path: qemu-install - name: arm-gnu-toolchain run: | sudo apt-get update -y sudo apt-get install -y cmake make g++-arm-linux-gnueabihf sudo apt-get install -y cmake make g++-arm-linux-gnueabihf qemu-user-binfmt - name: build run: | mkdir build && cd build cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabihf.toolchain.cmake -DSLED_BUILD_TESTS=ON .. cmake --build . -j $(nproc) - name: test run: | export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH run: |- cd build TESTS_EXECUTABLE_LOADER=qemu-arm TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/arm-linux-gnueabihf" ctest --output-on-failure -j $(nproc) ln -sf /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3 /lib/ld-linux-armhf.so.3 export LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib/ ctest --output-on-failure -j$(nproc) .gitea/workflows/linux-mips64-gcc.yml +4 −36 Original line number Diff line number Diff line Loading @@ -35,51 +35,19 @@ jobs: - uses: actions/checkout@v4 with: submodules: true - name: cache-qemu id: cache-qemu uses: actions/cache@v3 with: path: qemu-install key: qemu-mips64el-install-20220502-2 - name: checkout-qemu # uses: actions/checkout@v4 if: steps.cache-qemu.outputs.cache-hit != 'true' run: | mkdir qemu && cd qemu git init git remote add origin https://gitlab.com/qemu-project/qemu.git git fetch --depth=1 origin f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 git checkout f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - name: install-qemu-build-deps if: steps.cache-qemu.outputs.cache-hit != 'true' run: | sudo apt-get update -y sudo apt-get install -y autoconf automake autotools-dev ninja-build - name: qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | cd $GITHUB_WORKSPACE/qemu ./configure --target-list=mips64el-linux-user --prefix=$GITHUB_WORKSPACE/qemu-install make -j `nproc` make install - name: set-qemu-cache uses: actions/cache/save@v3 if: steps.cache-qemu.outputs.cache-hit != 'true' with: key: qemu-mips64el-install-20220502-2 path: qemu-install - name: mips64el-gnuabi64-toolchain run: | sudo apt-get update -y sudo apt-get install -y cmake make g++-mips64el-linux-gnuabi64 sudo apt-get install -y cmake make g++-mips64el-linux-gnuabi64 qemu-user-binfmt - name: configure run: | mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DSLED_BUILD_TESTS=ON -DCMAKE_TOOLCHAIN_FILE=../toolchains/mips64el-linux-gnuabi64.toolchain.cmake -DCMAKE_CROSSCOMPILING_EMULATOR="qemu-mips64el;-L;/usr/mips64el-linux-gnuabi64" cmake .. -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DSLED_BUILD_TESTS=ON -DCMAKE_TOOLCHAIN_FILE=../toolchains/mips64el-linux-gnuabi64.toolchain.cmake #-DCMAKE_CROSSCOMPILING_EMULATOR="qemu-mips64el;-L;/usr/mips64el-linux-gnuabi64" - name: build run: cmake --build build --target all -j `nproc` - name: test run: |- export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH cd build ln -sf /usr/mips64el-linux-gnuabi64/lib64/ld.so.1 /lib64/ld.so.1 export LD_LIBRARY_PATH=/usr/mips64el-linux-gnuabi64/lib ctest --output-on-failure -j`nproc` 3party/asyncplusplus/CMakeLists.txt +104 −100 Original line number Diff line number Diff line Loading @@ -7,21 +7,21 @@ # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. cmake_minimum_required(VERSION 3.1) project(Async++ C CXX) option(BUILD_SHARED_LIBS "Build Async++ as a shared library" ON) option(BUILD_SHARED_LIBS "Build Async++ as a shared library" OFF) option(USE_CXX_EXCEPTIONS "Enable C++ exception support" ON) if(APPLE) option(BUILD_FRAMEWORK "Build a Mac OS X framework instead of a library" OFF) Loading @@ -48,8 +48,7 @@ set(ASYNCXX_INCLUDE ${PROJECT_SOURCE_DIR}/include/async++/task.h ${PROJECT_SOURCE_DIR}/include/async++/task_base.h ${PROJECT_SOURCE_DIR}/include/async++/traits.h ${PROJECT_SOURCE_DIR}/include/async++/when_all_any.h ) ${PROJECT_SOURCE_DIR}/include/async++/when_all_any.h) set(ASYNCXX_SRC ${PROJECT_SOURCE_DIR}/src/internal.h ${PROJECT_SOURCE_DIR}/src/fifo_queue.h Loading @@ -57,11 +56,12 @@ set(ASYNCXX_SRC ${PROJECT_SOURCE_DIR}/src/singleton.h ${PROJECT_SOURCE_DIR}/src/task_wait_event.h ${PROJECT_SOURCE_DIR}/src/threadpool_scheduler.cpp ${PROJECT_SOURCE_DIR}/src/work_steal_queue.h ) source_group(include FILES ${PROJECT_SOURCE_DIR}/include/async++.h ${ASYNCXX_INCLUDE}) ${PROJECT_SOURCE_DIR}/src/work_steal_queue.h) source_group(include FILES ${PROJECT_SOURCE_DIR}/include/async++.h ${ASYNCXX_INCLUDE}) source_group(src FILES ${ASYNCXX_SRC}) add_library(Async++ ${PROJECT_SOURCE_DIR}/include/async++.h ${ASYNCXX_INCLUDE} ${ASYNCXX_SRC}) add_library(Async++ ${PROJECT_SOURCE_DIR}/include/async++.h ${ASYNCXX_INCLUDE} ${ASYNCXX_SRC}) # Async++ only depends on the C++11 standard libraries, but some implementations # require the -pthread compiler flag to enable threading functionality. Loading @@ -82,7 +82,8 @@ target_include_directories(Async++ PRIVATE ${PROJECT_SOURCE_DIR}/include) set_target_properties(Async++ PROPERTIES DEFINE_SYMBOL LIBASYNC_BUILD) if(BUILD_SHARED_LIBS) # Minimize the set of symbols exported by libraries set_target_properties(Async++ PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN ON) set_target_properties(Async++ PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN ON) else() target_compile_definitions(Async++ PUBLIC LIBASYNC_STATIC) endif() Loading @@ -92,10 +93,10 @@ if (NOT MSVC) target_compile_options(Async++ PRIVATE -Wall -Wextra -pedantic) endif() # Async++ doesn't make use of RTTI information, so don't generate it. # There are issues on Apple platforms with exceptions and -fno-rtti, so keep it # enabled there. # See https://stackoverflow.com/questions/21737201/problems-throwing-and-catching-exceptions-on-os-x-with-fno-rtti # Async++ doesn't make use of RTTI information, so don't generate it. There are # issues on Apple platforms with exceptions and -fno-rtti, so keep it enabled # there. See # https://stackoverflow.com/questions/21737201/problems-throwing-and-catching-exceptions-on-os-x-with-fno-rtti if(MSVC) target_compile_options(Async++ PRIVATE /GR-) elseif(NOT APPLE) Loading @@ -104,7 +105,8 @@ endif() # Allow disabling exceptions, but warn the user about the consequences if(NOT USE_CXX_EXCEPTIONS) message(WARNING "Exceptions have been disabled. Any operation that would " message( WARNING "Exceptions have been disabled. Any operation that would " "throw an exception will result in a call to std::abort() instead.") target_compile_definitions(Async++ PUBLIC LIBASYNC_NO_EXCEPTIONS) if(MSVC) Loading @@ -114,52 +116,54 @@ if (NOT USE_CXX_EXCEPTIONS) endif() endif() # /Zc:__cplusplus is required to make __cplusplus accurate # /Zc:__cplusplus is available starting with Visual Studio 2017 version 15.7 # (according to https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus) # That version is equivalent to _MSC_VER==1914 # (according to https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=vs-2019) # CMake's ${MSVC_VERSION} is equivalent to _MSC_VER # (according to https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html#variable:MSVC_VERSION) # GREATER and EQUAL are used because GREATER_EQUAL is available starting with CMake 3.7 # (according to https://cmake.org/cmake/help/v3.7/release/3.7.html#commands) # /Zc:__cplusplus is required to make __cplusplus accurate /Zc:__cplusplus is # available starting with Visual Studio 2017 version 15.7 (according to # https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus) That # version is equivalent to _MSC_VER==1914 (according to # https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=vs-2019) # CMake's ${MSVC_VERSION} is equivalent to _MSC_VER (according to # https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html#variable:MSVC_VERSION) # GREATER and EQUAL are used because GREATER_EQUAL is available starting with # CMake 3.7 (according to # https://cmake.org/cmake/help/v3.7/release/3.7.html#commands) if((MSVC) AND ((MSVC_VERSION GREATER 1914) OR (MSVC_VERSION EQUAL 1914))) target_compile_options(Async++ PUBLIC /Zc:__cplusplus) endif() include(CMakePackageConfigHelpers) configure_package_config_file("${CMAKE_CURRENT_LIST_DIR}/Async++Config.cmake.in" "${PROJECT_BINARY_DIR}/Async++Config.cmake" INSTALL_DESTINATION cmake ) configure_package_config_file( "${CMAKE_CURRENT_LIST_DIR}/Async++Config.cmake.in" "${PROJECT_BINARY_DIR}/Async++Config.cmake" INSTALL_DESTINATION cmake) install(FILES "${PROJECT_BINARY_DIR}/Async++Config.cmake" DESTINATION cmake ) install(FILES "${PROJECT_BINARY_DIR}/Async++Config.cmake" DESTINATION cmake) # Install the library and produce a CMake export script include(GNUInstallDirs) install(TARGETS Async++ install( TARGETS Async++ EXPORT Async++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} FRAMEWORK DESTINATION Frameworks ) FRAMEWORK DESTINATION Frameworks) export(EXPORT Async++) install(EXPORT Async++ DESTINATION cmake) if(APPLE AND BUILD_FRAMEWORK) set_target_properties(Async++ PROPERTIES OUTPUT_NAME Async++ FRAMEWORK ON) set_source_files_properties(${ASYNCXX_INCLUDE} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/async++) set_source_files_properties(${PROJECT_SOURCE_DIR}/include/async++.h PROPERTIES MACOSX_PACKAGE_LOCATION Headers) set_source_files_properties( ${ASYNCXX_INCLUDE} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/async++) set_source_files_properties(${PROJECT_SOURCE_DIR}/include/async++.h PROPERTIES MACOSX_PACKAGE_LOCATION Headers) else() set_target_properties(Async++ PROPERTIES OUTPUT_NAME async++) target_include_directories(Async++ INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>) target_include_directories( Async++ INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>) install(FILES ${PROJECT_SOURCE_DIR}/include/async++.h DESTINATION include) install(FILES ${ASYNCXX_INCLUDE} DESTINATION include/async++) endif() SET(CPACK_GENERATOR "DEB") SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "none") #required set(CPACK_GENERATOR "DEB") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "none") # required INCLUDE(CPack) include(CPack) CMakeLists.txt +16 −6 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ target_include_directories(benchmark_main PUBLIC src/) add_library(sled STATIC "") add_subdirectory(3party/minilua EXCLUDE_FROM_ALL) add_subdirectory(3party/gperftools EXCLUDE_FROM_ALL) # add_subdirectory(3party/gperftools EXCLUDE_FROM_ALL) add_subdirectory(3party/asyncplusplus EXCLUDE_FROM_ALL) # add_subdirectory(3party/cppuprofile EXCLUDE_FROM_ALL) # add_subdirectory(3party/protobuf-3.21.12 EXCLUDE_FROM_ALL) Loading Loading @@ -111,6 +111,7 @@ if(SLED_BUILD_BENCHMARK) add_executable( sled_benchmark src/sled/event_bus/event_bus_bench.cc src/sled/random_bench.cc src/sled/strings/base64_bench.cc # src/sled/system/fiber/fiber_bench.cc Loading @@ -134,8 +135,9 @@ function(sled_add_test) add_executable(${SLED_TEST_NAME} ${SLED_TEST_SRCS}) if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(EXTRA_FLAGS -Wthread-safety -g -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls) set(EXTRA_FLAGS # -Wthread-safety -g -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls) target_compile_options(${SLED_TEST_NAME} PRIVATE ${EXTRA_FLAGS}) target_link_options(${SLED_TEST_NAME} PRIVATE ${EXTRA_FLAGS}) Loading Loading @@ -165,7 +167,6 @@ if(SLED_BUILD_TESTS) SRCS src/sled/debugging/demangle_test.cc src/sled/async/async_test.cc src/sled/any_test.cc src/sled/filesystem/path_test.cc src/sled/log/fmt_test.cc src/sled/synchronization/sequence_checker_test.cc Loading @@ -179,11 +180,20 @@ if(SLED_BUILD_TESTS) src/sled/rx_test.cc src/sled/uri_test.cc) sled_add_test(NAME sled_symbolize_test SRCS src/sled/debugging/symbolize_test.cc NO_MAIN) if(NOT ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm") sled_add_test(NAME sled_async_test SRCS src/sled/async/async_test.cc) sled_add_test(NAME sled_thread_pool_test SRCS src/sled/system/thread_pool_test.cc) endif() sled_add_test(NAME sled_event_bus_test SRCS src/sled/event_bus/event_bus_test.cc) sled_add_test(NAME sled_lua_test SRCS tests/lua_test.cc) sled_add_test(NAME sled_move_on_copy_test SRCS src/sled/utility/move_on_copy_test.cc) sled_add_test(NAME sled_symbolize_test SRCS src/sled/debugging/symbolize_test.cc NO_MAIN) sled_add_test(NAME sled_sigslot_test SRCS src/sled/sigslot_test.cc) endif(SLED_BUILD_TESTS) if(SLED_BUILD_FUZZ) Loading Loading
.gitea/workflows/linux-aarch64-gcc.yml +6 −134 Original line number Diff line number Diff line Loading @@ -27,150 +27,22 @@ concurrency: permissions: contents: read jobs: linux-gcc: linux-gcc-aarch64: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 - name: cache-qemu id: cache-qemu uses: actions/cache@v4 with: path: qemu-install key: qemu-aarch64-install-20220502-ubuntu-2004-2 - name: install-qemu-build-deps if: steps.cache-qemu.outputs.cache-hit != 'true' run: | sudo apt-get update -y sudo apt-get install -y autoconf automake autotools-dev ninja-build - name: checkout-qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | mkdir qemu && cd qemu git init git remote add origin https://gitlab.com/qemu-project/qemu.git git fetch --depth=1 origin f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 git checkout f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 # uses: actions/checkout@v4 # with: # repository: qemu/qemu # path: qemu # ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - name: qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | cd qemu ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=aarch64-linux-user --disable-system make -j$(nproc) make install - name: aarch64-gnu-toolchain run: | sudo apt-get update -y sudo apt-get install -y cmake make g++-aarch64-linux-gnu - name: build run: | mkdir build && cd build cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DSLED_BUILD_TESTS=ON -DSLED_BUILD_BENCHMARK=ON cmake --build . -j $(nproc) - name: test run: | export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH cd build TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j $(nproc) linux-gcc-arm82: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 - name: cache-qemu id: cache-qemu uses: actions/cache@v4 with: path: qemu-install key: qemu-aarch64-install-20220502-ubuntu-2004-2 - name: install-qemu-build-deps if: steps.cache-qemu.outputs.cache-hit != 'true' run: | sudo apt-get update -y sudo apt-get install -y autoconf automake autotools-dev ninja-build - name: checkout-qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | mkdir qemu && cd qemu git init git remote add origin https://gitlab.com/qemu-project/qemu.git git fetch --depth=1 origin f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 git checkout f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 # uses: actions/checkout@v4 # with: # repository: qemu/qemu # path: qemu # ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - name: qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | cd qemu ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=aarch64-linux-user --disable-system make -j$(nproc) make install - name: aarch64-gnu-toolchain run: | sudo apt-get update -y sudo apt-get install -y cmake make g++-aarch64-linux-gnu - name: build run: | mkdir build && cd build cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DSLED_BUILD_TESTS=ON -DSLED_BUILD_BENCHMARK=ON cmake --build . -j $(nproc) - name: test run: | export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH cd build TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j $(nproc) linux-gcc-arm86: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: cache-qemu id: cache-qemu uses: actions/cache@v4 with: path: qemu-install key: qemu-aarch64-install-20230717 - name: install-qemu-build-deps if: steps.cache-qemu.outputs.cache-hit != 'true' run: | sudo apt-get update -y sudo apt-get install -y autoconf automake autotools-dev ninja-build - name: checkout-qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | mkdir qemu && cd qemu git init git remote add origin https://gitlab.com/qemu-project/qemu.git git fetch --depth=1 origin f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 git checkout f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 # uses: actions/checkout@v4 # with: # repository: qemu/qemu # path: qemu # ref: ed8ad9728a9c0eec34db9dff61dfa2f1dd625637 - name: qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | cd qemu ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=aarch64-linux-user --disable-system make -j$(nproc) make install - name: aarch64-gnu-toolchain run: | sudo apt-get update -y sudo apt-get install -y cmake make g++-aarch64-linux-gnu sudo apt-get install -y cmake make g++-aarch64-linux-gnu qemu-user-binfmt - name: build run: | mkdir build && cd build cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DSLED_BUILD_TESTS=ON -DSLED_BUILD_BENCHMARK=ON cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DSLED_BUILD_TESTS=ON -DSLED_BUILD_BENCHMARK=ON .. cmake --build . -j $(nproc) - name: test run: |- export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH cd build TESTS_EXECUTABLE_LOADER=qemu-aarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/aarch64-linux-gnu" ctest --output-on-failure -j $(nproc) ln -sf /usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1 /lib/ld-linux-aarch64.so.1 export LD_LIBRARY_PATH=/usr/aarch64-linux-gnu/lib ctest --output-on-failure -j$(nproc)
.gitea/workflows/linux-arm-gcc.yml +39 −123 Original line number Diff line number Diff line --- name: linux-arm-gcc on: push: paths: - .gitea/workflows/linux-arm-gcc.yml - 'toolchains/arm-linux-gnueabi.toolchain.cmake' - 'toolchains/arm-linux-gnueabihf.toolchain.cmake' - toolchains/arm-linux-gnueabi.toolchain.cmake - toolchains/arm-linux-gnueabihf.toolchain.cmake - 3party/** - include/** - src/** Loading @@ -16,8 +15,8 @@ on: pull_request: paths: - .gitea/workflows/linux-arm-gcc.yml - 'toolchains/arm-linux-gnueabi.toolchain.cmake' - 'toolchains/arm-linux-gnueabihf.toolchain.cmake' - toolchains/arm-linux-gnueabi.toolchain.cmake - toolchains/arm-linux-gnueabihf.toolchain.cmake - 3party/** - include/** - src/** Loading @@ -27,125 +26,42 @@ on: concurrency: group: linux-arm-gcc-${{ github.ref }} cancel-in-progress: true jobs: linux-gcc-arm: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 - name: cache-qemu id: cache-qemu uses: actions/cache@v4 with: path: qemu-install key: qemu-arm-install-20220502-2 - name: install-qemu-build-deps if: steps.cache-qemu.outputs.cache-hit != 'true' run: | sudo apt-get update -y sudo apt-get install -y autoconf automake autotools-dev ninja-build - name: checkout-qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | mkdir qemu && cd qemu git init git remote add origin https://gitlab.com/qemu-project/qemu.git git fetch --depth=1 origin f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 git checkout f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 # uses: actions/checkout@v4 # with: # repository: qemu/qemu # path: qemu # ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - name: qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | cd qemu ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=arm-linux-user --disable-system make -j$(nproc) make install - name: set-qemu-cache uses: actions/cache/save@v3 if: steps.cache-qemu.outputs.cache-hit != 'true' with: key: qemu-arm-install-20220502-2 path: qemu-install - name: arm-gnu-toolchain run: | sudo apt-get update -y sudo apt-get install -y cmake make g++-arm-linux-gnueabi - name: build run: | mkdir build && cd build cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabi.toolchain.cmake -DSLED_BUILD_TESTS=ON -DSLED_BUILD_TESTS=ON .. cmake --build . -j $(nproc) - name: test run: | export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH cd build TESTS_EXECUTABLE_LOADER=qemu-arm TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/arm-linux-gnueabi" ctest --output-on-failure -j $(nproc) # linux-gcc-arm: # runs-on: ubuntu-20.04 # steps: # - uses: actions/checkout@v4 # - name: arm-gnu-toolchain # run: | # sudo apt-get update -y # sudo apt-get install -y cmake make g++-arm-linux-gnueabi qemu-user-binfmt # - name: build # run: | # mkdir build && cd build # cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabi.toolchain.cmake -DSLED_BUILD_TESTS=ON -DSLED_BUILD_TESTS=ON .. # cmake --build . -j $(nproc) # - name: test # run: | # cd build # ln -sf /usr/arm-linux-gnueabi/lib/ld-linux.so.3 # export LD_LIBRARY_PATH=/usr/arm-linux-gnueabi/lib # qemu-arm ctest --output-on-failure -j$(nproc) linux-gcc-armhf: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 - name: cache-qemu id: cache-qemu uses: actions/cache@v4 with: path: qemu-install key: qemu-arm-install-20220502-2 - name: install-qemu-build-deps if: steps.cache-qemu.outputs.cache-hit != 'true' run: | sudo apt-get update -y sudo apt-get install -y autoconf automake autotools-dev ninja-build - name: checkout-qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | mkdir qemu && cd qemu git init git remote add origin https://gitlab.com/qemu-project/qemu.git git fetch --depth=1 origin f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 git checkout f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 # uses: actions/checkout@v4 # with: # repository: qemu/qemu # path: qemu # ref: f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - name: qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | cd qemu ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=arm-linux-user --disable-system make -j$(nproc) make install - name: set-qemu-cache uses: actions/cache/save@v3 if: steps.cache-qemu.outputs.cache-hit != 'true' with: key: qemu-arm-install-20220502-2 path: qemu-install - name: arm-gnu-toolchain run: | sudo apt-get update -y sudo apt-get install -y cmake make g++-arm-linux-gnueabihf sudo apt-get install -y cmake make g++-arm-linux-gnueabihf qemu-user-binfmt - name: build run: | mkdir build && cd build cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabihf.toolchain.cmake -DSLED_BUILD_TESTS=ON .. cmake --build . -j $(nproc) - name: test run: | export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH run: |- cd build TESTS_EXECUTABLE_LOADER=qemu-arm TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/arm-linux-gnueabihf" ctest --output-on-failure -j $(nproc) ln -sf /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3 /lib/ld-linux-armhf.so.3 export LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib/ ctest --output-on-failure -j$(nproc)
.gitea/workflows/linux-mips64-gcc.yml +4 −36 Original line number Diff line number Diff line Loading @@ -35,51 +35,19 @@ jobs: - uses: actions/checkout@v4 with: submodules: true - name: cache-qemu id: cache-qemu uses: actions/cache@v3 with: path: qemu-install key: qemu-mips64el-install-20220502-2 - name: checkout-qemu # uses: actions/checkout@v4 if: steps.cache-qemu.outputs.cache-hit != 'true' run: | mkdir qemu && cd qemu git init git remote add origin https://gitlab.com/qemu-project/qemu.git git fetch --depth=1 origin f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 git checkout f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 - name: install-qemu-build-deps if: steps.cache-qemu.outputs.cache-hit != 'true' run: | sudo apt-get update -y sudo apt-get install -y autoconf automake autotools-dev ninja-build - name: qemu if: steps.cache-qemu.outputs.cache-hit != 'true' run: | cd $GITHUB_WORKSPACE/qemu ./configure --target-list=mips64el-linux-user --prefix=$GITHUB_WORKSPACE/qemu-install make -j `nproc` make install - name: set-qemu-cache uses: actions/cache/save@v3 if: steps.cache-qemu.outputs.cache-hit != 'true' with: key: qemu-mips64el-install-20220502-2 path: qemu-install - name: mips64el-gnuabi64-toolchain run: | sudo apt-get update -y sudo apt-get install -y cmake make g++-mips64el-linux-gnuabi64 sudo apt-get install -y cmake make g++-mips64el-linux-gnuabi64 qemu-user-binfmt - name: configure run: | mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DSLED_BUILD_TESTS=ON -DCMAKE_TOOLCHAIN_FILE=../toolchains/mips64el-linux-gnuabi64.toolchain.cmake -DCMAKE_CROSSCOMPILING_EMULATOR="qemu-mips64el;-L;/usr/mips64el-linux-gnuabi64" cmake .. -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DSLED_BUILD_TESTS=ON -DCMAKE_TOOLCHAIN_FILE=../toolchains/mips64el-linux-gnuabi64.toolchain.cmake #-DCMAKE_CROSSCOMPILING_EMULATOR="qemu-mips64el;-L;/usr/mips64el-linux-gnuabi64" - name: build run: cmake --build build --target all -j `nproc` - name: test run: |- export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH cd build ln -sf /usr/mips64el-linux-gnuabi64/lib64/ld.so.1 /lib64/ld.so.1 export LD_LIBRARY_PATH=/usr/mips64el-linux-gnuabi64/lib ctest --output-on-failure -j`nproc`
3party/asyncplusplus/CMakeLists.txt +104 −100 Original line number Diff line number Diff line Loading @@ -7,21 +7,21 @@ # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. cmake_minimum_required(VERSION 3.1) project(Async++ C CXX) option(BUILD_SHARED_LIBS "Build Async++ as a shared library" ON) option(BUILD_SHARED_LIBS "Build Async++ as a shared library" OFF) option(USE_CXX_EXCEPTIONS "Enable C++ exception support" ON) if(APPLE) option(BUILD_FRAMEWORK "Build a Mac OS X framework instead of a library" OFF) Loading @@ -48,8 +48,7 @@ set(ASYNCXX_INCLUDE ${PROJECT_SOURCE_DIR}/include/async++/task.h ${PROJECT_SOURCE_DIR}/include/async++/task_base.h ${PROJECT_SOURCE_DIR}/include/async++/traits.h ${PROJECT_SOURCE_DIR}/include/async++/when_all_any.h ) ${PROJECT_SOURCE_DIR}/include/async++/when_all_any.h) set(ASYNCXX_SRC ${PROJECT_SOURCE_DIR}/src/internal.h ${PROJECT_SOURCE_DIR}/src/fifo_queue.h Loading @@ -57,11 +56,12 @@ set(ASYNCXX_SRC ${PROJECT_SOURCE_DIR}/src/singleton.h ${PROJECT_SOURCE_DIR}/src/task_wait_event.h ${PROJECT_SOURCE_DIR}/src/threadpool_scheduler.cpp ${PROJECT_SOURCE_DIR}/src/work_steal_queue.h ) source_group(include FILES ${PROJECT_SOURCE_DIR}/include/async++.h ${ASYNCXX_INCLUDE}) ${PROJECT_SOURCE_DIR}/src/work_steal_queue.h) source_group(include FILES ${PROJECT_SOURCE_DIR}/include/async++.h ${ASYNCXX_INCLUDE}) source_group(src FILES ${ASYNCXX_SRC}) add_library(Async++ ${PROJECT_SOURCE_DIR}/include/async++.h ${ASYNCXX_INCLUDE} ${ASYNCXX_SRC}) add_library(Async++ ${PROJECT_SOURCE_DIR}/include/async++.h ${ASYNCXX_INCLUDE} ${ASYNCXX_SRC}) # Async++ only depends on the C++11 standard libraries, but some implementations # require the -pthread compiler flag to enable threading functionality. Loading @@ -82,7 +82,8 @@ target_include_directories(Async++ PRIVATE ${PROJECT_SOURCE_DIR}/include) set_target_properties(Async++ PROPERTIES DEFINE_SYMBOL LIBASYNC_BUILD) if(BUILD_SHARED_LIBS) # Minimize the set of symbols exported by libraries set_target_properties(Async++ PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN ON) set_target_properties(Async++ PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN ON) else() target_compile_definitions(Async++ PUBLIC LIBASYNC_STATIC) endif() Loading @@ -92,10 +93,10 @@ if (NOT MSVC) target_compile_options(Async++ PRIVATE -Wall -Wextra -pedantic) endif() # Async++ doesn't make use of RTTI information, so don't generate it. # There are issues on Apple platforms with exceptions and -fno-rtti, so keep it # enabled there. # See https://stackoverflow.com/questions/21737201/problems-throwing-and-catching-exceptions-on-os-x-with-fno-rtti # Async++ doesn't make use of RTTI information, so don't generate it. There are # issues on Apple platforms with exceptions and -fno-rtti, so keep it enabled # there. See # https://stackoverflow.com/questions/21737201/problems-throwing-and-catching-exceptions-on-os-x-with-fno-rtti if(MSVC) target_compile_options(Async++ PRIVATE /GR-) elseif(NOT APPLE) Loading @@ -104,7 +105,8 @@ endif() # Allow disabling exceptions, but warn the user about the consequences if(NOT USE_CXX_EXCEPTIONS) message(WARNING "Exceptions have been disabled. Any operation that would " message( WARNING "Exceptions have been disabled. Any operation that would " "throw an exception will result in a call to std::abort() instead.") target_compile_definitions(Async++ PUBLIC LIBASYNC_NO_EXCEPTIONS) if(MSVC) Loading @@ -114,52 +116,54 @@ if (NOT USE_CXX_EXCEPTIONS) endif() endif() # /Zc:__cplusplus is required to make __cplusplus accurate # /Zc:__cplusplus is available starting with Visual Studio 2017 version 15.7 # (according to https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus) # That version is equivalent to _MSC_VER==1914 # (according to https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=vs-2019) # CMake's ${MSVC_VERSION} is equivalent to _MSC_VER # (according to https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html#variable:MSVC_VERSION) # GREATER and EQUAL are used because GREATER_EQUAL is available starting with CMake 3.7 # (according to https://cmake.org/cmake/help/v3.7/release/3.7.html#commands) # /Zc:__cplusplus is required to make __cplusplus accurate /Zc:__cplusplus is # available starting with Visual Studio 2017 version 15.7 (according to # https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus) That # version is equivalent to _MSC_VER==1914 (according to # https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=vs-2019) # CMake's ${MSVC_VERSION} is equivalent to _MSC_VER (according to # https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html#variable:MSVC_VERSION) # GREATER and EQUAL are used because GREATER_EQUAL is available starting with # CMake 3.7 (according to # https://cmake.org/cmake/help/v3.7/release/3.7.html#commands) if((MSVC) AND ((MSVC_VERSION GREATER 1914) OR (MSVC_VERSION EQUAL 1914))) target_compile_options(Async++ PUBLIC /Zc:__cplusplus) endif() include(CMakePackageConfigHelpers) configure_package_config_file("${CMAKE_CURRENT_LIST_DIR}/Async++Config.cmake.in" "${PROJECT_BINARY_DIR}/Async++Config.cmake" INSTALL_DESTINATION cmake ) configure_package_config_file( "${CMAKE_CURRENT_LIST_DIR}/Async++Config.cmake.in" "${PROJECT_BINARY_DIR}/Async++Config.cmake" INSTALL_DESTINATION cmake) install(FILES "${PROJECT_BINARY_DIR}/Async++Config.cmake" DESTINATION cmake ) install(FILES "${PROJECT_BINARY_DIR}/Async++Config.cmake" DESTINATION cmake) # Install the library and produce a CMake export script include(GNUInstallDirs) install(TARGETS Async++ install( TARGETS Async++ EXPORT Async++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} FRAMEWORK DESTINATION Frameworks ) FRAMEWORK DESTINATION Frameworks) export(EXPORT Async++) install(EXPORT Async++ DESTINATION cmake) if(APPLE AND BUILD_FRAMEWORK) set_target_properties(Async++ PROPERTIES OUTPUT_NAME Async++ FRAMEWORK ON) set_source_files_properties(${ASYNCXX_INCLUDE} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/async++) set_source_files_properties(${PROJECT_SOURCE_DIR}/include/async++.h PROPERTIES MACOSX_PACKAGE_LOCATION Headers) set_source_files_properties( ${ASYNCXX_INCLUDE} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/async++) set_source_files_properties(${PROJECT_SOURCE_DIR}/include/async++.h PROPERTIES MACOSX_PACKAGE_LOCATION Headers) else() set_target_properties(Async++ PROPERTIES OUTPUT_NAME async++) target_include_directories(Async++ INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>) target_include_directories( Async++ INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>) install(FILES ${PROJECT_SOURCE_DIR}/include/async++.h DESTINATION include) install(FILES ${ASYNCXX_INCLUDE} DESTINATION include/async++) endif() SET(CPACK_GENERATOR "DEB") SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "none") #required set(CPACK_GENERATOR "DEB") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "none") # required INCLUDE(CPack) include(CPack)
CMakeLists.txt +16 −6 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ target_include_directories(benchmark_main PUBLIC src/) add_library(sled STATIC "") add_subdirectory(3party/minilua EXCLUDE_FROM_ALL) add_subdirectory(3party/gperftools EXCLUDE_FROM_ALL) # add_subdirectory(3party/gperftools EXCLUDE_FROM_ALL) add_subdirectory(3party/asyncplusplus EXCLUDE_FROM_ALL) # add_subdirectory(3party/cppuprofile EXCLUDE_FROM_ALL) # add_subdirectory(3party/protobuf-3.21.12 EXCLUDE_FROM_ALL) Loading Loading @@ -111,6 +111,7 @@ if(SLED_BUILD_BENCHMARK) add_executable( sled_benchmark src/sled/event_bus/event_bus_bench.cc src/sled/random_bench.cc src/sled/strings/base64_bench.cc # src/sled/system/fiber/fiber_bench.cc Loading @@ -134,8 +135,9 @@ function(sled_add_test) add_executable(${SLED_TEST_NAME} ${SLED_TEST_SRCS}) if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(EXTRA_FLAGS -Wthread-safety -g -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls) set(EXTRA_FLAGS # -Wthread-safety -g -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls) target_compile_options(${SLED_TEST_NAME} PRIVATE ${EXTRA_FLAGS}) target_link_options(${SLED_TEST_NAME} PRIVATE ${EXTRA_FLAGS}) Loading Loading @@ -165,7 +167,6 @@ if(SLED_BUILD_TESTS) SRCS src/sled/debugging/demangle_test.cc src/sled/async/async_test.cc src/sled/any_test.cc src/sled/filesystem/path_test.cc src/sled/log/fmt_test.cc src/sled/synchronization/sequence_checker_test.cc Loading @@ -179,11 +180,20 @@ if(SLED_BUILD_TESTS) src/sled/rx_test.cc src/sled/uri_test.cc) sled_add_test(NAME sled_symbolize_test SRCS src/sled/debugging/symbolize_test.cc NO_MAIN) if(NOT ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm") sled_add_test(NAME sled_async_test SRCS src/sled/async/async_test.cc) sled_add_test(NAME sled_thread_pool_test SRCS src/sled/system/thread_pool_test.cc) endif() sled_add_test(NAME sled_event_bus_test SRCS src/sled/event_bus/event_bus_test.cc) sled_add_test(NAME sled_lua_test SRCS tests/lua_test.cc) sled_add_test(NAME sled_move_on_copy_test SRCS src/sled/utility/move_on_copy_test.cc) sled_add_test(NAME sled_symbolize_test SRCS src/sled/debugging/symbolize_test.cc NO_MAIN) sled_add_test(NAME sled_sigslot_test SRCS src/sled/sigslot_test.cc) endif(SLED_BUILD_TESTS) if(SLED_BUILD_FUZZ) Loading