From 851026a2e4277599504b56540106e63ef78a5440 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Mon, 14 Oct 2024 15:31:43 +0200 Subject: [PATCH 01/11] Changed cmake scripts to integrate areg-sdk --- CMakeLists.txt | 167 +++++++++++++++++++++++++++---------------------- 1 file changed, 92 insertions(+), 75 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cca1d7..432cfba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,64 +1,96 @@ # ################################################################## # This file can be used as an example to integrate areg-sdk into -# the existing project. Use your paths of your project structure +# the existing project. Use your paths of your project structure. # +# Description: In this example, AREG SDK is integrated as a package or +# as sources fetched from https://github.com/aregtech/areg-sdk.git. +# In addition, AREG SDK can be integrated as before +# declaring 'project()' or after. To see the difference, +# pass 'INTEGRATE_AREG_BEFORE_PROJECT' option when calling 'cmake'. +# If 'INTEGRATE_AREG_BEFORE_PROJECT' is 'TRUE' (or 'ON'), AREG SDK is integrated +# before the 'project()' is called and the develop may benefit +# all advantages of 'areg-sdk' project sources or binaries. +# If 'INTEGRATE_AREG_BEFORE_PROJECT' is 'FALSE' (or 'OFF'), the developer may +# manually set own options before integrating 'areg-sdk' in the project. # ################################################################## cmake_minimum_required(VERSION 3.20.0) +macro(macro_load_areg_sdk) + find_package(areg CONFIG) + if (NOT areg_FOUND) + # ################################################################## + # Prepare AREG SDK configuration before fetching from GitHub + # ################################################################## + + # Specify where should AREG SDK output built binary directory + set(AREG_BUILD_ROOT "${AREG_SDK_DEMO_ROOT}/product") + + # Specify where should fetch the thirdparty source codes, including AREG SDK sources + set(AREG_PACKAGES "${AREG_BUILD_ROOT}/packages") + + # Disable building AREG SDK Examples + option(AREG_BUILD_EXAMPLES "Disable areg-sdk examples for Demo" OFF) + + # Disable building AreG SDK unit tests. + option(AREG_BUILD_TESTS "Disable areg-sdk unit tests for Demo" OFF) + + include(FetchContent) + set(FETCHCONTENT_BASE_DIR "${AREG_PACKAGES}") + message(STATUS "Demo: >>> Fetching areg-sdk from https://github.com/aregtech/areg-sdk.git repo to ${FETCHCONTENT_BASE_DIR} directory") + FetchContent_Declare(areg-sdk + GIT_REPOSITORY https://github.com/aregtech/areg-sdk.git + GIT_TAG "bugfix/396-demo-build-fails") + + message(STATUS "Demo: >>> Fetched 'areg-sdk', configuring to make it available...") + FetchContent_MakeAvailable(areg-sdk) + + # Specify the location of 'areg-sdk' root directory. + set(AREG_SDK_ROOT "${areg-sdk_SOURCE_DIR}") + # Optionally, specify the location of cmake configuration files. + set(AREG_CMAKE_CONFIG_DIR "${AREG_SDK_ROOT}/conf/cmake") + message(STATUS "Demo: >>> AREG_SDK_ROOT = \'${AREG_SDK_ROOT}\', going to configure...") + else() + message(STATUS "Demo: >>> Found areg package in \'${areg_DIR}\',\ + configuration file \'${areg_CONFIG}\',\ + library \'${areg_LIBRARY}\',\ + package root is \'${areg_ROOT}\'.") + message(STATUS "Demo: >>> The SDK root \'${AREG_SDK_ROOT}\',\ + configuration files are \'${AREG_CMAKE_CONFIG_DIR}\' directory,\ + tools are in \'${AREG_SDK_TOOLS}\' directory.") + endif() +endmacro(macro_load_areg_sdk) + +# Set Demo project root and sources set(AREG_SDK_DEMO_ROOT "${CMAKE_SOURCE_DIR}") set(AREG_DEMO_SOURCES "${AREG_SDK_DEMO_ROOT}/demo") +# By default, INTEGRATE_AREG_BEFORE_PROJECT is integrated in the project before 'project()' +if (NOT DEFINED INTEGRATE_AREG_BEFORE_PROJECT) + set(INTEGRATE_AREG_BEFORE_PROJECT TRUE) +endif() + + +if (INTEGRATE_AREG_BEFORE_PROJECT) + # if 'INTEGRATE_AREG_BEFORE_PROJECT' is 'TRUE', integrate either 'areg' package or fetch the sources from official repository + macro_load_areg_sdk() + # Declare 'areg-sdk-demo' project after integrating 'areg-sdk' + set(PROJECT_NAME "areg-sdk-demo") + set(PROJECT_VERSION "2.0.0") + project(${PROJECT_NAME} VERSION ${PROJECT_VERSION} LANGUAGES C CXX) +else() + # integrate 'areg-sdk' after 'project()' call + + # Reset compiler settings, because they are not use and they may cause warnings + set(AREG_COMPILER "") + set(AREG_COMPILER_FAMILY "") + # Declare AREG SDK Demo project + set(PROJECT_NAME "areg-sdk-demo") + set(PROJECT_VERSION "1.0.0") + project(${PROJECT_NAME} VERSION ${PROJECT_VERSION} LANGUAGES C CXX) + # integrate areg package or sources + macro_load_areg_sdk() +endif() -set(PROJECT_NAME "areg-sdk-demo") -set(PROJECT_VERSION "1.0.0") -project(${PROJECT_NAME} VERSION ${PROJECT_VERSION} LANGUAGES C CXX) - -find_package(areg CONFIG) - -if (NOT areg_FOUND) - - # ################################################################## - # Prepare AREG SDK configuration before fetching from GitHub - # ################################################################## - - # Specify where should AREG SDK output built binary directory - set(AREG_BUILD_ROOT "${AREG_SDK_DEMO_ROOT}/product") - - # Specify where should fetch the thirdparty source codes, including AREG SDK sources - set(AREG_PACKAGES "${AREG_BUILD_ROOT}/packages") - - # Specify AREG Framework library type - set(AREG_BINARY "shared") - - # Disable building AREG SDK Examples - option(AREG_BUILD_EXAMPLES "Disable building areg-sdk examples" OFF) - - # Disable building AreG SDK unit tests. - option(AREG_BUILD_TESTS "Disable building areg-sdk unit tests" OFF) - - include(FetchContent) - set(FETCHCONTENT_BASE_DIR "${AREG_PACKAGES}") - message(STATUS "Demo: >>> Fetching areg-sdk from https://github.com/aregtech/areg-sdk.git repo to ${FETCHCONTENT_BASE_DIR} directory") - FetchContent_Declare(areg-sdk - GIT_REPOSITORY https://github.com/aregtech/areg-sdk.git - GIT_TAG "master") - - FetchContent_MakeAvailable(areg-sdk) - - set(AREG_SDK_ROOT "${areg-sdk_SOURCE_DIR}") - set(AREG_CMAKE_CONFIG_DIR "${AREG_SDK_ROOT}/conf/cmake") - -else(NOT areg_FOUND) - - message(STATUS "Demo: >>> Found areg package in \'${areg_DIR}\',\ - configuration file \'${areg_CONFIG}\',\ - library \'${areg_LIBRARY}\',\ - package root is \'${areg_ROOT}\'.") - message(STATUS "Demo: >>> The SDK root \'${AREG_SDK_ROOT}\',\ - configuration files are \'${AREG_CMAKE_CONFIG_DIR}\' directory,\ - tools are in \'${AREG_SDK_TOOLS}\' directory.") - -endif(NOT areg_FOUND) # ################################################################## # We are ready to develop AREG SDK base applications. @@ -68,7 +100,7 @@ endif(NOT areg_FOUND) # 1. Set 'AREG_SDK_ROOT' variable --> see above. It is either '${areg-sdk_SOURCE_DIR}' or '${areg-sdk_DIR}' # 2. Include '${AREG_SDK_ROOT}conf/cmake/setup.cmake' # 3. Include '${AREG_SDK_ROOT}conf/cmake/common.cmake' -# 4. Set '${AREG_BASE}' path in the includes +# 4. Set '${AREG_FRAMEWORK}' path in the includes # 5. Include your projects to compile project # ################################################################## @@ -80,31 +112,16 @@ include(${AREG_CMAKE_CONFIG_DIR}/setup.cmake) # Step 3: include '${AREG_SDK_ROOT}/conf/cmake/common.cmake' include(${AREG_CMAKE_CONFIG_DIR}/common.cmake) -# Step 4: Set '${AREG_BASE}' path in the includes -include_directories(${AREG_BASE}) +# Step 4: Set '${AREG_FRAMEWORK}' path in the includes +include_directories(${AREG_FRAMEWORK}) # Step 5: Include your projects # Start building Demo applications include("${AREG_DEMO_SOURCES}/CMakeLists.txt") -message(STATUS ">>> Demo: After AREG_SDK_ROOT = ${AREG_SDK_ROOT}, AREG_BASE = ${AREG_BASE}") - -# Print the configuration status -message(STATUS "=======================================================================================") -message(STATUS "------------------> AREG SDK Demo project CMake Status Report Begin <------------------") -message(STATUS "=======================================================================================") -message(STATUS "Demo: >>> CMAKE_SOURCE_DIR = \'${CMAKE_SOURCE_DIR}\', build type \'${CMAKE_BUILD_TYPE}\'") -message(STATUS "Demo: >>> Build ...........: \'${CMAKE_SYSTEM_NAME}\' system, \'${AREG_BITNESS}\'-bit platform, \'${AREG_PROCESSOR}\' CPU") -message(STATUS "Demo: >>> Compiler ........: \'${CMAKE_CXX_COMPILER}\'") -message(STATUS "Demo: >>> Compiler Version : C++ standard \'c++${CMAKE_CXX_STANDARD}\', compiler family \'${AREG_COMPILER_FAMILY}\'") -message(STATUS "Demo: >>> Binary output ...: \'${CMAKE_RUNTIME_OUTPUT_DIRECTORY}\', extension '${CMAKE_EXECUTABLE_SUFFIX}'") -message(STATUS "Demo: >>> Generated files .: \'${AREG_GENERATE_DIR}\' directory") -message(STATUS "Demo: >>> Packages ........: \'${FETCHCONTENT_BASE_DIR}\' directory") -message(STATUS "Demo: >>> Build libraries .: areg is \'${AREG_BINARY}\', aregextend is static, areglogger is \'${AREG_LOGGER_LIB}\' library") -message(STATUS "Demo: >>> Java version ....: \'${Java_VERSION_STRING}\' of version \'${Java_JAVA_EXECUTABLE}\'. Minimum should be 17") -message(STATUS "Demo: >>> Use of packages .: SQLite3 package use is \'${AREG_SQLITE_PACKAGE}\', GTest package use is \'${AREG_GTEST_PACKAGE}\' ") -message(STATUS "Demo: >>> Other options ...: Examples = \'${AREG_BUILD_EXAMPLES}\', Unit Tests = \'${AREG_BUILD_TESTS}\', Demo Extended = \'${AREG_EXTENDED}\', Logs = \'${AREG_LOGS}\'") -message(STATUS "Demo: >>> Installation ....: is '${AREG_INSTALL}', location \'${CMAKE_INSTALL_PREFIX}\'") -message(STATUS "=======================================================================================") -message(STATUS "------------------> AREG SDK Demo project CMake Status Report End <-------------------") -message(STATUS "=======================================================================================") +printAregConfigStatus( + areg_FOUND + "Demo" + "------------------> AREG SDK Demo project CMake Status Report Begin <------------------" + "------------------> AREG SDK Demo project CMake Status Report End <-------------------" +) From c0be0f933db0457b6b5d58881a398310962b718f Mon Sep 17 00:00:00 2001 From: Aregtech Date: Mon, 14 Oct 2024 18:22:15 +0200 Subject: [PATCH 02/11] Fixed the integration of areg-sdk in the cmake build without submodule --- CMakeLists.txt | 140 ++++++++++++++++++++++++------------------------- 1 file changed, 69 insertions(+), 71 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 432cfba..694b50d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,127 +1,125 @@ # ################################################################## -# This file can be used as an example to integrate areg-sdk into -# the existing project. Use your paths of your project structure. +# Example CMake script to integrate AREG SDK into an existing project. # -# Description: In this example, AREG SDK is integrated as a package or -# as sources fetched from https://github.com/aregtech/areg-sdk.git. -# In addition, AREG SDK can be integrated as before -# declaring 'project()' or after. To see the difference, -# pass 'INTEGRATE_AREG_BEFORE_PROJECT' option when calling 'cmake'. -# If 'INTEGRATE_AREG_BEFORE_PROJECT' is 'TRUE' (or 'ON'), AREG SDK is integrated -# before the 'project()' is called and the develop may benefit -# all advantages of 'areg-sdk' project sources or binaries. -# If 'INTEGRATE_AREG_BEFORE_PROJECT' is 'FALSE' (or 'OFF'), the developer may -# manually set own options before integrating 'areg-sdk' in the project. +# This script demonstrates how to integrate AREG SDK as a package or +# fetch its sources from https://github.com/aregtech/areg-sdk.git. +# +# Integration can occur before or after the `project()` declaration: +# - Set `INTEGRATE_AREG_BEFORE_PROJECT` to TRUE (or ON) to integrate +# AREG SDK before calling `project()`, enabling immediate use of +# AREG SDK configurations. +# - Set `INTEGRATE_AREG_BEFORE_PROJECT` to FALSE (or OFF) to manually +# set project options before integrating AREG SDK. # ################################################################## cmake_minimum_required(VERSION 3.20.0) +# Macro to load and configure the AREG SDK package or source repository macro(macro_load_areg_sdk) find_package(areg CONFIG) + if (NOT areg_FOUND) # ################################################################## - # Prepare AREG SDK configuration before fetching from GitHub + # AREG SDK not found as a package, fetching from GitHub. # ################################################################## - # Specify where should AREG SDK output built binary directory - set(AREG_BUILD_ROOT "${AREG_SDK_DEMO_ROOT}/product") - - # Specify where should fetch the thirdparty source codes, including AREG SDK sources - set(AREG_PACKAGES "${AREG_BUILD_ROOT}/packages") + # Specify the root directory for AREG SDK build outputs. + set(AREG_BUILD_ROOT "${AREG_SDK_DEMO_ROOT}/product") - # Disable building AREG SDK Examples - option(AREG_BUILD_EXAMPLES "Disable areg-sdk examples for Demo" OFF) + # Specify where to fetch third-party sources (including AREG SDK). + set(AREG_PACKAGES "${AREG_BUILD_ROOT}/packages") - # Disable building AreG SDK unit tests. + # Disable building AREG SDK examples and unit tests for this demo. + option(AREG_BUILD_EXAMPLES "Disable areg-sdk examples for Demo" OFF) option(AREG_BUILD_TESTS "Disable areg-sdk unit tests for Demo" OFF) include(FetchContent) - set(FETCHCONTENT_BASE_DIR "${AREG_PACKAGES}") - message(STATUS "Demo: >>> Fetching areg-sdk from https://github.com/aregtech/areg-sdk.git repo to ${FETCHCONTENT_BASE_DIR} directory") - FetchContent_Declare(areg-sdk - GIT_REPOSITORY https://github.com/aregtech/areg-sdk.git - GIT_TAG "bugfix/396-demo-build-fails") - - message(STATUS "Demo: >>> Fetched 'areg-sdk', configuring to make it available...") + set(FETCHCONTENT_BASE_DIR "${AREG_PACKAGES}") + message(STATUS "Demo: >>> Fetching AREG SDK from GitHub to ${FETCHCONTENT_BASE_DIR}") + + FetchContent_Declare( + areg-sdk + GIT_REPOSITORY https://github.com/aregtech/areg-sdk.git + GIT_TAG "master" + ) FetchContent_MakeAvailable(areg-sdk) - # Specify the location of 'areg-sdk' root directory. - set(AREG_SDK_ROOT "${areg-sdk_SOURCE_DIR}") - # Optionally, specify the location of cmake configuration files. - set(AREG_CMAKE_CONFIG_DIR "${AREG_SDK_ROOT}/conf/cmake") - message(STATUS "Demo: >>> AREG_SDK_ROOT = \'${AREG_SDK_ROOT}\', going to configure...") + # Set the root directory of the fetched AREG SDK + set(AREG_SDK_ROOT "${areg-sdk_SOURCE_DIR}") + set(AREG_CMAKE_CONFIG_DIR "${AREG_SDK_ROOT}/conf/cmake") + message(STATUS "Demo: >>> AREG_SDK_ROOT set to '${AREG_SDK_ROOT}', configuring AREG SDK...") + else() - message(STATUS "Demo: >>> Found areg package in \'${areg_DIR}\',\ - configuration file \'${areg_CONFIG}\',\ - library \'${areg_LIBRARY}\',\ - package root is \'${areg_ROOT}\'.") - message(STATUS "Demo: >>> The SDK root \'${AREG_SDK_ROOT}\',\ - configuration files are \'${AREG_CMAKE_CONFIG_DIR}\' directory,\ - tools are in \'${AREG_SDK_TOOLS}\' directory.") + # AREG SDK package found + message(STATUS "Demo: >>> Found AREG package at '${areg_DIR}',") + message(STATUS " >>> Library: '${areg_LIBRARY}', Config: '${areg_CONFIG}', Package Root: '${areg_ROOT}'") + message(STATUS " >>> SDK Root: '${AREG_SDK_ROOT}', CMake Config: '${AREG_CMAKE_CONFIG_DIR}', Tools: '${AREG_SDK_TOOLS}'") endif() endmacro(macro_load_areg_sdk) -# Set Demo project root and sources -set(AREG_SDK_DEMO_ROOT "${CMAKE_SOURCE_DIR}") -set(AREG_DEMO_SOURCES "${AREG_SDK_DEMO_ROOT}/demo") -# By default, INTEGRATE_AREG_BEFORE_PROJECT is integrated in the project before 'project()' +# Set the root of the demo project and its sources +set(AREG_SDK_DEMO_ROOT "${CMAKE_SOURCE_DIR}") +set(AREG_DEMO_SOURCES "${AREG_SDK_DEMO_ROOT}/demo") + +# Control whether to integrate AREG SDK before or after the project declaration if (NOT DEFINED INTEGRATE_AREG_BEFORE_PROJECT) - set(INTEGRATE_AREG_BEFORE_PROJECT TRUE) + set(INTEGRATE_AREG_BEFORE_PROJECT TRUE) # Default is TRUE (integrate before `project()`) endif() - +# Integration logic based on INTEGRATE_AREG_BEFORE_PROJECT flag if (INTEGRATE_AREG_BEFORE_PROJECT) - # if 'INTEGRATE_AREG_BEFORE_PROJECT' is 'TRUE', integrate either 'areg' package or fetch the sources from official repository + # Integrate AREG SDK before calling project() macro_load_areg_sdk() - # Declare 'areg-sdk-demo' project after integrating 'areg-sdk' + + # Define the project after integrating AREG SDK set(PROJECT_NAME "areg-sdk-demo") set(PROJECT_VERSION "2.0.0") project(${PROJECT_NAME} VERSION ${PROJECT_VERSION} LANGUAGES C CXX) else() - # integrate 'areg-sdk' after 'project()' call + # Integrate AREG SDK after calling project() - # Reset compiler settings, because they are not use and they may cause warnings - set(AREG_COMPILER "") - set(AREG_COMPILER_FAMILY "") - # Declare AREG SDK Demo project + # Reset compiler settings to avoid potential warnings + set(AREG_COMPILER "") + set(AREG_COMPILER_FAMILY "") + + # Declare the project set(PROJECT_NAME "areg-sdk-demo") set(PROJECT_VERSION "1.0.0") project(${PROJECT_NAME} VERSION ${PROJECT_VERSION} LANGUAGES C CXX) - # integrate areg package or sources + + # Now integrate AREG SDK after project is defined macro_load_areg_sdk() endif() - # ################################################################## -# We are ready to develop AREG SDK base applications. -# We can as well use AREG SDK settings to create new projects -# In order to compile projects based on AREG SDK settings, -# we should perform these 5 steps, where steps 1-4 are preparations: -# 1. Set 'AREG_SDK_ROOT' variable --> see above. It is either '${areg-sdk_SOURCE_DIR}' or '${areg-sdk_DIR}' -# 2. Include '${AREG_SDK_ROOT}conf/cmake/setup.cmake' -# 3. Include '${AREG_SDK_ROOT}conf/cmake/common.cmake' -# 4. Set '${AREG_FRAMEWORK}' path in the includes -# 5. Include your projects to compile project +# Steps to prepare AREG SDK base applications: +# +# 1. Set the 'AREG_SDK_ROOT' variable (this is either '${areg-sdk_SOURCE_DIR}' +# when fetched, or '${areg-sdk_DIR}' when using the package). +# 2. Include '${AREG_SDK_ROOT}/conf/cmake/setup.cmake'. +# 3. Include '${AREG_SDK_ROOT}/conf/cmake/common.cmake'. +# 4. Set the '${AREG_FRAMEWORK}' path in the includes. +# 5. Include and build your projects (e.g., Demo). # ################################################################## -# Step 1: Set 'AREG_SDK_ROOT' variable --> see above. `AREG_SDK_ROOT` is either '${areg-sdk_SOURCE_DIR}' or '${areg-sdk_DIR}' +# Step 1: AREG_SDK_ROOT is already set in macro_load_areg_sdk() -# Step 2: include '${AREG_SDK_ROOT}/conf/cmake/setup.cmake' +# Step 2: Include setup.cmake from AREG SDK include(${AREG_CMAKE_CONFIG_DIR}/setup.cmake) -# Step 3: include '${AREG_SDK_ROOT}/conf/cmake/common.cmake' +# Step 3: Include common.cmake from AREG SDK include(${AREG_CMAKE_CONFIG_DIR}/common.cmake) -# Step 4: Set '${AREG_FRAMEWORK}' path in the includes +# Step 4: Set the framework include directory include_directories(${AREG_FRAMEWORK}) -# Step 5: Include your projects -# Start building Demo applications +# Step 5: Include the demo project and start building include("${AREG_DEMO_SOURCES}/CMakeLists.txt") +# Print the configuration status printAregConfigStatus( areg_FOUND "Demo" "------------------> AREG SDK Demo project CMake Status Report Begin <------------------" - "------------------> AREG SDK Demo project CMake Status Report End <-------------------" + "-------------------> AREG SDK Demo project CMake Status Report End <-------------------" ) From a35b0c6aec780c40a44d487975f83e9110f183e6 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Mon, 14 Oct 2024 18:23:30 +0200 Subject: [PATCH 03/11] Update areg-sdk submodule --- thirdparty/areg-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/areg-sdk b/thirdparty/areg-sdk index f4971f2..a94fc74 160000 --- a/thirdparty/areg-sdk +++ b/thirdparty/areg-sdk @@ -1 +1 @@ -Subproject commit f4971f2618c543a39c917324bcb0390baba28edf +Subproject commit a94fc7439c9c3ed88dee841d6c0d57864b040c1f From b7a0223413f8ff26c38fa05aa1f3a75955a657b2 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Mon, 14 Oct 2024 22:33:45 +0200 Subject: [PATCH 04/11] Update github actions --- .github/workflows/cmake.yml | 224 +++++++++++++++++++++++++--------- .github/workflows/msbuild.yml | 35 +++--- CMakeLists.txt | 1 + 3 files changed, 187 insertions(+), 73 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ffa2f2b..928ae77 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -20,57 +20,163 @@ jobs: runs-on: ${{matrix.config.os}} strategy: - fail-fast: false + fail-fast: FALSE matrix: config: # Create matrix with combinations # compile AREG engine as a shared library with GNU g++ / gcc on Ubuntu Linux, enable AREG extensions and logs - - { name: linux-gnu-shared-ext-log, os: ubuntu-latest, lib: shared, family: gnu, cxx: g++, cc: gcc, extend: ON, logs: ON} + - { name: linux-gnu-g++-shared, + os: ubuntu-latest, + lib: shared, + family: gnu, + cxx: g++, + comp: TRUE, + before: TRUE + } + # compile AREG engine as a shared library with GNU g++ / gcc on Ubuntu Linux, enable AREG extensions and no logs - - { name: linux-gnu-shared-ext-nolog, os: ubuntu-latest, lib: shared, family: gnu, cxx: g++, cc: gcc, extend: ON, logs: OFF} + - { name: linux-gnu-g++-static, + os: ubuntu-latest, + lib: static, + family: gnu, + cxx: g++, + comp: FALSE, + before: FALSE + } + # compile AREG engine as a static library with GNU g++ / gcc on Ubuntu Linux, enable AREG extensions and logs - - { name: linux-gnu-static-ext-log, os: ubuntu-latest, lib: static, family: gnu, cxx: g++, cc: gcc, extend: ON, logs: ON} + - { name: linux-gnu-gcc-shared, + os: ubuntu-latest, + lib: shared, + family: gnu, + cxx: gcc, + comp: FALSE, + before: TRUE + } + # compile AREG engine as a shared library with GNU g++ / gcc on Ubuntu Linux, disable AREG extensions and logs - - { name: linux-gnu-shared-noext-log, os: ubuntu-latest, lib: shared, family: gnu, cxx: g++, cc: gcc, extend: OFF, logs: ON} - # compile AREG engine as a shared library with GNU g++ / gcc on Ubuntu Linux, disable AREG extensions and no logs - - { name: linux-gnu-shared-noext-nolog, os: ubuntu-latest, lib: shared, family: gnu, cxx: g++, cc: gcc, extend: OFF, logs: OFF} + - { name: linux-gnu-gcc-static, + os: ubuntu-latest, + lib: shared, + family: gnu, + cxx: gcc, + comp: TRUE, + before: FALSE + } + + # compile AREG engine as a shared library with clang on Ubuntu Linux, enable AREG extensions and logs + - { name: linux-llvm-clang++-shared, + os: ubuntu-latest, + lib: shared, + family: llvm, + cxx: clang++, + comp: TRUE, + before: TRUE + } + + # compile AREG engine as a shared library with clang on Ubuntu Linux, enable AREG extensions and no logs + - { name: linux-llvm-clang++-static, + os: ubuntu-latest, + lib: static, + family: llvm, + cxx: clang++, + comp: FALSE, + before: FALSE + } + # compile AREG engine as a shared library with clang on Ubuntu Linux, enable AREG extensions and logs - - { name: linux-clang-shared-ext-log, os: ubuntu-latest, lib: shared, family: llvm, cxx: clang++, cc: clang, extend: ON, logs: ON} + - { name: linux-llvm-clang-shared, + os: ubuntu-latest, + lib: shared, + family: llvm, + cxx: clang, + comp: FALSE, + before: TRUE + } + # compile AREG engine as a shared library with clang on Ubuntu Linux, enable AREG extensions and no logs - - { name: linux-clang-shared-ext-nolog, os: ubuntu-latest, lib: shared, family: llvm, cxx: clang++, cc: clang, extend: ON, logs: OFF} - # compile AREG engine as a static library with clang on Ubuntu Linux, enable AREG extensions and logs - - { name: linux-clang-static-ext-log, os: ubuntu-latest, lib: static, family: llvm, cxx: clang++, cc: clang, extend: ON, logs: ON} - # compile AREG engine as a shared library with clang on Ubuntu Linux, disable AREG extensions and logs - - { name: linux-clang-shared-noext-log, os: ubuntu-latest, lib: shared, family: llvm, cxx: clang++, cc: clang, extend: OFF, logs: ON} - # compile AREG engine as a shared library with clang on Ubuntu Linux, disable AREG extensions and no logs - - { name: linux-clang-shared-noext-nolog,os: ubuntu-latest, lib: shared, family: llvm, cxx: clang++, cc: clang, extend: OFF, logs: OFF} + - { name: linux-llvm-clang-static, + os: ubuntu-latest, + lib: static, + family: llvm, + cxx: clang, + comp: TRUE, + before: FALSE + } + + # compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs + - { name: win-cygwin-g++-shared, + os: windows-latest, + lib: shared, + family: cygwin, + cxx: g++, + comp: TRUE, + before: TRUE + } + + # compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs + - { name: win-cygwin-g++-static, + os: windows-latest, + lib: static, + family: cygwin, + cxx: g++, + comp: FALSE, + before: FALSE + } + + # compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs + - { name: win-cygwin-gcc-shared, + os: windows-latest, + lib: shared, + family: cygwin, + cxx: gcc, + comp: FALSE, + before: TRUE + } + # compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs - - { name: win-cygwin-shared-ext-log, os: windows-latest, lib: shared, family: cygwin, cxx: g++, cc: gcc, extend: ON, logs: ON} - # compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and no logs - - { name: win-cygwin-shared-ext-nolog, os: windows-latest, lib: shared, family: cygwin, cxx: g++, cc: gcc, extend: ON, logs: OFF} - # compile AREG engine as a static with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs - - { name: win-cygwin-static-ext-log, os: windows-latest, lib: static, family: cygwin, cxx: g++, cc: gcc, extend: ON, logs: ON} - # compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, disable AREG extensions and logs - - { name: win-cygwin-shared-noext-log, os: windows-latest, lib: shared, family: cygwin, cxx: g++, cc: gcc, extend: OFF, logs: ON} - # compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, disable AREG extensions and no logs - - { name: win-cygwin-shared-noext-nolog,os: windows-latest, lib: shared, family: cygwin, cxx: g++, cc: gcc, extend: OFF, logs: OFF} + - { name: win-cygwin-gcc-static, + os: windows-latest, + lib: static, + family: cygwin, + cxx: gcc, + comp: TRUE, + before: FALSE + } + # compile AREG engine as a shared with MSVC on Windows, enable AREG extensions and logs - - { name: win-msvc-shared-ext-log, os: windows-latest, lib: shared, family: msvc, cxx: cl, cc: cl, extend: ON, logs: ON} - # compile AREG engine as a shared with MSVC on Windows, enable AREG extensions and no logs - - { name: win-msvc-shared-ext-nolog, os: windows-latest, lib: shared, family: msvc, cxx: cl, cc: cl, extend: ON, logs: OFF} - # compile AREG engine as a static with MSVC on Windows, enable AREG extensions and logs - - { name: win-msvc-static-ext-log, os: windows-latest, lib: static, family: msvc, cxx: cl, cc: cl, extend: ON, logs: ON} + - { name: win-msvc-cl-shared, + os: windows-latest, + lib: shared, + family: msvc, + cxx: cl, + comp: TRUE, + before: TRUE + } + # compile AREG engine as a shared with MSVC on Windows, enable AREG extensions and logs - - { name: win-msvc-shared-noext-log, os: windows-latest, lib: shared, family: msvc, cxx: cl, cc: cl, extend: OFF, logs: ON} - # compile AREG engine as a shared with MSVC on Windows, enable AREG extensions and no logs - - { name: win-msvc-shared-noext-nolog, os: windows-latest, lib: shared, family: msvc, cxx: cl, cc: cl, extend: OFF, logs: OFF} + - { name: win-msvc-cl-static, + os: windows-latest, + lib: static, + family: msvc, + cxx: cl, + comp: FALSE, + before: FALSE + } steps: - - name: Checkout AREG engine (AREG SDK) source codes and dependencies - uses: actions/checkout@v3 + - name: Checkout AREG SDK Demo project sources and dependencies + uses: actions/checkout@v4 with: submodules: recursive + - name: Setup Java JDK to run code generator + uses: actions/setup-java@v4.4.0 + with: + java-version: 17 + java-package: jre + distribution: temurin + - name: Update compilers on Linux if: matrix.config.os == 'ubuntu-latest' # Update compilers, set C/C++ compilers @@ -83,42 +189,42 @@ jobs: shell: powershell run: Invoke-WebRequest https://cygwin.com/setup-x86_64.exe -OutFile C:\setup.exe + - name: Set Windows PATH environment variable + if: matrix.config.os == 'windows-latest' && matrix.config.family == 'cygwin' + run: echo "PATH=C:\cygwin;C:\cygwin\bin;C:\cygwin\lib;%SYSTEMROOT%\system32;%PATH%" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - name: Install cygwin on Windows if: matrix.config.os == 'windows-latest' && matrix.config.family == 'cygwin' - shell: cmd - run: | - c:\setup.exe -qgnO -s http://mirrors.kernel.org/sourceware/cygwin/ -l C:\cygwin-packages\ -P ^ - cmake,^ - dos2unix,^ - extra-cmake-modules,^ - flexdll,^ - gcc-g++,^ - make,^ - ncurses,^ - libncurses-devel - - - name: set Windows PATH environment variable + uses: cygwin/cygwin-install-action@v4 + with: + packages: cmake, dos2unix, flexdll, gcc-g++, git, ncurses, libncurses-devel, make + + - name: Set cmake cache destination for Linux + if: matrix.config.os == 'ubuntu-latest' + run: echo "CACHE_DEST=./product/cache/${{matrix.config.family}}-${{matrix.config.cxx}}" >> "$GITHUB_ENV" + + - name: Set cmake cache destination for Linux if: matrix.config.os == 'windows-latest' && matrix.config.family == 'cygwin' - run: echo "PATH=C:\cygwin64;C:\cygwin64\bin;C:\cygwin64\lib;%SYSTEMROOT%\system32;%PATH%" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - + shell: C:\tools\cygwin\bin\bash.exe --login -o igncr '{0}' + run: cd %GITHUB_WORKSPACE% && echo "CACHE_DEST=./product/cache/${{matrix.config.family}}-${{matrix.config.cxx}}" >> "$GITHUB_ENV" + + - name: Set cmake cache destination for Windows + if: matrix.config.os == 'windows-latest' && matrix.config.family != 'cygwin' + run: echo "CACHE_DEST=./product/cache/${{matrix.config.family}}-${{matrix.config.cxx}}" >> $env:GITHUB_ENV + - name: Configure CMake with enabled extended feature and selected compiler family - if: matrix.config.extend == 'ON' + if: matrix.config.comp == 'TRUE' working-directory: ${{github.workspace}} run: | - cmake -B ./build -DAREG_COMPILER_FAMILY=${{matrix.config.family}} -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}} -DAREG_BINARY=${{matrix.config.lib}} -DAREG_EXTENDED:BOOL=${{matrix.config.extend}} -DAREG_LOGS:BOOL=${{matrix.config.logs}} + cmake -B ${{env.CACHE_DEST}} -DAREG_COMPILER=${{matrix.config.cxx}} -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}} -DAREG_BINARY=${{matrix.config.lib}} -DINTEGRATE_AREG_BEFORE_PROJECT:BOOL=${{matrix.config.before}} - name: Configure CMake for disabled extended feature and selected compiler - if: matrix.config.extend == 'OFF' + if: matrix.config.comp == 'FALSE' working-directory: ${{github.workspace}} run: | - cmake -B ./build -DAREG_COMPILER=${{matrix.config.cc}} -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}} -DAREG_BINARY=${{matrix.config.lib}} -DAREG_EXTENDED:BOOL=${{matrix.config.extend}} -DAREG_LOGS:BOOL=${{matrix.config.logs}} + cmake -B ${{env.CACHE_DEST}} -DAREG_COMPILER_FAMILY=${{matrix.config.family}} -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}} -DAREG_BINARY=${{matrix.config.lib}} -DINTEGRATE_AREG_BEFORE_PROJECT:BOOL=${{matrix.config.before}} - name: Build with CMake working-directory: ${{github.workspace}} # Build your program with the given configuration - run: cmake --build ./build -j10 - - - name: Run Unit Tests - working-directory: ${{github.workspace}} - run: ctest --test-dir ./build --output-on-failure --output-junit test_results.xml - + run: cmake --build ${{env.CACHE_DEST}} -j 20 diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index c9592db..9eef942 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -50,20 +50,27 @@ jobs: - {name: MSBuild-x64-noext-nolog, platform: x64, extend: 0, logs: 0} steps: - - name: Checkout AREG engine (AREG SDK) source codes and submodules - uses: actions/checkout@v3 - with: - submodules: recursive + - name: Checkout AREG SDK Demo project sources and dependencies + uses: actions/checkout@v4 + with: + submodules: recursive - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v1.0.2 + - name: Setup Java JDK to run code generator + uses: actions/setup-java@v4.4.0 + with: + java-version: 17 + java-package: jre + distribution: temurin - - name: Restore NuGet packages - working-directory: ${{env.GITHUB_WORKSPACE}} - run: nuget restore ${{env.SOLUTION_FILE_PATH}} + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@v2 - - name: Build areg-sdk solution. - working-directory: ${{env.GITHUB_WORKSPACE}} - # Add additional options to the MSBuild command line here (like platform or verbosity level). - # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference - run: msbuild /m /property:Configuration=${{env.BUILD_CONFIGURATION}} /property:Platform=${{matrix.config.platform}} /property:AregExtended=${{matrix.config.extend}} /property:AregLogs=${{matrix.config.logs}} ${{env.SOLUTION_FILE_PATH}} + - name: Restore NuGet packages + working-directory: ${{env.GITHUB_WORKSPACE}} + run: nuget restore ${{env.SOLUTION_FILE_PATH}} + + - name: Build areg-sdk solution. + working-directory: ${{env.GITHUB_WORKSPACE}} + # Add additional options to the MSBuild command line here (like platform or verbosity level). + # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference + run: msbuild /m /property:Configuration=${{env.BUILD_CONFIGURATION}} /property:Platform=${{matrix.config.platform}} /property:AregExtended=${{matrix.config.extend}} /property:AregLogs=${{matrix.config.logs}} ${{env.SOLUTION_FILE_PATH}} diff --git a/CMakeLists.txt b/CMakeLists.txt index 694b50d..45c55db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,7 @@ macro(macro_load_areg_sdk) GIT_REPOSITORY https://github.com/aregtech/areg-sdk.git GIT_TAG "master" ) + message(STATUS "Demo: >>> AREG SDK sources are fetched, setting up areg-sdk ...") FetchContent_MakeAvailable(areg-sdk) # Set the root directory of the fetched AREG SDK From b5072cd7e0c731a4929f69ef3bb017cf90e1fe5e Mon Sep 17 00:00:00 2001 From: Aregtech Date: Mon, 14 Oct 2024 23:04:01 +0200 Subject: [PATCH 05/11] Fixing workflow actions --- .github/workflows/cmake.yml | 87 +++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 46 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 928ae77..9b1317c 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -20,7 +20,7 @@ jobs: runs-on: ${{matrix.config.os}} strategy: - fail-fast: FALSE + fail-fast: false matrix: config: # Create matrix with combinations # compile AREG engine as a shared library with GNU g++ / gcc on Ubuntu Linux, enable AREG extensions and logs @@ -29,8 +29,8 @@ jobs: lib: shared, family: gnu, cxx: g++, - comp: TRUE, - before: TRUE + comp: ON, + before: ON } # compile AREG engine as a shared library with GNU g++ / gcc on Ubuntu Linux, enable AREG extensions and no logs @@ -39,8 +39,8 @@ jobs: lib: static, family: gnu, cxx: g++, - comp: FALSE, - before: FALSE + comp: OFF, + before: OFF } # compile AREG engine as a static library with GNU g++ / gcc on Ubuntu Linux, enable AREG extensions and logs @@ -49,8 +49,8 @@ jobs: lib: shared, family: gnu, cxx: gcc, - comp: FALSE, - before: TRUE + comp: OFF, + before: ON } # compile AREG engine as a shared library with GNU g++ / gcc on Ubuntu Linux, disable AREG extensions and logs @@ -59,8 +59,8 @@ jobs: lib: shared, family: gnu, cxx: gcc, - comp: TRUE, - before: FALSE + comp: ON, + before: OFF } # compile AREG engine as a shared library with clang on Ubuntu Linux, enable AREG extensions and logs @@ -69,8 +69,8 @@ jobs: lib: shared, family: llvm, cxx: clang++, - comp: TRUE, - before: TRUE + comp: ON, + before: ON } # compile AREG engine as a shared library with clang on Ubuntu Linux, enable AREG extensions and no logs @@ -79,8 +79,8 @@ jobs: lib: static, family: llvm, cxx: clang++, - comp: FALSE, - before: FALSE + comp: OFF, + before: OFF } # compile AREG engine as a shared library with clang on Ubuntu Linux, enable AREG extensions and logs @@ -89,8 +89,8 @@ jobs: lib: shared, family: llvm, cxx: clang, - comp: FALSE, - before: TRUE + comp: OFF, + before: ON } # compile AREG engine as a shared library with clang on Ubuntu Linux, enable AREG extensions and no logs @@ -99,8 +99,8 @@ jobs: lib: static, family: llvm, cxx: clang, - comp: TRUE, - before: FALSE + comp: ON, + before: OFF } # compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs @@ -109,8 +109,8 @@ jobs: lib: shared, family: cygwin, cxx: g++, - comp: TRUE, - before: TRUE + comp: ON, + before: ON } # compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs @@ -119,8 +119,8 @@ jobs: lib: static, family: cygwin, cxx: g++, - comp: FALSE, - before: FALSE + comp: OFF, + before: OFF } # compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs @@ -129,8 +129,8 @@ jobs: lib: shared, family: cygwin, cxx: gcc, - comp: FALSE, - before: TRUE + comp: OFF, + before: ON } # compile AREG engine as a shared with CYGWIN g++ / gcc on Windows, enable AREG extensions and logs @@ -139,8 +139,8 @@ jobs: lib: static, family: cygwin, cxx: gcc, - comp: TRUE, - before: FALSE + comp: ON, + before: OFF } # compile AREG engine as a shared with MSVC on Windows, enable AREG extensions and logs @@ -149,8 +149,8 @@ jobs: lib: shared, family: msvc, cxx: cl, - comp: TRUE, - before: TRUE + comp: ON, + before: ON } # compile AREG engine as a shared with MSVC on Windows, enable AREG extensions and logs @@ -159,8 +159,8 @@ jobs: lib: static, family: msvc, cxx: cl, - comp: FALSE, - before: FALSE + comp: OFF, + before: OFF } steps: @@ -184,12 +184,7 @@ jobs: sudo apt-get update export CC=/usr/bin/${{matrix.config.cc}} CXX=/usr/bin/${{matrix.config.cxx}} - - name: Fetch cygwin installer on Windows - if: matrix.config.os == 'windows-latest' && matrix.config.family == 'cygwin' - shell: powershell - run: Invoke-WebRequest https://cygwin.com/setup-x86_64.exe -OutFile C:\setup.exe - - - name: Set Windows PATH environment variable + - name: Set Windows PATH environment variable for cygwin if: matrix.config.os == 'windows-latest' && matrix.config.family == 'cygwin' run: echo "PATH=C:\cygwin;C:\cygwin\bin;C:\cygwin\lib;%SYSTEMROOT%\system32;%PATH%" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append @@ -199,27 +194,27 @@ jobs: with: packages: cmake, dos2unix, flexdll, gcc-g++, git, ncurses, libncurses-devel, make - - name: Set cmake cache destination for Linux - if: matrix.config.os == 'ubuntu-latest' - run: echo "CACHE_DEST=./product/cache/${{matrix.config.family}}-${{matrix.config.cxx}}" >> "$GITHUB_ENV" - - - name: Set cmake cache destination for Linux + - name: Set cmake cache destination for Cygwin if: matrix.config.os == 'windows-latest' && matrix.config.family == 'cygwin' shell: C:\tools\cygwin\bin\bash.exe --login -o igncr '{0}' - run: cd %GITHUB_WORKSPACE% && echo "CACHE_DEST=./product/cache/${{matrix.config.family}}-${{matrix.config.cxx}}" >> "$GITHUB_ENV" + run: echo "CACHE_DEST=./product/cache/${{matrix.config.name}}" >> "$GITHUB_ENV" + + - name: Set cmake cache destination for Linux + if: matrix.config.os == 'ubuntu-latest' + run: echo "CACHE_DEST=./product/cache/${{matrix.config.name}}" >> "$GITHUB_ENV" - name: Set cmake cache destination for Windows if: matrix.config.os == 'windows-latest' && matrix.config.family != 'cygwin' - run: echo "CACHE_DEST=./product/cache/${{matrix.config.family}}-${{matrix.config.cxx}}" >> $env:GITHUB_ENV + run: echo "CACHE_DEST=./product/cache/${{matrix.config.name}}" >> $env:GITHUB_ENV - - name: Configure CMake with enabled extended feature and selected compiler family - if: matrix.config.comp == 'TRUE' + - name: Configure CMake and pass compiler option + if: matrix.config.comp == 'ON' working-directory: ${{github.workspace}} run: | cmake -B ${{env.CACHE_DEST}} -DAREG_COMPILER=${{matrix.config.cxx}} -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}} -DAREG_BINARY=${{matrix.config.lib}} -DINTEGRATE_AREG_BEFORE_PROJECT:BOOL=${{matrix.config.before}} - - name: Configure CMake for disabled extended feature and selected compiler - if: matrix.config.comp == 'FALSE' + - name: Configure CMake and pass compiler family option + if: matrix.config.comp == 'OFF' working-directory: ${{github.workspace}} run: | cmake -B ${{env.CACHE_DEST}} -DAREG_COMPILER_FAMILY=${{matrix.config.family}} -DAREG_BUILD_TYPE=${{env.BUILD_TYPE}} -DAREG_BINARY=${{matrix.config.lib}} -DINTEGRATE_AREG_BEFORE_PROJECT:BOOL=${{matrix.config.before}} From 3fbf1e87dae463ea9dbc8d959816d0bd192fe76e Mon Sep 17 00:00:00 2001 From: Aregtech Date: Mon, 14 Oct 2024 23:14:21 +0200 Subject: [PATCH 06/11] Fixing cygwin build in cmake --- .github/workflows/cmake.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 9b1317c..aeaf18f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -194,17 +194,12 @@ jobs: with: packages: cmake, dos2unix, flexdll, gcc-g++, git, ncurses, libncurses-devel, make - - name: Set cmake cache destination for Cygwin - if: matrix.config.os == 'windows-latest' && matrix.config.family == 'cygwin' - shell: C:\tools\cygwin\bin\bash.exe --login -o igncr '{0}' - run: echo "CACHE_DEST=./product/cache/${{matrix.config.name}}" >> "$GITHUB_ENV" - - name: Set cmake cache destination for Linux if: matrix.config.os == 'ubuntu-latest' run: echo "CACHE_DEST=./product/cache/${{matrix.config.name}}" >> "$GITHUB_ENV" - name: Set cmake cache destination for Windows - if: matrix.config.os == 'windows-latest' && matrix.config.family != 'cygwin' + if: matrix.config.os == 'windows-latest' run: echo "CACHE_DEST=./product/cache/${{matrix.config.name}}" >> $env:GITHUB_ENV - name: Configure CMake and pass compiler option From 6abd2e8cd154bc759e8da8b47758a895e56a80d1 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Tue, 15 Oct 2024 00:19:01 +0200 Subject: [PATCH 07/11] Fixed th MSVC build. Updated dummy project. --- demo/dummy/ReadMe.md | 8 ++++++++ demo/dummy/dummy.vcxproj | 19 +++++++++++-------- demo/dummy/dummy.vcxproj.filters | 3 +++ 3 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 demo/dummy/ReadMe.md diff --git a/demo/dummy/ReadMe.md b/demo/dummy/ReadMe.md new file mode 100644 index 0000000..c6bfed9 --- /dev/null +++ b/demo/dummy/ReadMe.md @@ -0,0 +1,8 @@ +# dummy Overview + +This project is required only to call the `demo_generate.bat` script located in the `/demo` directory. The script should run as a pre-build action to generate files from `.siml` Service Interface files. The scrip receive 2 parameters: +- The root directory of `` (parameter `$(AregSdkRoot)`), required to access the `codegen.jar`; +- The output directory to write generated files. + +The generated files are included in each `xx_generate` project of Demo. +Right now, there is no automated way to create `*.vcxproj` MSVC project files and update the `*.sln` MSVC solution file. The `xx_generate` projects should be manually created and the generated files should be manually included in the `xx_generate.vcxproj` files. Unlike build with Microsoft Visual Studio and MSBuild, the build with CMake automated this process. diff --git a/demo/dummy/dummy.vcxproj b/demo/dummy/dummy.vcxproj index 93f0096..dba0084 100644 --- a/demo/dummy/dummy.vcxproj +++ b/demo/dummy/dummy.vcxproj @@ -1,10 +1,10 @@  - + - + {98743716-82FC-4B02-96AF-E6F649403A0A} @@ -17,23 +17,26 @@ StaticLibrary - + - $(OutLibDir)\ + $(OutLibDir) + + + + + + IMPORT_SHARED_SYMBOLS;%(PreprocessorDefinitions) - $(SolutionDir)\demo\demo_generate.bat $(AregSdkRoot) $(AregBuildRoot) + $(SolutionDir)demo\demo_generate.bat $(AregSdkRoot) $(AregBuildRoot) Call to generate service interface source files for all example projects. - - - diff --git a/demo/dummy/dummy.vcxproj.filters b/demo/dummy/dummy.vcxproj.filters index 446a812..4912546 100644 --- a/demo/dummy/dummy.vcxproj.filters +++ b/demo/dummy/dummy.vcxproj.filters @@ -19,4 +19,7 @@ Source Files + + + \ No newline at end of file From 998eeef35a22bfa203eadc76f5a7a519a745c443 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Tue, 15 Oct 2024 00:27:00 +0200 Subject: [PATCH 08/11] trying to fix the cygwin warning. --- .github/workflows/cmake.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index aeaf18f..fcf5651 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -165,11 +165,6 @@ jobs: steps: - - name: Checkout AREG SDK Demo project sources and dependencies - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Setup Java JDK to run code generator uses: actions/setup-java@v4.4.0 with: @@ -180,9 +175,7 @@ jobs: - name: Update compilers on Linux if: matrix.config.os == 'ubuntu-latest' # Update compilers, set C/C++ compilers - run: | - sudo apt-get update - export CC=/usr/bin/${{matrix.config.cc}} CXX=/usr/bin/${{matrix.config.cxx}} + run: sudo apt-get update - name: Set Windows PATH environment variable for cygwin if: matrix.config.os == 'windows-latest' && matrix.config.family == 'cygwin' @@ -194,6 +187,11 @@ jobs: with: packages: cmake, dos2unix, flexdll, gcc-g++, git, ncurses, libncurses-devel, make + - name: Checkout AREG SDK Demo project sources and dependencies + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Set cmake cache destination for Linux if: matrix.config.os == 'ubuntu-latest' run: echo "CACHE_DEST=./product/cache/${{matrix.config.name}}" >> "$GITHUB_ENV" From 443cc1510d0f063efd168b691ec7b065d0724213 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Tue, 15 Oct 2024 00:35:58 +0200 Subject: [PATCH 09/11] fixing msvc build --- areg-sdk-demo.sln | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/areg-sdk-demo.sln b/areg-sdk-demo.sln index a0efc56..ead94e7 100644 --- a/areg-sdk-demo.sln +++ b/areg-sdk-demo.sln @@ -12,9 +12,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "areg", "thirdparty\areg-sdk\framework\areg.vcxproj", "{2DF8165C-EDE2-4F76-8D2C-2FFE82CB6CE5}" - ProjectSection(ProjectDependencies) = postProject - {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} = {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aregextend", "thirdparty\areg-sdk\framework\aregextend.vcxproj", "{FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3}" EndProject @@ -237,12 +234,15 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "areglogger", "thirdparty\areg-sdk\framework\areglogger.vcxproj", "{B29F438E-904C-4929-903C-F4673182A417}" ProjectSection(ProjectDependencies) = postProject {2DF8165C-EDE2-4F76-8D2C-2FFE82CB6CE5} = {2DF8165C-EDE2-4F76-8D2C-2FFE82CB6CE5} - {6941F2A7-F0C7-4293-8646-AF68A7E35183} = {6941F2A7-F0C7-4293-8646-AF68A7E35183} + {A19D14E3-19FE-46FE-91CA-0BAD1CDB91C5} = {A19D14E3-19FE-46FE-91CA-0BAD1CDB91C5} + {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} = {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "logger", "thirdparty\areg-sdk\framework\logger.vcxproj", "{0A2D4D13-6AC2-4602-BF8F-DA73133C1974}" ProjectSection(ProjectDependencies) = postProject {2DF8165C-EDE2-4F76-8D2C-2FFE82CB6CE5} = {2DF8165C-EDE2-4F76-8D2C-2FFE82CB6CE5} + {A19D14E3-19FE-46FE-91CA-0BAD1CDB91C5} = {A19D14E3-19FE-46FE-91CA-0BAD1CDB91C5} + {B29F438E-904C-4929-903C-F4673182A417} = {B29F438E-904C-4929-903C-F4673182A417} {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} = {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} EndProjectSection EndProject @@ -250,6 +250,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "logobserver", "thirdparty\a ProjectSection(ProjectDependencies) = postProject {2DF8165C-EDE2-4F76-8D2C-2FFE82CB6CE5} = {2DF8165C-EDE2-4F76-8D2C-2FFE82CB6CE5} {A19D14E3-19FE-46FE-91CA-0BAD1CDB91C5} = {A19D14E3-19FE-46FE-91CA-0BAD1CDB91C5} + {B29F438E-904C-4929-903C-F4673182A417} = {B29F438E-904C-4929-903C-F4673182A417} {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} = {FBC5BEAE-01B9-4943-A5CB-0D3DE2067EB3} EndProjectSection EndProject From 553156129b4e4c9c747b797012e3adc6616b7892 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Tue, 15 Oct 2024 01:42:23 +0200 Subject: [PATCH 10/11] fixing cygwin --- .github/workflows/cmake.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index fcf5651..6215b66 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -165,6 +165,11 @@ jobs: steps: + - name: Checkout AREG SDK Demo project sources and dependencies + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Setup Java JDK to run code generator uses: actions/setup-java@v4.4.0 with: @@ -185,12 +190,7 @@ jobs: if: matrix.config.os == 'windows-latest' && matrix.config.family == 'cygwin' uses: cygwin/cygwin-install-action@v4 with: - packages: cmake, dos2unix, flexdll, gcc-g++, git, ncurses, libncurses-devel, make - - - name: Checkout AREG SDK Demo project sources and dependencies - uses: actions/checkout@v4 - with: - submodules: recursive + packages: cmake, dos2unix, flexdll, gcc-g++, ncurses, libncurses-devel, make - name: Set cmake cache destination for Linux if: matrix.config.os == 'ubuntu-latest' From 71966ba153b3ea59fd441da08c2df5bbfcc29687 Mon Sep 17 00:00:00 2001 From: Aregtech Date: Tue, 15 Oct 2024 02:02:23 +0200 Subject: [PATCH 11/11] returned git package of cygwin --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 6215b66..a7f6d9d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -190,7 +190,7 @@ jobs: if: matrix.config.os == 'windows-latest' && matrix.config.family == 'cygwin' uses: cygwin/cygwin-install-action@v4 with: - packages: cmake, dos2unix, flexdll, gcc-g++, ncurses, libncurses-devel, make + packages: cmake, dos2unix, flexdll, gcc-g++, git, ncurses, libncurses-devel, make - name: Set cmake cache destination for Linux if: matrix.config.os == 'ubuntu-latest'