From ff91dc415f2da08e71e07ec33a92df62ecef6ed7 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Mon, 30 Dec 2024 19:47:52 -0500 Subject: [PATCH 01/30] cache correct .ccache path --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7a19265..45e6126 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,7 +57,7 @@ jobs: - name: Cache build artifacts uses: actions/cache@v4 with: - path: .ccache + path: ~/.ccache key: ${{ runner.os }}-ccache-${{ hashFiles('**/CMakeLists.txt') }}-${{ env.DOWNLOAD_CACHE_VERSION }} restore-keys: | ${{ runner.os }}-ccache- From a96cd76ef267c2cc9e068b6d7d7d6b322652d1f1 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 01:19:21 -0500 Subject: [PATCH 02/30] check if ~/.ccache is there --- .github/workflows/test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 45e6126..61ce222 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -76,9 +76,7 @@ jobs: run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --parallel $(nproc) - name: Verify cache - run : ls -a - - name: Verify cache 2 - run : tree ~ + run : ls -a ~ # - name: Test # working-directory: ${{ steps.strings.outputs.build-output-dir }} From 3b3b6f9f241a090e98940b962f4828f2a172ee80 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 01:22:58 -0500 Subject: [PATCH 03/30] set ccache in CMakeLists --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9616099..41faf9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,8 +7,8 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") -# set(C_COMPILER_LAUNCHER ccache) -# set(CXX_COMPILER_LAUNCHER ccache) +set(C_COMPILER_LAUNCHER ccache) +set(CXX_COMPILER_LAUNCHER ccache) project(BOX VERSION 0.0.1) if (APPLE) From 45c8e133730b890eadb24ed026966667717bee3d Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 01:45:10 -0500 Subject: [PATCH 04/30] i think it's in ~/.config/ccache --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 61ce222..01b9211 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -76,7 +76,7 @@ jobs: run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --parallel $(nproc) - name: Verify cache - run : ls -a ~ + run : ls -a ~/.config # - name: Test # working-directory: ${{ steps.strings.outputs.build-output-dir }} From 15a050616089a7ad313ea6b1f17b2a41d9e64df4 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 01:45:47 -0500 Subject: [PATCH 05/30] print more --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 01b9211..fca47d7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -77,6 +77,10 @@ jobs: - name: Verify cache run : ls -a ~/.config + - name: Verify cache 2 + run : tree ~/.config + - name: Verify cache 3 + run : ls -a ~/.config/ccache # - name: Test # working-directory: ${{ steps.strings.outputs.build-output-dir }} From 3e956ff93e90beef9619afbb280860fde8df7b46 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 01:53:14 -0500 Subject: [PATCH 06/30] try set path = .config/ccache --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fca47d7..5966e9a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,7 +57,7 @@ jobs: - name: Cache build artifacts uses: actions/cache@v4 with: - path: ~/.ccache + path: ~/.config/ccache key: ${{ runner.os }}-ccache-${{ hashFiles('**/CMakeLists.txt') }}-${{ env.DOWNLOAD_CACHE_VERSION }} restore-keys: | ${{ runner.os }}-ccache- From 1fcdc370656997d0e2a3cf2629a521d6e4b2e5f5 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 02:03:30 -0500 Subject: [PATCH 07/30] set CCACHE_DIR env --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5966e9a..ebca18a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,6 +5,7 @@ name: test env: CC: "ccache clang" CXX: "ccache clang++" + CCACHE_DIR: "~/.ccache" DOWNLOAD_CACHE_VERSION: 8 on: @@ -54,6 +55,9 @@ jobs: run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + - name: Create cache dir + run: mkdir ~/.ccache + - name: Cache build artifacts uses: actions/cache@v4 with: From e8d11ea9a1e239d164b0f435953c6da26babacf9 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 02:06:55 -0500 Subject: [PATCH 08/30] fix path and more prints --- .github/workflows/test.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ebca18a..566fcd1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -61,7 +61,7 @@ jobs: - name: Cache build artifacts uses: actions/cache@v4 with: - path: ~/.config/ccache + path: ~/ccache key: ${{ runner.os }}-ccache-${{ hashFiles('**/CMakeLists.txt') }}-${{ env.DOWNLOAD_CACHE_VERSION }} restore-keys: | ${{ runner.os }}-ccache- @@ -79,12 +79,12 @@ jobs: - name: Build run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --parallel $(nproc) - - name: Verify cache - run : ls -a ~/.config - - name: Verify cache 2 - run : tree ~/.config - - name: Verify cache 3 - run : ls -a ~/.config/ccache + - name: Check ~ + run : ls -a ~ + - name: find ccache + run: find . -iname ".ccache" + - name: ccache stats + run: ccache -p # - name: Test # working-directory: ${{ steps.strings.outputs.build-output-dir }} From caa87e67ecc720dc25df087da3ab0c8351e6bba7 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 02:22:31 -0500 Subject: [PATCH 09/30] more print --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 566fcd1..e47f290 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -83,6 +83,10 @@ jobs: run : ls -a ~ - name: find ccache run: find . -iname ".ccache" + - name: view cache + run : ls -a ~/.ccache + - name: tree cache + run : tree ~/.ccache - name: ccache stats run: ccache -p From 8db030d3071485531175e3c07dd6339df4b3fd89 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 02:55:40 -0500 Subject: [PATCH 10/30] more print --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e47f290..f7736ee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -82,13 +82,15 @@ jobs: - name: Check ~ run : ls -a ~ - name: find ccache - run: find . -iname ".ccache" + run: find / -type d -name ".ccache" 2>/dev/null - name: view cache run : ls -a ~/.ccache - name: tree cache run : tree ~/.ccache - - name: ccache stats + - name: ccache config run: ccache -p + - name: ccache stats + run: ccache -s # - name: Test # working-directory: ${{ steps.strings.outputs.build-output-dir }} From 87e6184b648ae97118c7cb3e2634c3874eb37aff Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 03:17:51 -0500 Subject: [PATCH 11/30] set _DCMAKE_C_COMPILER_LAUNCHER --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f7736ee..534306a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -74,6 +74,8 @@ jobs: -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -DCMAKE_C_COMPILER_LAUNCHER=ccache + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -S ${{ github.workspace }} - name: Build From 0273dff8920a1c7bd4dc7ed8dec6997b299f2f79 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 03:19:21 -0500 Subject: [PATCH 12/30] remove find --- .github/workflows/test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 534306a..1211ba7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -83,8 +83,6 @@ jobs: - name: Check ~ run : ls -a ~ - - name: find ccache - run: find / -type d -name ".ccache" 2>/dev/null - name: view cache run : ls -a ~/.ccache - name: tree cache From ddfaac541dd041becfdc8c46d342d99530176029 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 11:18:27 -0500 Subject: [PATCH 13/30] try to see where (default) cache_dir is --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1211ba7..fa612cb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ name: test env: CC: "ccache clang" CXX: "ccache clang++" - CCACHE_DIR: "~/.ccache" + # CCACHE_DIR: "~/.ccache" DOWNLOAD_CACHE_VERSION: 8 on: From 647214f2a940ffcd820211b866fe74f118f30170 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 11:36:57 -0500 Subject: [PATCH 14/30] try /home/runner/.ccache --- .github/workflows/test.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fa612cb..d520807 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,13 +55,10 @@ jobs: run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - - name: Create cache dir - run: mkdir ~/.ccache - - name: Cache build artifacts uses: actions/cache@v4 with: - path: ~/ccache + path: /home/runner/.ccache key: ${{ runner.os }}-ccache-${{ hashFiles('**/CMakeLists.txt') }}-${{ env.DOWNLOAD_CACHE_VERSION }} restore-keys: | ${{ runner.os }}-ccache- @@ -83,10 +80,12 @@ jobs: - name: Check ~ run : ls -a ~ - - name: view cache - run : ls -a ~/.ccache + - name: Check /home/runner/ + run : ls -a /home/runner + - name: Check cache + run : ls -a /home/runner/.ccache - name: tree cache - run : tree ~/.ccache + run : tree /home/runner/.ccache - name: ccache config run: ccache -p - name: ccache stats From 19a33a2115e4665cc7aaade3c348b5278e52c0cf Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 12:01:16 -0500 Subject: [PATCH 15/30] hello.c example --- CMakeLists.txt | 104 +++------------------------------------------ OLD_CMakeLists.txt | 101 +++++++++++++++++++++++++++++++++++++++++++ hello.c | 7 +++ 3 files changed, 113 insertions(+), 99 deletions(-) create mode 100644 OLD_CMakeLists.txt create mode 100644 hello.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 41faf9c..7bd9299 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,101 +1,7 @@ -cmake_minimum_required(VERSION 3.22) +cmake_minimum_required(VERSION 3.10) -set(CMAKE_C_COMPILER clang) -set(CMAKE_CXX_COMPILER clang++) +# Project name +project(HelloWorld) -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") -set(C_COMPILER_LAUNCHER ccache) -set(CXX_COMPILER_LAUNCHER ccache) -project(BOX VERSION 0.0.1) - -if (APPLE) - add_definitions(-DGL_SILENCE_DEPRECATION) -endif() - -# shader -file(COPY ${CMAKE_SOURCE_DIR}/shader DESTINATION ${CMAKE_BINARY_DIR}/Box_artefacts) - -add_subdirectory(external/tracktion_engine/modules/juce) -add_subdirectory(external/tracktion_engine/modules) -add_subdirectory(external/raylib) -add_subdirectory(external/googletest) -include_directories(include) -include_directories(external/googletest/googletest/include) - -# sources (without main.cc) -file(GLOB_RECURSE SRC_FILES src/*.cc) -list(REMOVE_ITEM SRC_FILES ${CMAKE_SOURCE_DIR}/src/main.cc) - -# boxlib -add_library(BoxLib - STATIC - ${SRC_FILES}) -target_include_directories(BoxLib - PUBLIC - external/tracktion_engine/modules - external/tracktion_engine/modules/juce) -target_link_libraries(BoxLib - PUBLIC - raylib - tracktion::tracktion_engine - juce::juce_core - juce::juce_recommended_config_flags - juce::juce_recommended_warning_flags) -if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - # atomic - target_link_libraries(BoxLib PUBLIC "-latomic") - # gtk3 - find_package(PkgConfig REQUIRED) - pkg_check_modules(GTK3 REQUIRED gtk+-3.0) - include_directories(${GTK3_INCLUDE_DIRS}) - link_directories(${GTK3_LIBRARY_DIRS}) - add_definitions(${GTK3_CFLAGS_OTHER}) - - # webkit - find_package(PkgConfig REQUIRED) - pkg_check_modules(WEBKIT2 REQUIRED webkit2gtk-4.0) - include_directories(${WEBKIT2_INCLUDE_DIRS}) - link_directories(${WEBKIT2_LIBRARY_DIRS}) - add_definitions(${WEBKIT2_CFLAGS_OTHER}) - - # curl - find_package(PkgConfig REQUIRED) - pkg_check_modules(LIBCURL REQUIRED libcurl) - include_directories(${LIBCURL_INCLUDE_DIRS}) - link_directories(${LIBCURL_LIBRARY_DIRS}) - add_definitions(${LIBCURL_CFLAGS_OTHER}) - target_link_libraries(BoxLib PRIVATE ${LIBCURL_LIBRARIES}) -endif() - -# box -juce_add_console_app(Box - PRODUCT_NAME "Box" - NEEDS_WEB_BROWSER FALSE - ) -target_sources(Box - PRIVATE - src/main.cc) -target_compile_definitions(Box - PRIVATE - JUCE_WEB_BROWSER=0 - JUCE_USE_CURL=0) -target_link_libraries(Box - PRIVATE - BoxLib) - -# boxtest -enable_testing() -add_executable(BoxTests - test/test.cc) -target_link_libraries(BoxTests - PRIVATE - BoxLib - gtest - gtest_main) - -# Register tests with ctest -add_test(NAME BoxTests COMMAND BoxTests) -# set_tests_properties(BoxTests PROPERTIES CONFIGURATIONS Debug Release) +# Add the executable +add_executable(hello hello.c) diff --git a/OLD_CMakeLists.txt b/OLD_CMakeLists.txt new file mode 100644 index 0000000..41faf9c --- /dev/null +++ b/OLD_CMakeLists.txt @@ -0,0 +1,101 @@ +cmake_minimum_required(VERSION 3.22) + +set(CMAKE_C_COMPILER clang) +set(CMAKE_CXX_COMPILER clang++) + +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") +set(C_COMPILER_LAUNCHER ccache) +set(CXX_COMPILER_LAUNCHER ccache) +project(BOX VERSION 0.0.1) + +if (APPLE) + add_definitions(-DGL_SILENCE_DEPRECATION) +endif() + +# shader +file(COPY ${CMAKE_SOURCE_DIR}/shader DESTINATION ${CMAKE_BINARY_DIR}/Box_artefacts) + +add_subdirectory(external/tracktion_engine/modules/juce) +add_subdirectory(external/tracktion_engine/modules) +add_subdirectory(external/raylib) +add_subdirectory(external/googletest) +include_directories(include) +include_directories(external/googletest/googletest/include) + +# sources (without main.cc) +file(GLOB_RECURSE SRC_FILES src/*.cc) +list(REMOVE_ITEM SRC_FILES ${CMAKE_SOURCE_DIR}/src/main.cc) + +# boxlib +add_library(BoxLib + STATIC + ${SRC_FILES}) +target_include_directories(BoxLib + PUBLIC + external/tracktion_engine/modules + external/tracktion_engine/modules/juce) +target_link_libraries(BoxLib + PUBLIC + raylib + tracktion::tracktion_engine + juce::juce_core + juce::juce_recommended_config_flags + juce::juce_recommended_warning_flags) +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + # atomic + target_link_libraries(BoxLib PUBLIC "-latomic") + # gtk3 + find_package(PkgConfig REQUIRED) + pkg_check_modules(GTK3 REQUIRED gtk+-3.0) + include_directories(${GTK3_INCLUDE_DIRS}) + link_directories(${GTK3_LIBRARY_DIRS}) + add_definitions(${GTK3_CFLAGS_OTHER}) + + # webkit + find_package(PkgConfig REQUIRED) + pkg_check_modules(WEBKIT2 REQUIRED webkit2gtk-4.0) + include_directories(${WEBKIT2_INCLUDE_DIRS}) + link_directories(${WEBKIT2_LIBRARY_DIRS}) + add_definitions(${WEBKIT2_CFLAGS_OTHER}) + + # curl + find_package(PkgConfig REQUIRED) + pkg_check_modules(LIBCURL REQUIRED libcurl) + include_directories(${LIBCURL_INCLUDE_DIRS}) + link_directories(${LIBCURL_LIBRARY_DIRS}) + add_definitions(${LIBCURL_CFLAGS_OTHER}) + target_link_libraries(BoxLib PRIVATE ${LIBCURL_LIBRARIES}) +endif() + +# box +juce_add_console_app(Box + PRODUCT_NAME "Box" + NEEDS_WEB_BROWSER FALSE + ) +target_sources(Box + PRIVATE + src/main.cc) +target_compile_definitions(Box + PRIVATE + JUCE_WEB_BROWSER=0 + JUCE_USE_CURL=0) +target_link_libraries(Box + PRIVATE + BoxLib) + +# boxtest +enable_testing() +add_executable(BoxTests + test/test.cc) +target_link_libraries(BoxTests + PRIVATE + BoxLib + gtest + gtest_main) + +# Register tests with ctest +add_test(NAME BoxTests COMMAND BoxTests) +# set_tests_properties(BoxTests PROPERTIES CONFIGURATIONS Debug Release) diff --git a/hello.c b/hello.c new file mode 100644 index 0000000..10642f2 --- /dev/null +++ b/hello.c @@ -0,0 +1,7 @@ +#include + +int main() +{ + printf("hello\n"); + return 0; +} From 6030fdad1efc0762e89b7f41f244d9808766242f Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 12:02:32 -0500 Subject: [PATCH 16/30] try no CC and space after -D --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d520807..4652490 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,8 +3,8 @@ name: test env: - CC: "ccache clang" - CXX: "ccache clang++" + # CC: "ccache clang" + # CXX: "ccache clang++" # CCACHE_DIR: "~/.ccache" DOWNLOAD_CACHE_VERSION: 8 @@ -71,8 +71,8 @@ jobs: -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - -DCMAKE_C_COMPILER_LAUNCHER=ccache - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + -D CMAKE_C_COMPILER_LAUNCHER=ccache + -D CMAKE_CXX_COMPILER_LAUNCHER=ccache -S ${{ github.workspace }} - name: Build From 2403a9fe0fde58591d2a5f3348847b363807d68a Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 12:05:05 -0500 Subject: [PATCH 17/30] try a different build method --- .github/workflows/test.yml | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4652490..1624824 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -63,20 +63,28 @@ jobs: restore-keys: | ${{ runner.os }}-ccache- - - 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 - run: > - cmake -B ${{ steps.strings.outputs.build-output-dir }} - -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} - -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - -D CMAKE_C_COMPILER_LAUNCHER=ccache - -D CMAKE_CXX_COMPILER_LAUNCHER=ccache - -S ${{ github.workspace }} + - name: Build (my way) + run: | + mkdir build + cd build + cmake -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache .. + make + cd .. + + # - 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 + # run: > + # cmake -B ${{ steps.strings.outputs.build-output-dir }} + # -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + # -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + # -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + # -D CMAKE_C_COMPILER_LAUNCHER=ccache + # -D CMAKE_CXX_COMPILER_LAUNCHER=ccache + # -S ${{ github.workspace }} - - name: Build - run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --parallel $(nproc) + # - name: Build + # run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --parallel $(nproc) - name: Check ~ run : ls -a ~ From e6239365c3b36f768375228d19572796adbbe73b Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 12:08:30 -0500 Subject: [PATCH 18/30] build no cmake --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1624824..29b4266 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,6 +70,8 @@ jobs: cmake -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache .. make cd .. + - name: Build (no cmake) + run: ccache clang hello.c # - 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 629fa6928dc440fab3ccbb3dd930dc11ff56fbf9 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 12:10:22 -0500 Subject: [PATCH 19/30] make home dir --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 29b4266..f2939f2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,6 +55,9 @@ jobs: run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + - name: make cache dir + run: mkdir /home/runner/.ccache + - name: Cache build artifacts uses: actions/cache@v4 with: From f33dcb088b99416e4036f65cb3254b848814cb6f Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 12:10:58 -0500 Subject: [PATCH 20/30] find cache --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f2939f2..7e7f700 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -95,8 +95,8 @@ jobs: run : ls -a ~ - name: Check /home/runner/ run : ls -a /home/runner - - name: Check cache - run : ls -a /home/runner/.ccache + - name: Find cache + run: find ~ -type d -name ".ccache" - name: tree cache run : tree /home/runner/.ccache - name: ccache config From 11e5be886e5f2abb5c15e2494f8ed775c261769d Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 12:12:42 -0500 Subject: [PATCH 21/30] remove non-cmake build --- .github/workflows/test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7e7f700..e6dff17 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -73,8 +73,6 @@ jobs: cmake -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache .. make cd .. - - name: Build (no cmake) - run: ccache clang hello.c # - 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 a7a900b02934ca993fb949d598753c1c4d560f36 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 12:19:33 -0500 Subject: [PATCH 22/30] Build (ci way) --- .github/workflows/test.yml | 40 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e6dff17..d06540e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -66,28 +66,28 @@ jobs: restore-keys: | ${{ runner.os }}-ccache- - - name: Build (my way) - run: | - mkdir build - cd build - cmake -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache .. - make - cd .. + # - name: Build (my way) + # run: | + # mkdir build + # cd build + # cmake -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache .. + # make + # cd .. - # - 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 - # run: > - # cmake -B ${{ steps.strings.outputs.build-output-dir }} - # -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} - # -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} - # -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - # -D CMAKE_C_COMPILER_LAUNCHER=ccache - # -D CMAKE_CXX_COMPILER_LAUNCHER=ccache - # -S ${{ github.workspace }} + - 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 + run: > + cmake -B ${{ steps.strings.outputs.build-output-dir }} + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -D CMAKE_C_COMPILER_LAUNCHER=ccache + -D CMAKE_CXX_COMPILER_LAUNCHER=ccache + -S ${{ github.workspace }} - # - name: Build - # run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --parallel $(nproc) + - name: Build + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --parallel $(nproc) - name: Check ~ run : ls -a ~ From 567192ca68048715cc7136e25775e1bdeb3bb351 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 12:22:22 -0500 Subject: [PATCH 23/30] go back to old cmakelists --- CMakeLists.txt | 104 ++++++++++++++++++++++++++++++++++++++++++--- NEW_CMakeLists.txt | 7 +++ OLD_CMakeLists.txt | 101 ------------------------------------------- 3 files changed, 106 insertions(+), 106 deletions(-) create mode 100644 NEW_CMakeLists.txt delete mode 100644 OLD_CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 7bd9299..41faf9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,101 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.22) -# Project name -project(HelloWorld) +set(CMAKE_C_COMPILER clang) +set(CMAKE_CXX_COMPILER clang++) -# Add the executable -add_executable(hello hello.c) +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") +set(C_COMPILER_LAUNCHER ccache) +set(CXX_COMPILER_LAUNCHER ccache) +project(BOX VERSION 0.0.1) + +if (APPLE) + add_definitions(-DGL_SILENCE_DEPRECATION) +endif() + +# shader +file(COPY ${CMAKE_SOURCE_DIR}/shader DESTINATION ${CMAKE_BINARY_DIR}/Box_artefacts) + +add_subdirectory(external/tracktion_engine/modules/juce) +add_subdirectory(external/tracktion_engine/modules) +add_subdirectory(external/raylib) +add_subdirectory(external/googletest) +include_directories(include) +include_directories(external/googletest/googletest/include) + +# sources (without main.cc) +file(GLOB_RECURSE SRC_FILES src/*.cc) +list(REMOVE_ITEM SRC_FILES ${CMAKE_SOURCE_DIR}/src/main.cc) + +# boxlib +add_library(BoxLib + STATIC + ${SRC_FILES}) +target_include_directories(BoxLib + PUBLIC + external/tracktion_engine/modules + external/tracktion_engine/modules/juce) +target_link_libraries(BoxLib + PUBLIC + raylib + tracktion::tracktion_engine + juce::juce_core + juce::juce_recommended_config_flags + juce::juce_recommended_warning_flags) +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + # atomic + target_link_libraries(BoxLib PUBLIC "-latomic") + # gtk3 + find_package(PkgConfig REQUIRED) + pkg_check_modules(GTK3 REQUIRED gtk+-3.0) + include_directories(${GTK3_INCLUDE_DIRS}) + link_directories(${GTK3_LIBRARY_DIRS}) + add_definitions(${GTK3_CFLAGS_OTHER}) + + # webkit + find_package(PkgConfig REQUIRED) + pkg_check_modules(WEBKIT2 REQUIRED webkit2gtk-4.0) + include_directories(${WEBKIT2_INCLUDE_DIRS}) + link_directories(${WEBKIT2_LIBRARY_DIRS}) + add_definitions(${WEBKIT2_CFLAGS_OTHER}) + + # curl + find_package(PkgConfig REQUIRED) + pkg_check_modules(LIBCURL REQUIRED libcurl) + include_directories(${LIBCURL_INCLUDE_DIRS}) + link_directories(${LIBCURL_LIBRARY_DIRS}) + add_definitions(${LIBCURL_CFLAGS_OTHER}) + target_link_libraries(BoxLib PRIVATE ${LIBCURL_LIBRARIES}) +endif() + +# box +juce_add_console_app(Box + PRODUCT_NAME "Box" + NEEDS_WEB_BROWSER FALSE + ) +target_sources(Box + PRIVATE + src/main.cc) +target_compile_definitions(Box + PRIVATE + JUCE_WEB_BROWSER=0 + JUCE_USE_CURL=0) +target_link_libraries(Box + PRIVATE + BoxLib) + +# boxtest +enable_testing() +add_executable(BoxTests + test/test.cc) +target_link_libraries(BoxTests + PRIVATE + BoxLib + gtest + gtest_main) + +# Register tests with ctest +add_test(NAME BoxTests COMMAND BoxTests) +# set_tests_properties(BoxTests PROPERTIES CONFIGURATIONS Debug Release) diff --git a/NEW_CMakeLists.txt b/NEW_CMakeLists.txt new file mode 100644 index 0000000..7bd9299 --- /dev/null +++ b/NEW_CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.10) + +# Project name +project(HelloWorld) + +# Add the executable +add_executable(hello hello.c) diff --git a/OLD_CMakeLists.txt b/OLD_CMakeLists.txt deleted file mode 100644 index 41faf9c..0000000 --- a/OLD_CMakeLists.txt +++ /dev/null @@ -1,101 +0,0 @@ -cmake_minimum_required(VERSION 3.22) - -set(CMAKE_C_COMPILER clang) -set(CMAKE_CXX_COMPILER clang++) - -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") -set(C_COMPILER_LAUNCHER ccache) -set(CXX_COMPILER_LAUNCHER ccache) -project(BOX VERSION 0.0.1) - -if (APPLE) - add_definitions(-DGL_SILENCE_DEPRECATION) -endif() - -# shader -file(COPY ${CMAKE_SOURCE_DIR}/shader DESTINATION ${CMAKE_BINARY_DIR}/Box_artefacts) - -add_subdirectory(external/tracktion_engine/modules/juce) -add_subdirectory(external/tracktion_engine/modules) -add_subdirectory(external/raylib) -add_subdirectory(external/googletest) -include_directories(include) -include_directories(external/googletest/googletest/include) - -# sources (without main.cc) -file(GLOB_RECURSE SRC_FILES src/*.cc) -list(REMOVE_ITEM SRC_FILES ${CMAKE_SOURCE_DIR}/src/main.cc) - -# boxlib -add_library(BoxLib - STATIC - ${SRC_FILES}) -target_include_directories(BoxLib - PUBLIC - external/tracktion_engine/modules - external/tracktion_engine/modules/juce) -target_link_libraries(BoxLib - PUBLIC - raylib - tracktion::tracktion_engine - juce::juce_core - juce::juce_recommended_config_flags - juce::juce_recommended_warning_flags) -if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - # atomic - target_link_libraries(BoxLib PUBLIC "-latomic") - # gtk3 - find_package(PkgConfig REQUIRED) - pkg_check_modules(GTK3 REQUIRED gtk+-3.0) - include_directories(${GTK3_INCLUDE_DIRS}) - link_directories(${GTK3_LIBRARY_DIRS}) - add_definitions(${GTK3_CFLAGS_OTHER}) - - # webkit - find_package(PkgConfig REQUIRED) - pkg_check_modules(WEBKIT2 REQUIRED webkit2gtk-4.0) - include_directories(${WEBKIT2_INCLUDE_DIRS}) - link_directories(${WEBKIT2_LIBRARY_DIRS}) - add_definitions(${WEBKIT2_CFLAGS_OTHER}) - - # curl - find_package(PkgConfig REQUIRED) - pkg_check_modules(LIBCURL REQUIRED libcurl) - include_directories(${LIBCURL_INCLUDE_DIRS}) - link_directories(${LIBCURL_LIBRARY_DIRS}) - add_definitions(${LIBCURL_CFLAGS_OTHER}) - target_link_libraries(BoxLib PRIVATE ${LIBCURL_LIBRARIES}) -endif() - -# box -juce_add_console_app(Box - PRODUCT_NAME "Box" - NEEDS_WEB_BROWSER FALSE - ) -target_sources(Box - PRIVATE - src/main.cc) -target_compile_definitions(Box - PRIVATE - JUCE_WEB_BROWSER=0 - JUCE_USE_CURL=0) -target_link_libraries(Box - PRIVATE - BoxLib) - -# boxtest -enable_testing() -add_executable(BoxTests - test/test.cc) -target_link_libraries(BoxTests - PRIVATE - BoxLib - gtest - gtest_main) - -# Register tests with ctest -add_test(NAME BoxTests COMMAND BoxTests) -# set_tests_properties(BoxTests PROPERTIES CONFIGURATIONS Debug Release) From d25b10938a3367f626654ed26a05f292aff4aba2 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 12:41:54 -0500 Subject: [PATCH 24/30] cleanup test to test caching --- .github/workflows/test.yml | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d06540e..d949b0f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,15 +1,9 @@ -# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. -# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml name: test env: - # CC: "ccache clang" - # CXX: "ccache clang++" - # CCACHE_DIR: "~/.ccache" DOWNLOAD_CACHE_VERSION: 8 on: - # don't run on push to main cuz i do that a lot push: branches: [ "main" ] pull_request: @@ -37,7 +31,6 @@ jobs: - os: ubuntu-latest c_compiler: clang cpp_compiler: clang++ - steps: - uses: actions/checkout@v4 with: @@ -47,17 +40,14 @@ jobs: sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update sudo apt-get install -y tree ccache gcc-11 g++-11 freeglut3-dev g++ libasound2-dev libcurl4-openssl-dev libfreetype6-dev libjack-jackd2-dev libx11-dev libxcomposite-dev libxcursor-dev libxinerama-dev libxrandr-dev mesa-common-dev ladspa-sdk webkit2gtk-4.0 libgtk-3-dev xvfb ninja-build libwebkit2gtk-4.1-dev - - name: Set reusable strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. id: strings shell: bash run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - - name: make cache dir run: mkdir /home/runner/.ccache - - name: Cache build artifacts uses: actions/cache@v4 with: @@ -65,18 +55,7 @@ jobs: key: ${{ runner.os }}-ccache-${{ hashFiles('**/CMakeLists.txt') }}-${{ env.DOWNLOAD_CACHE_VERSION }} restore-keys: | ${{ runner.os }}-ccache- - - # - name: Build (my way) - # run: | - # mkdir build - # cd build - # cmake -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache .. - # make - # cd .. - - 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 run: > cmake -B ${{ steps.strings.outputs.build-output-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} @@ -88,7 +67,6 @@ jobs: - name: Build run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --parallel $(nproc) - - name: Check ~ run : ls -a ~ - name: Check /home/runner/ From 6b4d977dbf86d16a51fe06b9473270eaf2f5a1d5 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 12:45:50 -0500 Subject: [PATCH 25/30] delete prints --- .github/workflows/test.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d949b0f..c27431c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -67,18 +67,10 @@ jobs: - name: Build run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --parallel $(nproc) - - name: Check ~ - run : ls -a ~ - - name: Check /home/runner/ - run : ls -a /home/runner - - name: Find cache - run: find ~ -type d -name ".ccache" - - name: tree cache - run : tree /home/runner/.ccache - - name: ccache config - run: ccache -p - - name: ccache stats - run: ccache -s + - name: Print ccache stats + run: | + ccache -s + ccache -p # - name: Test # working-directory: ${{ steps.strings.outputs.build-output-dir }} From b10e753e2fc8877e351ccdb8581b11b56cdefa6d Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 12:46:15 -0500 Subject: [PATCH 26/30] formatting --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c27431c..45557d5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,7 +46,7 @@ jobs: shell: bash run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - - name: make cache dir + - name: Make cache dir run: mkdir /home/runner/.ccache - name: Cache build artifacts uses: actions/cache@v4 From 36eb08509e57867b5fe843c80acef0b96d7f3b3e Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 12:53:57 -0500 Subject: [PATCH 27/30] try using CC instead of -D --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 45557d5..3c1fd7d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,8 @@ name: test env: + CC: ccache clang + CXX: ccache clang++ DOWNLOAD_CACHE_VERSION: 8 on: @@ -61,8 +63,6 @@ jobs: -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - -D CMAKE_C_COMPILER_LAUNCHER=ccache - -D CMAKE_CXX_COMPILER_LAUNCHER=ccache -S ${{ github.workspace }} - name: Build From bc712053335642d4ca7fb81a8ecb625634bcd9fb Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 13:04:50 -0500 Subject: [PATCH 28/30] Revert "try using CC instead of -D" This reverts commit 36eb08509e57867b5fe843c80acef0b96d7f3b3e. --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3c1fd7d..45557d5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,8 +1,6 @@ name: test env: - CC: ccache clang - CXX: ccache clang++ DOWNLOAD_CACHE_VERSION: 8 on: @@ -63,6 +61,8 @@ jobs: -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -D CMAKE_C_COMPILER_LAUNCHER=ccache + -D CMAKE_CXX_COMPILER_LAUNCHER=ccache -S ${{ github.workspace }} - name: Build From fab01a3e81b18e752c7856ba65d7d4836e29087c Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 13:16:49 -0500 Subject: [PATCH 29/30] delete test files --- NEW_CMakeLists.txt | 7 ------- hello.c | 7 ------- 2 files changed, 14 deletions(-) delete mode 100644 NEW_CMakeLists.txt delete mode 100644 hello.c diff --git a/NEW_CMakeLists.txt b/NEW_CMakeLists.txt deleted file mode 100644 index 7bd9299..0000000 --- a/NEW_CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.10) - -# Project name -project(HelloWorld) - -# Add the executable -add_executable(hello hello.c) diff --git a/hello.c b/hello.c deleted file mode 100644 index 10642f2..0000000 --- a/hello.c +++ /dev/null @@ -1,7 +0,0 @@ -#include - -int main() -{ - printf("hello\n"); - return 0; -} From 45dbe308e6ffbbb6fa5a7b81a175da610cea1a80 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Tue, 31 Dec 2024 13:17:21 -0500 Subject: [PATCH 30/30] delete ccache from local CMakeLists --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 41faf9c..3892072 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,8 +7,6 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") -set(C_COMPILER_LAUNCHER ccache) -set(CXX_COMPILER_LAUNCHER ccache) project(BOX VERSION 0.0.1) if (APPLE)