diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 725427c9..4a3d8439 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -14,5 +14,5 @@ jobs: submodules: recursive - uses: ./.github/actions/windows-build with: - config: debug + config: debug-msvc GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/CMakePresets.json b/CMakePresets.json index e19d2ba4..3fd0e5db 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -30,7 +30,21 @@ "installDir": "${sourceDir}/out/debug", "inherits": [ "base" ], "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug" + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_C_COMPILER": "clang-cl", + "CMAKE_CXX_COMPILER": "clang-cl" + } + }, + { + "name": "debug-msvc", + "displayName": "Debug (MSVC)", + "binaryDir": "${sourceDir}/build/debug-msvc", + "installDir": "${sourceDir}/out/debug-msvc", + "inherits": [ "base" ], + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_C_COMPILER": "cl", + "CMAKE_CXX_COMPILER": "cl" } }, { @@ -40,7 +54,9 @@ "installDir": "${sourceDir}/out/release", "inherits": [ "base" ], "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release" + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_C_COMPILER": "cl", + "CMAKE_CXX_COMPILER": "cl" } } ], @@ -49,6 +65,10 @@ "name": "debug", "configurePreset": "debug" }, + { + "name": "debug-msvc", + "configurePreset": "debug-msvc" + }, { "name": "release", "configurePreset": "release" diff --git a/swiftwinrt/CMakeLists.txt b/swiftwinrt/CMakeLists.txt index 43ba8a5f..5254597b 100644 --- a/swiftwinrt/CMakeLists.txt +++ b/swiftwinrt/CMakeLists.txt @@ -1,8 +1,5 @@ project(swiftwinrt) -set(CMAKE_C_COMPILER cl) -set(CMAKE_CXX_COMPILER cl) - set(SWIFTWINRT_VERSION_STRING "0.0.1") set(MicrosoftWindowsWinMD_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/winmd/src) diff --git a/tests/test_component/cpp/CMakeLists.txt b/tests/test_component/cpp/CMakeLists.txt index 1f77f261..370ae6f8 100644 --- a/tests/test_component/cpp/CMakeLists.txt +++ b/tests/test_component/cpp/CMakeLists.txt @@ -1,19 +1,6 @@ project(test_component_cpp) include(nuget) -# For debug builds, build with clang which enables us to use DWARF symbols -# and debug both Swift and C++ code using lldb. -if (${CMAKE_BUILD_TYPE} STREQUAL "DEBUG") - set(CMAKE_C_COMPILER clang-cl) - set(CMAKE_CXX_COMPILER clang-cl) -else() - # For release builds don't use clang because the C++/WinRT generated code doesn't compile. - # It's not immediately clear if this is an issue with C++/WinRT or the compilation flags - # being used. But we are only using clang in debug builds to make debugging easier, so - # using this little hack for now. - set(CMAKE_C_COMPILER cl) - set(CMAKE_CXX_COMPILER cl) -endif() set(H_FILE ${CMAKE_TEST_COMPONENT_OUTPUT}/test_component.h )