From 47866078a01aca5e5859d174e0f3cec219c10ccf Mon Sep 17 00:00:00 2001 From: Dorin Date: Thu, 27 Feb 2025 11:24:57 +0200 Subject: [PATCH 01/36] using default argument instead of duplicated function --- include/GameAnalytics/GameAnalytics.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/GameAnalytics/GameAnalytics.h b/include/GameAnalytics/GameAnalytics.h index 87845d61..a5b135c7 100644 --- a/include/GameAnalytics/GameAnalytics.h +++ b/include/GameAnalytics/GameAnalytics.h @@ -102,15 +102,13 @@ namespace gameanalytics static void startSession(); static void endSession(); - static std::string getRemoteConfigsValueAsString(std::string const& key); - static std::string getRemoteConfigsValueAsString(std::string const& key, std::string const& defaultValue); + static std::string getRemoteConfigsValueAsString(std::string const& key, std::string const& defaultValue = ""); static bool isRemoteConfigsReady(); static void addRemoteConfigsListener(const std::shared_ptr &listener); static void removeRemoteConfigsListener(const std::shared_ptr &listener); static std::string getRemoteConfigsContentAsString(); - static std::string getRemoteConfigsContentAsJson(); static std::string getABTestingId(); static std::string getABTestingVariantId(); From cec686ec6765f60f877b2344df8586cd154c5bc1 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Thu, 13 Mar 2025 13:20:19 +0200 Subject: [PATCH 02/36] Update Main.cpp --- sample/Main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/sample/Main.cpp b/sample/Main.cpp index 212589c1..3ed96837 100644 --- a/sample/Main.cpp +++ b/sample/Main.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include "GameAnalytics/GameAnalytics.h" From bcde102271de332029541c66a0791d23c8531b02 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Thu, 13 Mar 2025 15:57:02 +0200 Subject: [PATCH 03/36] set ubuntu-24.04 and clang version to 16 --- .github/workflows/cmake.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 28938db9..21ddadb9 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -31,17 +31,17 @@ jobs: # # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. matrix: - os: [ubuntu-latest, windows-latest, macOS-latest] + os: [ubuntu-24.04, windows-latest, macOS-latest] build_type: ${{ fromJSON(format('[{0}]', inputs.build_type || '"Debug","Release"')) }} c_compiler: [gcc, clang, cl] include: - os: windows-latest c_compiler: cl cpp_compiler: cl - - os: ubuntu-latest + - os: ubuntu-24.04 c_compiler: gcc cpp_compiler: g++ - - os: ubuntu-latest + - os: ubuntu-24.04 c_compiler: clang cpp_compiler: clang++ - os: macOS-latest @@ -52,7 +52,7 @@ jobs: c_compiler: gcc - os: windows-latest c_compiler: clang - - os: ubuntu-latest + - os: ubuntu-24.04 c_compiler: cl - os: macOS-latest c_compiler: cl @@ -71,6 +71,12 @@ jobs: run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + - name: Set Clang 16 as default + if: matrix.os == 'ubuntu-24.04' && matrix.c_compiler == 'clang' + run: | + sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-16 100 + sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-16 100 + - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type From 5c6d7e7f72d83a7f14f1cf25f38a44b1a7914bc2 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Thu, 13 Mar 2025 15:59:41 +0200 Subject: [PATCH 04/36] Update cmake.yml --- .github/workflows/cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 21ddadb9..ee3bd697 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -74,8 +74,8 @@ jobs: - name: Set Clang 16 as default if: matrix.os == 'ubuntu-24.04' && matrix.c_compiler == 'clang' run: | - sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-16 100 - sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-16 100 + sudo update-alternatives --set clang /usr/bin/clang-16 + sudo update-alternatives --set clang++ /usr/bin/clang++-16 - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. From 5586240ce7b3e2fd406861122b74e0dbdbacfe5e Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Thu, 13 Mar 2025 16:12:13 +0200 Subject: [PATCH 05/36] Update cmake.yml --- .github/workflows/cmake.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ee3bd697..9119f059 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -71,11 +71,16 @@ jobs: run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - - name: Set Clang 16 as default - if: matrix.os == 'ubuntu-24.04' && matrix.c_compiler == 'clang' + - name: Set Clang 16 as Default run: | + sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-16 100 + sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-16 100 sudo update-alternatives --set clang /usr/bin/clang-16 sudo update-alternatives --set clang++ /usr/bin/clang++-16 + + # Verify the change + clang --version + clang++ --version - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. From 2f751e4dc3a40cc94b6afcf861cca9cc8f9b402a Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Thu, 13 Mar 2025 16:14:47 +0200 Subject: [PATCH 06/36] Update cmake.yml --- .github/workflows/cmake.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 9119f059..327ba432 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -72,6 +72,7 @@ jobs: echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - name: Set Clang 16 as Default + if: matrix.os == 'ubuntu-24.04' && matrix.c_compiler == 'clang' run: | sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-16 100 sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-16 100 From b79e828f26883096cbf425924b1b43da32717536 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Thu, 13 Mar 2025 19:00:38 +0200 Subject: [PATCH 07/36] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3627bdd8..b698d227 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -198,7 +198,7 @@ elseif(LINUX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGUID_STDLIB -std=c++17") if(CLANG) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++") endif() endif() From 2f2c2ebf2d769032a4d361c93030a714d154db4a Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Thu, 13 Mar 2025 19:07:54 +0200 Subject: [PATCH 08/36] Update cmake.yml --- .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 327ba432..25eed345 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -95,7 +95,7 @@ jobs: - name: Build # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). - run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} VERBOSE=1 - name: Test working-directory: ${{ steps.strings.outputs.build-output-dir }} From ebbf72f3546ebdac0166c1daba1a0b42f79422a7 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Thu, 13 Mar 2025 19:08:32 +0200 Subject: [PATCH 09/36] Update cmake.yml --- .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 25eed345..8190e0e5 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -95,7 +95,7 @@ jobs: - name: Build # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). - run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} VERBOSE=1 + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --verbose - name: Test working-directory: ${{ steps.strings.outputs.build-output-dir }} From 9a6867a32767f04da439f4b92e85e3d6a4df36f3 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Thu, 13 Mar 2025 19:12:06 +0200 Subject: [PATCH 10/36] Update CMakeLists.txt --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b698d227..70053a90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -209,7 +209,9 @@ endif() add_library(GameAnalytics ${LIB_TYPE} ${CPP_SOURCES}) target_link_libraries(GameAnalytics PRIVATE ${LIBS} PUBLIC ${PUBLIC_LIBS}) - +message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}") +message(STATUS "CMAKE_EXE_LINKER_FLAGS: ${CMAKE_EXE_LINKER_FLAGS}") +message(STATUS "CMAKE_SHARED_LINKER_FLAGS: ${CMAKE_SHARED_LINKER_FLAGS}") # --------------------------- Google Test Setup --------------------------- # # Set Project Name From fc62e197c4916ef32c61a5beaefb14a8891ebd78 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Thu, 13 Mar 2025 19:14:07 +0200 Subject: [PATCH 11/36] Update CMakeLists.txt --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 70053a90..2b5e4233 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -198,6 +198,7 @@ elseif(LINUX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGUID_STDLIB -std=c++17") if(CLANG) + message(STATUS "Using Linux Clang with libstdc++") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++") endif() From 122584058606b51aa4d621fbbb3800bb9e21cde0 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Thu, 13 Mar 2025 19:16:49 +0200 Subject: [PATCH 12/36] Update CMakeLists.txt --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b5e4233..59ab5877 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -198,8 +198,8 @@ elseif(LINUX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGUID_STDLIB -std=c++17") if(CLANG) - message(STATUS "Using Linux Clang with libstdc++") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++") + message(STATUS "Detected Clang compiler: ${CMAKE_CXX_COMPILER}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") endif() endif() From 691a618769cc71729da9085f3bb75cf47d745d8c Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Thu, 13 Mar 2025 19:17:59 +0200 Subject: [PATCH 13/36] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 59ab5877..868c6b1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,7 +197,7 @@ elseif(APPLE) elseif(LINUX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGUID_STDLIB -std=c++17") - if(CLANG) + if (CMAKE_CXX_COMPILER MATCHES "clang") message(STATUS "Detected Clang compiler: ${CMAKE_CXX_COMPILER}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") endif() From bd08d61622cff983bd90d2ffedbd2e624e6fbb38 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Thu, 13 Mar 2025 19:21:20 +0200 Subject: [PATCH 14/36] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 868c6b1b..4d5115be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,7 +199,7 @@ elseif(LINUX) if (CMAKE_CXX_COMPILER MATCHES "clang") message(STATUS "Detected Clang compiler: ${CMAKE_CXX_COMPILER}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -nostdinc++") endif() endif() From 792a871ead9bf49d0b20471176dacdf89dbbad16 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Thu, 13 Mar 2025 19:22:37 +0200 Subject: [PATCH 15/36] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d5115be..e3ffd119 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,7 +199,7 @@ elseif(LINUX) if (CMAKE_CXX_COMPILER MATCHES "clang") message(STATUS "Detected Clang compiler: ${CMAKE_CXX_COMPILER}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -nostdinc++") + # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") endif() endif() From df964bda08eaf78172bbe77fbd9dca3e6a0358ec Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Thu, 13 Mar 2025 19:23:29 +0200 Subject: [PATCH 16/36] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e3ffd119..81962bf9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,7 +199,7 @@ elseif(LINUX) if (CMAKE_CXX_COMPILER MATCHES "clang") message(STATUS "Detected Clang compiler: ${CMAKE_CXX_COMPILER}") - # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++") endif() endif() From 876f32b72b4c8168dfa7c854ab11523e0d5e47d0 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Thu, 13 Mar 2025 19:28:08 +0200 Subject: [PATCH 17/36] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 81962bf9..868c6b1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,7 +199,7 @@ elseif(LINUX) if (CMAKE_CXX_COMPILER MATCHES "clang") message(STATUS "Detected Clang compiler: ${CMAKE_CXX_COMPILER}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") endif() endif() From e1b552ecef3a374bf60c7946528a6f3383cc50bc Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Thu, 13 Mar 2025 19:33:34 +0200 Subject: [PATCH 18/36] Update guid.cpp --- source/dependencies/crossguid/guid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dependencies/crossguid/guid.cpp b/source/dependencies/crossguid/guid.cpp index f3bfe58b..6faa8241 100644 --- a/source/dependencies/crossguid/guid.cpp +++ b/source/dependencies/crossguid/guid.cpp @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include "guid.h" #ifdef GUID_LIBUUID From cf493e70bc2314254dedf981af303e56af9bc1cf Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Thu, 13 Mar 2025 19:36:16 +0200 Subject: [PATCH 19/36] Update guid.cpp --- source/dependencies/crossguid/guid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dependencies/crossguid/guid.cpp b/source/dependencies/crossguid/guid.cpp index 6faa8241..f3bfe58b 100644 --- a/source/dependencies/crossguid/guid.cpp +++ b/source/dependencies/crossguid/guid.cpp @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include "guid.h" #ifdef GUID_LIBUUID From ebca0f4fbf99a064c888763ed2a94f31f3abbbf2 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Thu, 13 Mar 2025 19:41:34 +0200 Subject: [PATCH 20/36] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 868c6b1b..6691b43f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,7 +199,7 @@ elseif(LINUX) if (CMAKE_CXX_COMPILER MATCHES "clang") message(STATUS "Detected Clang compiler: ${CMAKE_CXX_COMPILER}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -lc++abi") endif() endif() From 6d771f5786eb53e0acd88fea972fa04b1e9aa842 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Mar 2025 11:11:08 +0200 Subject: [PATCH 21/36] try and fix libc++ compatibility issues for linux --- .github/workflows/cmake.yml | 2 ++ CMakeLists.txt | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 8190e0e5..be1a878e 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -82,6 +82,8 @@ jobs: # Verify the change clang --version clang++ --version + clang++ -v -E -x c++ /dev/null + clang++ -v -stdlib=libc++ - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. diff --git a/CMakeLists.txt b/CMakeLists.txt index 6691b43f..ee6655c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,7 +199,8 @@ elseif(LINUX) if (CMAKE_CXX_COMPILER MATCHES "clang") message(STATUS "Detected Clang compiler: ${CMAKE_CXX_COMPILER}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -lc++abi") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lc++abi") endif() endif() From 0d8ecb4bb872c9d53311b235fc61d32c01c1c3fc Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Mar 2025 11:17:08 +0200 Subject: [PATCH 22/36] Update cmake.yml --- .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 be1a878e..52441e2c 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -82,8 +82,8 @@ jobs: # Verify the change clang --version clang++ --version + echo "Checking clang headers..." clang++ -v -E -x c++ /dev/null - clang++ -v -stdlib=libc++ - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. From 409966ec22edf45b1c8bdd59b310b5d3271212e2 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Mar 2025 11:36:16 +0200 Subject: [PATCH 23/36] Update cmake.yml --- .github/workflows/cmake.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 52441e2c..be8fb862 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -31,17 +31,17 @@ jobs: # # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. matrix: - os: [ubuntu-24.04, windows-latest, macOS-latest] + os: [ubuntu-22.04, windows-latest, macOS-latest] build_type: ${{ fromJSON(format('[{0}]', inputs.build_type || '"Debug","Release"')) }} c_compiler: [gcc, clang, cl] include: - os: windows-latest c_compiler: cl cpp_compiler: cl - - os: ubuntu-24.04 + - os: ubuntu-22.04 c_compiler: gcc cpp_compiler: g++ - - os: ubuntu-24.04 + - os: ubuntu-22.04 c_compiler: clang cpp_compiler: clang++ - os: macOS-latest @@ -52,7 +52,7 @@ jobs: c_compiler: gcc - os: windows-latest c_compiler: clang - - os: ubuntu-24.04 + - os: ubuntu-22.04 c_compiler: cl - os: macOS-latest c_compiler: cl @@ -78,8 +78,10 @@ jobs: sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-16 100 sudo update-alternatives --set clang /usr/bin/clang-16 sudo update-alternatives --set clang++ /usr/bin/clang++-16 - - # Verify the change + + - name: Check Clang Settings + if: matrix.os == 'ubuntu-22.04' && matrix.c_compiler == 'clang' + run: | clang --version clang++ --version echo "Checking clang headers..." From 4e00501b15c86eb1501e6cf7a716249e6c5c1c17 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Mar 2025 11:39:14 +0200 Subject: [PATCH 24/36] Update GALinux.cpp --- source/gameanalytics/Platform/GALinux.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source/gameanalytics/Platform/GALinux.cpp b/source/gameanalytics/Platform/GALinux.cpp index 20154394..d5ec8064 100644 --- a/source/gameanalytics/Platform/GALinux.cpp +++ b/source/gameanalytics/Platform/GALinux.cpp @@ -4,6 +4,7 @@ #include "GAState.h" +#include #include #include #include From 884ae5d132731c3cbc1369cd44706b3739033b4e Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Mar 2025 12:36:05 +0200 Subject: [PATCH 25/36] Update CMakeLists.txt --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ee6655c7..2bedea27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -210,7 +210,7 @@ if(${GA_BUILD_SAMPLE}) endif() add_library(GameAnalytics ${LIB_TYPE} ${CPP_SOURCES}) -target_link_libraries(GameAnalytics PRIVATE ${LIBS} PUBLIC ${PUBLIC_LIBS}) +target_link_libraries(GameAnalytics PRIVATE ${LIBS} PUBLIC ${PUBLIC_LIBS} -lc) message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}") message(STATUS "CMAKE_EXE_LINKER_FLAGS: ${CMAKE_EXE_LINKER_FLAGS}") message(STATUS "CMAKE_SHARED_LINKER_FLAGS: ${CMAKE_SHARED_LINKER_FLAGS}") @@ -240,7 +240,7 @@ add_executable(${UT_PROJECT_NAME} ${TEST_SRC_FILES}) ######################################## # Standard linking to gtest and gmock components ######################################## -target_link_libraries(${UT_PROJECT_NAME} gtest gtest_main gmock_main) +target_link_libraries(${UT_PROJECT_NAME} gtest gtest_main gmock_main -lc) ######################################## # Linking to GA SDK From 2cd685c2f27fa88c82646ad78d3c0a823a0a3117 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Mar 2025 12:39:32 +0200 Subject: [PATCH 26/36] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ee6655c7..0236eb83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -200,7 +200,7 @@ elseif(LINUX) if (CMAKE_CXX_COMPILER MATCHES "clang") message(STATUS "Detected Clang compiler: ${CMAKE_CXX_COMPILER}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lc++abi") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lc -lc++abi") endif() endif() From c1dbc7d4f9740f63f4ba5e3482003479a5896076 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Mar 2025 12:57:44 +0200 Subject: [PATCH 27/36] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f298d238..d95c2397 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,7 +199,7 @@ elseif(LINUX) if (CMAKE_CXX_COMPILER MATCHES "clang") message(STATUS "Detected Clang compiler: ${CMAKE_CXX_COMPILER}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -D_FILE_OFFSET_BITS=64") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lc -lc++abi") endif() From 2da61b039f1bebddc5f962ac099a92f2f30272d0 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Mar 2025 12:59:51 +0200 Subject: [PATCH 28/36] Update cmake.yml --- .github/workflows/cmake.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index be8fb862..2e7ec3c4 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -86,6 +86,8 @@ jobs: clang++ --version echo "Checking clang headers..." clang++ -v -E -x c++ /dev/null + echo "check lld..." + ldd --version - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. From 02e23647f6d2aa4ebea49776be7db3f99684e637 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Mar 2025 15:33:51 +0200 Subject: [PATCH 29/36] use with older ubuntu 20.04 --- .github/workflows/cmake.yml | 18 +++++------------- CMakeLists.txt | 4 ++-- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 2e7ec3c4..f1f93185 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -31,17 +31,17 @@ jobs: # # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. matrix: - os: [ubuntu-22.04, windows-latest, macOS-latest] + os: [ubuntu-20.04, windows-latest, macOS-latest] build_type: ${{ fromJSON(format('[{0}]', inputs.build_type || '"Debug","Release"')) }} c_compiler: [gcc, clang, cl] include: - os: windows-latest c_compiler: cl cpp_compiler: cl - - os: ubuntu-22.04 + - os: ubuntu-20.04 c_compiler: gcc cpp_compiler: g++ - - os: ubuntu-22.04 + - os: ubuntu-20.04 c_compiler: clang cpp_compiler: clang++ - os: macOS-latest @@ -52,7 +52,7 @@ jobs: c_compiler: gcc - os: windows-latest c_compiler: clang - - os: ubuntu-22.04 + - os: ubuntu-20.04 c_compiler: cl - os: macOS-latest c_compiler: cl @@ -71,16 +71,8 @@ jobs: run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - - name: Set Clang 16 as Default - if: matrix.os == 'ubuntu-24.04' && matrix.c_compiler == 'clang' - run: | - sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-16 100 - sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-16 100 - sudo update-alternatives --set clang /usr/bin/clang-16 - sudo update-alternatives --set clang++ /usr/bin/clang++-16 - - name: Check Clang Settings - if: matrix.os == 'ubuntu-22.04' && matrix.c_compiler == 'clang' + if: matrix.os == 'ubuntu-20.04' && matrix.c_compiler == 'clang' run: | clang --version clang++ --version diff --git a/CMakeLists.txt b/CMakeLists.txt index d95c2397..4b027450 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -210,7 +210,7 @@ if(${GA_BUILD_SAMPLE}) endif() add_library(GameAnalytics ${LIB_TYPE} ${CPP_SOURCES}) -target_link_libraries(GameAnalytics PRIVATE ${LIBS} PUBLIC ${PUBLIC_LIBS} -lc) +target_link_libraries(GameAnalytics PRIVATE ${LIBS} PUBLIC ${PUBLIC_LIBS}) message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}") message(STATUS "CMAKE_EXE_LINKER_FLAGS: ${CMAKE_EXE_LINKER_FLAGS}") message(STATUS "CMAKE_SHARED_LINKER_FLAGS: ${CMAKE_SHARED_LINKER_FLAGS}") @@ -240,7 +240,7 @@ add_executable(${UT_PROJECT_NAME} ${TEST_SRC_FILES}) ######################################## # Standard linking to gtest and gmock components ######################################## -target_link_libraries(${UT_PROJECT_NAME} gtest gtest_main gmock_main -lc) +target_link_libraries(${UT_PROJECT_NAME} gtest gtest_main gmock_main) ######################################## # Linking to GA SDK From 2cca217f73e2fd344df1adf416f9df4af5016a2a Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Mar 2025 15:40:39 +0200 Subject: [PATCH 30/36] Update cmake.yml --- .github/workflows/cmake.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index f1f93185..a7a673a3 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -71,6 +71,11 @@ jobs: run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + - name: Install Clang and Libraries + run: | + sudo apt-get update + sudo apt-get install -y clang libc++-dev libc++abi-dev + - name: Check Clang Settings if: matrix.os == 'ubuntu-20.04' && matrix.c_compiler == 'clang' run: | From 733ef2a94c0adffd140ef7b9897b48db8a013b29 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Mar 2025 15:44:16 +0200 Subject: [PATCH 31/36] Update cmake.yml --- .github/workflows/cmake.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index a7a673a3..a28e7393 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -31,17 +31,17 @@ jobs: # # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. matrix: - os: [ubuntu-20.04, windows-latest, macOS-latest] + os: [ubuntu-24.04, windows-latest, macOS-latest] build_type: ${{ fromJSON(format('[{0}]', inputs.build_type || '"Debug","Release"')) }} c_compiler: [gcc, clang, cl] include: - os: windows-latest c_compiler: cl cpp_compiler: cl - - os: ubuntu-20.04 + - os: ubuntu-24.04 c_compiler: gcc cpp_compiler: g++ - - os: ubuntu-20.04 + - os: ubuntu-24.04 c_compiler: clang cpp_compiler: clang++ - os: macOS-latest @@ -52,7 +52,7 @@ jobs: c_compiler: gcc - os: windows-latest c_compiler: clang - - os: ubuntu-20.04 + - os: ubuntu-24.04 c_compiler: cl - os: macOS-latest c_compiler: cl @@ -72,12 +72,13 @@ jobs: echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - name: Install Clang and Libraries + if: matrix.os == 'ubuntu-24.04' && matrix.c_compiler == 'clang' run: | sudo apt-get update sudo apt-get install -y clang libc++-dev libc++abi-dev - name: Check Clang Settings - if: matrix.os == 'ubuntu-20.04' && matrix.c_compiler == 'clang' + if: matrix.os == 'ubuntu-24.04' && matrix.c_compiler == 'clang' run: | clang --version clang++ --version From 2a4ad72d0c3ced5dc449491ea883d828d577f5f1 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Mar 2025 16:10:39 +0200 Subject: [PATCH 32/36] Update cmake.yml Update CMakeLists.txt Update cmake.yml fix linux compilation issue --- .github/workflows/cmake.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index a28e7393..15681e38 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -77,6 +77,14 @@ jobs: sudo apt-get update sudo apt-get install -y clang libc++-dev libc++abi-dev + - name: Set Clang 16 as Default + if: matrix.os == 'ubuntu-24.04' && matrix.c_compiler == 'clang' + run: | + sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-16 100 + sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-16 100 + sudo update-alternatives --set clang /usr/bin/clang-16 + sudo update-alternatives --set clang++ /usr/bin/clang++-16 + - name: Check Clang Settings if: matrix.os == 'ubuntu-24.04' && matrix.c_compiler == 'clang' run: | From 72a65adb594d1be58fa5ed82b62613a475b179e3 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Fri, 14 Mar 2025 16:36:14 +0200 Subject: [PATCH 33/36] Update cmake.yml --- .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 a28e7393..f03da2e9 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -31,17 +31,17 @@ jobs: # # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. matrix: - os: [ubuntu-24.04, windows-latest, macOS-latest] + os: [ubuntu-latest, windows-latest, macOS-latest] build_type: ${{ fromJSON(format('[{0}]', inputs.build_type || '"Debug","Release"')) }} c_compiler: [gcc, clang, cl] include: - os: windows-latest c_compiler: cl cpp_compiler: cl - - os: ubuntu-24.04 + - os: ubuntu-latest c_compiler: gcc cpp_compiler: g++ - - os: ubuntu-24.04 + - os: ubuntu-latest c_compiler: clang cpp_compiler: clang++ - os: macOS-latest @@ -52,7 +52,7 @@ jobs: c_compiler: gcc - os: windows-latest c_compiler: clang - - os: ubuntu-24.04 + - os: ubuntu-latest c_compiler: cl - os: macOS-latest c_compiler: cl @@ -72,13 +72,13 @@ jobs: echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - name: Install Clang and Libraries - if: matrix.os == 'ubuntu-24.04' && matrix.c_compiler == 'clang' + if: matrix.os == 'ubuntu-latest' && matrix.c_compiler == 'clang' run: | sudo apt-get update sudo apt-get install -y clang libc++-dev libc++abi-dev - name: Check Clang Settings - if: matrix.os == 'ubuntu-24.04' && matrix.c_compiler == 'clang' + if: matrix.os == 'ubuntu-latest' && matrix.c_compiler == 'clang' run: | clang --version clang++ --version From 43f2de434f3635019b903d47307849d6f5108e55 Mon Sep 17 00:00:00 2001 From: Andrei Dabija Date: Wed, 26 Mar 2025 15:07:45 +0200 Subject: [PATCH 34/36] Update CMakeLists.txt --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b027450..868c6b1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,8 +199,7 @@ elseif(LINUX) if (CMAKE_CXX_COMPILER MATCHES "clang") message(STATUS "Detected Clang compiler: ${CMAKE_CXX_COMPILER}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -D_FILE_OFFSET_BITS=64") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lc -lc++abi") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") endif() endif() From 3a572cf147e15945da3583d7aab4778b146c7ca9 Mon Sep 17 00:00:00 2001 From: Dorin Date: Wed, 26 Mar 2025 15:17:13 +0200 Subject: [PATCH 35/36] expose identifiers --- include/GameAnalytics/GameAnalytics.h | 3 +++ source/gameanalytics/GAState.cpp | 7 ++++++- source/gameanalytics/GAState.h | 3 ++- source/gameanalytics/GameAnalytics.cpp | 12 +++++++++++- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/include/GameAnalytics/GameAnalytics.h b/include/GameAnalytics/GameAnalytics.h index a5b135c7..622d30d0 100644 --- a/include/GameAnalytics/GameAnalytics.h +++ b/include/GameAnalytics/GameAnalytics.h @@ -110,6 +110,9 @@ namespace gameanalytics static std::string getRemoteConfigsContentAsString(); + static std::string getUserId(); + static std::string getExternalUserId(); + static std::string getABTestingId(); static std::string getABTestingVariantId(); diff --git a/source/gameanalytics/GAState.cpp b/source/gameanalytics/GAState.cpp index 515655a4..2b8c1745 100644 --- a/source/gameanalytics/GAState.cpp +++ b/source/gameanalytics/GAState.cpp @@ -66,6 +66,11 @@ namespace gameanalytics return getInstance()._identifier; } + std::string GAState::getExternalUserId() + { + return getInstance()._externalUserId; + } + bool GAState::isInitialized() { return getInstance()._initialized; @@ -402,7 +407,7 @@ namespace gameanalytics out["event_uuid"] = utilities::GAUtilities::generateUUID(); // User identifier - out["user_id"] = getInstance().getIdentifier(); + out["user_id"] = getUserId(); // remote configs configurations if(getInstance()._configurations.is_object() && !getInstance()._configurations.empty()) diff --git a/source/gameanalytics/GAState.h b/source/gameanalytics/GAState.h index 490bd3a1..020438ea 100644 --- a/source/gameanalytics/GAState.h +++ b/source/gameanalytics/GAState.h @@ -141,6 +141,8 @@ namespace gameanalytics static std::string getRemoteConfigsContentAsString(); static std::string getAbId(); static std::string getAbVariantId(); + static std::string getUserId(); + static std::string getExternalUserId(); static json getValidatedCustomFields(); static json getValidatedCustomFields(const json& withEventFields); @@ -164,7 +166,6 @@ namespace gameanalytics addErrorEvent(severity, msg); } - std::string getIdentifier(); void setDefaultUserId(std::string const& id); json& getSdkConfig(); void cacheIdentifier(); diff --git a/source/gameanalytics/GameAnalytics.cpp b/source/gameanalytics/GameAnalytics.cpp index dfa373ca..60ec105b 100644 --- a/source/gameanalytics/GameAnalytics.cpp +++ b/source/gameanalytics/GameAnalytics.cpp @@ -475,7 +475,7 @@ namespace gameanalytics { // Send to events json fieldsJson = utilities::parseFields(fields); - events::GAEvents::addProgressionEvent(progressionStatus, progression01, progression02, progression03, score, false, fieldsJson, mergeFields); + events::GAEvents::addProgressionEvent(progressionStatus, progression01, progression02, progression03, score, true, fieldsJson, mergeFields); } catch(const json::exception& e) { @@ -763,6 +763,16 @@ namespace gameanalytics return state::GAState::getRemoteConfigsContentAsString(); } + std::string GameAnalytics::getUserId() + { + return state::GAState::getUserId(); + } + + std::string GameAnalytics::getExternalUserId() + { + return state::GAState::getExternalUserId(); + } + std::string GameAnalytics::getABTestingId() { return state::GAState::getAbId(); From 4eb45a451888a9eef85c706a72523777709ca20d Mon Sep 17 00:00:00 2001 From: Dorin Date: Wed, 26 Mar 2025 15:27:49 +0200 Subject: [PATCH 36/36] renamed getUserId --- source/gameanalytics/GAState.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/gameanalytics/GAState.cpp b/source/gameanalytics/GAState.cpp index 2b8c1745..13fd7a90 100644 --- a/source/gameanalytics/GAState.cpp +++ b/source/gameanalytics/GAState.cpp @@ -61,7 +61,7 @@ namespace gameanalytics getInstance().cacheIdentifier(); } - std::string GAState::getIdentifier() + std::string GAState::getUserId() { return getInstance()._identifier; }