diff --git a/.github/workflows/cpp-tests.yml b/.github/workflows/cpp-tests.yml index c57e9276..ecc3b91f 100644 --- a/.github/workflows/cpp-tests.yml +++ b/.github/workflows/cpp-tests.yml @@ -27,7 +27,7 @@ jobs: uses: microsoft/setup-msbuild@v2 - name: CMake - run: cmake -S ${{env.SOURCE_DIR}} -B ${{env.BUILD_DIR}} -A x64 -DBUILD_TESTING=ON + run: cmake -S ${{env.SOURCE_DIR}} -B ${{env.BUILD_DIR}} -A x64 -DBUILD_TESTING=ON -DBUILD_TOOLS=OFF - name: Build run: cmake --build ${{env.BUILD_DIR}} --config RelWithDebInfo diff --git a/Sources/backend-cpp/CMakeLists.txt b/Sources/backend-cpp/CMakeLists.txt index 64ceba49..774c3122 100644 --- a/Sources/backend-cpp/CMakeLists.txt +++ b/Sources/backend-cpp/CMakeLists.txt @@ -43,12 +43,17 @@ if(BUILD_TESTING) DOWNLOAD_EXTRACT_TIMESTAMP TRUE ) - # For Windows: Prevent overriding the parent project's compiler/linker settings + # For Windows: Prevent overriding parent project's compiler/linker settings set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) FetchContent_MakeAvailable(googletest) endif() +# Tools +if(BUILD_TOOLS) + add_subdirectory(Tools) +endif() + # Libraries add_subdirectory(Vendor) add_subdirectory(Utilities) diff --git a/Sources/backend-cpp/Tools/CMakeLists.txt b/Sources/backend-cpp/Tools/CMakeLists.txt new file mode 100644 index 00000000..6532af0e --- /dev/null +++ b/Sources/backend-cpp/Tools/CMakeLists.txt @@ -0,0 +1,13 @@ +add_executable(SocketTester) + +target_sources(SocketTester PRIVATE SocketTester.cpp) + +target_link_libraries(SocketTester PRIVATE Utilities) + +target_compile_definitions(SocketTester PRIVATE _CONSOLE) + +# Output Directory +set_target_properties( + SocketTester + PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/SocketTester_bin" +) diff --git a/Tools/SocketTester/SocketTester.cpp b/Sources/backend-cpp/Tools/SocketTester.cpp similarity index 100% rename from Tools/SocketTester/SocketTester.cpp rename to Sources/backend-cpp/Tools/SocketTester.cpp diff --git a/Tools/SocketTester/SocketTester.vcxproj b/Tools/SocketTester/SocketTester.vcxproj deleted file mode 100644 index 58bc4b08..00000000 --- a/Tools/SocketTester/SocketTester.vcxproj +++ /dev/null @@ -1,196 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - Win32Proj - {58185760-bdc0-434c-ab8f-f6af34a72714} - SocketTester - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - $(ProjectDir)bin\ - $(SolutionDir)$(Platform)\$(Configuration)\obj\$(ProjectName)\ - $(SolutionDir)..\;$(IncludePath) - - - false - $(ProjectDir)bin\ - $(SolutionDir)$(Platform)\$(Configuration)\obj\$(ProjectName)\ - $(SolutionDir)..\;$(IncludePath) - - - true - $(SolutionDir)$(Platform)\$(Configuration)\obj\$(ProjectName)\ - $(SolutionDir)..\;$(IncludePath) - $(ProjectDir)bin\ - - - false - $(SolutionDir)$(Platform)\$(Configuration)\obj\$(ProjectName)\ - $(SolutionDir)..\;$(IncludePath) - $(ProjectDir)bin\ - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - stdcpp17 - - - Console - true - UseLinkTimeCodeGeneration - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - stdcpp17 - - - Console - true - true - true - UseLinkTimeCodeGeneration - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - stdcpp17 - - - Console - true - UseLinkTimeCodeGeneration - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - stdcpp17 - - - Console - true - true - true - UseLinkTimeCodeGeneration - - - - - - - - - - AddWildCardItems - $(ComputeCompileInputsTargets) - - - - <_WildCardClCompile Include="*.cpp" /> - - - <_WildCardClInclude Include="*.h" /> - - - - {329f64ac-6346-46d2-a671-9b5dd626b485} - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - \ No newline at end of file diff --git a/Tools/SocketTester/bin/SocketTester.exe b/Tools/SocketTester/bin/SocketTester.exe deleted file mode 100644 index fb998704..00000000 Binary files a/Tools/SocketTester/bin/SocketTester.exe and /dev/null differ diff --git a/Tools/SocketTester/bin/lua.dll b/Tools/SocketTester/bin/lua.dll deleted file mode 100644 index 82c1e7b2..00000000 Binary files a/Tools/SocketTester/bin/lua.dll and /dev/null differ diff --git a/Tools/SocketTester/packages.config b/Tools/SocketTester/packages.config deleted file mode 100644 index be1fa037..00000000 --- a/Tools/SocketTester/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Tools/build_plugin.bat b/Tools/build_plugin.bat index 25719984..41ee9118 100644 --- a/Tools/build_plugin.bat +++ b/Tools/build_plugin.bat @@ -1,3 +1,5 @@ +@echo off + :: Build script for streamdeck-dcs. :: Instructions: You must call this file from the "Developer Command Prompt for VS" :: For details see https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line @@ -6,12 +8,12 @@ cd /D "%~dp0"\.. :: Build C++ executable: -cmake -S ./Sources/backend-cpp -B ./Sources/backend-cpp/build +cmake -S ./Sources/backend-cpp -B ./Sources/backend-cpp/build -DBUILD_TESTING=ON -DBUILD_TOOLS=OFF cmake --build ./Sources/backend-cpp/build --config Release if %errorlevel% neq 0 echo "Canceling plugin build due to failed backend build" && pause && exit /b %errorlevel% :: Run unit tests, only continue if all tests pass -ctest --test-dir ./Sources/backend-cpp/build --output-on-failure +ctest --test-dir ./Sources/backend-cpp/build --output-on-failure --progress if %errorlevel% neq 0 echo "Canceling plugin build due to failed unit tests" && pause && exit /b %errorlevel% :: Copy C++ executable and DLLs to StreamDeck Plugin package: