diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5580bd37b..1323ca472 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-latest, ubuntu-latest, macos-latest] + os: [windows-latest, ubuntu-20.04, macos-latest] qt-version: [5.15.2, 5.12.10] build-system: [qmake, cmake] fail-fast: false @@ -53,31 +53,29 @@ jobs: if: startsWith(matrix.os, 'windows') uses: actions/cache@v2.1.4 with: - key: ${{ runner.os }}-conan-root-${{ hashFiles('**/conanfile-qmake.txt') }} + key: ${{ runner.os }}-conan-root-${{ hashFiles('**/conanfile.txt') }} path: ~/.conan - name: Cache conan packages if: startsWith(matrix.os, 'windows') uses: actions/cache@v2.1.4 with: - key: ${{ runner.os }}-conan-pkg-${{ hashFiles('**/conanfile-qmake.txt') }} + key: ${{ runner.os }}-conan-pkg-${{ hashFiles('**/conanfile.txt') }} path: C:/.conan/ - name: Install dependencies (Windows) if: startsWith(matrix.os, 'windows') - run: | - choco install conan jom -y - - refreshenv + run: choco install conan jom -y shell: cmd - name: Build (Windows) if: startsWith(matrix.os, 'windows') && matrix.build-system == 'qmake' run: | call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + SET PATH=%PATH%;C:\Program Files\Conan\conan\ mkdir build cd build - "C:\Program Files\Conan\conan\conan.exe" install ..\conanfile-qmake.txt + conan install ..\conanfile-qmake.txt qmake .. jom windeployqt release/chatterino.exe --release --no-compiler-runtime --no-translations --no-opengl-sw --dir Chatterino2/ @@ -90,15 +88,14 @@ jobs: if: startsWith(matrix.os, 'windows') && matrix.build-system == 'cmake' run: | call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + SET PATH=%PATH%;C:\Program Files\Conan\conan\ mkdir build cd build - "C:\Program Files\Conan\conan\conan.exe" install ..\conanfile-qmake.txt - cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release .. - nmake - windeployqt release/chatterino.exe --release --no-compiler-runtime --no-translations --no-opengl-sw --dir Chatterino2/ - cp release/chatterino.exe Chatterino2/ - echo nightly > Chatterino2/modes - 7z a chatterino-windows-x86-64.zip Chatterino2/ + cmake -G"NMake Makefiles JOM" -DCMAKE_BUILD_TYPE=Release -DUSE_PACKAGE_MANAGER=ON .. + jom + jom copy_dll + echo nightly > bin/modes + 7z a chatterino-windows-x86-64.zip bin/ shell: cmd - name: Upload artifact (Windows) @@ -115,6 +112,8 @@ jobs: sudo apt-get update sudo apt-get -y install \ cmake \ + virtualenv \ + rapidjson-dev \ libssl-dev \ libboost-dev \ libboost-system-dev \ @@ -144,7 +143,7 @@ jobs: run: | mkdir build cd build - cmake -DCMAKE_INSTALL_PREFIX=/usr .. + cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DUSE_PACKAGE_MANAGER=ON .. make -j8 shell: bash @@ -183,7 +182,7 @@ jobs: run: | mkdir build cd build - cmake .. + cmake -DCMAKE_BUILD_TYPE=Release -DUSE_PACKAGE_MANAGER=ON .. make -j8 shell: bash diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index deebbe8f6..c64fccaf0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,10 +49,10 @@ jobs: - name: Install dependencies (Ubuntu) if: startsWith(matrix.os, 'ubuntu') run: | - curl "https://raw.githubusercontent.com/AnotherFoxGuy/ci-scripts/main/install-conan.sh" | sudo bash sudo apt-get update sudo apt-get -y install \ cmake \ + virtualenv \ rapidjson-dev \ libssl-dev \ libboost-dev \ @@ -75,9 +75,6 @@ jobs: run: mkdir build-test shell: bash - - name: Add conan pkgs - run: cmake -P conan-pkgs/add_conan_pkgs.cmake - - name: Build (Ubuntu) if: startsWith(matrix.os, 'ubuntu') run: | @@ -88,8 +85,7 @@ jobs: - name: Test (Ubuntu) if: startsWith(matrix.os, 'ubuntu') - run: | - ./chatterino-test --platform minimal + run: ./bin/chatterino-test --platform minimal working-directory: build-test shell: bash diff --git a/CMakeLists.txt b/CMakeLists.txt index e67dd71a2..d7bcf4198 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ endif() if (USE_PACKAGE_MANAGER) include(pmm) - pmm(CONAN) + pmm(CONAN REMOTES anotherfoxguy-artifactory https://anotherfoxguy.jfrog.io/artifactory/api/conan/chatterino) else (USE_PACKAGE_MANAGER) set(CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/dependencies" CACHE PATH "Path to the dependencies") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 73751c249..a50e3a653 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -219,8 +219,11 @@ generate_source_groups(${SOURCE_FILES}) add_executable(${PROJECT_NAME} ${SOURCE_FILES}) -target_compile_definitions(${PROJECT_NAME} PRIVATE CMAKE_BUILD CHATTERINO UNICODE USEWINSDK AB_CUSTOM_THEME AB_CUSTOM_SETTINGS IRC_STATIC IRC_NAMESPACE=Communi) +target_compile_definitions(${PROJECT_NAME} PRIVATE CMAKE_BUILD CHATTERINO UNICODE AB_CUSTOM_THEME AB_CUSTOM_SETTINGS IRC_STATIC IRC_NAMESPACE=Communi) target_compile_definitions(${PROJECT_NAME} PRIVATE CHATTERINO_GIT_HASH=\"XD\" CHATTERINO_GIT_RELEASE=\"XD\" CHATTERINO_GIT_COMMIT=\"XD\") +if (WIN32) + target_compile_definitions(${PROJECT_NAME} PRIVATE USEWINSDK) +endif () target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/common/Credentials.cpp b/src/common/Credentials.cpp index a7ba22414..28ac985c4 100644 --- a/src/common/Credentials.cpp +++ b/src/common/Credentials.cpp @@ -7,12 +7,10 @@ #include "util/Overloaded.hpp" #ifdef CMAKE_BUILD -#include "qt5keychain/keychain.h" +# include "qt5keychain/keychain.h" #else -#include "keychain.h" +# include "keychain.h" #endif - - #include #include diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 558a0f496..f20ae40d9 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,6 +1,6 @@ include(GoogleTest) -project(chatterino-tests) +project(chatterino-test) set(main_dir ${CMAKE_SOURCE_DIR}/src) @@ -62,8 +62,10 @@ else () ) endif () -target_compile_definitions(${PROJECT_NAME} PRIVATE CHATTERINO CHATTERINO_TEST UNICODE USEWINSDK AB_CUSTOM_THEME AB_CUSTOM_SETTINGS IRC_STATIC IRC_NAMESPACE=Communi) +target_compile_definitions(${PROJECT_NAME} PRIVATE CHATTERINO CHATTERINO_TEST UNICODE AB_CUSTOM_THEME AB_CUSTOM_SETTINGS IRC_STATIC IRC_NAMESPACE=Communi) target_compile_definitions(${PROJECT_NAME} PRIVATE CHATTERINO_GIT_HASH=\"XD\" CHATTERINO_GIT_RELEASE=\"XD\" CHATTERINO_GIT_COMMIT=\"XD\") - +if (WIN32) + target_compile_definitions(${PROJECT_NAME} PRIVATE USEWINSDK) +endif () #gtest_discover_tests(${PROJECT_NAME}) \ No newline at end of file