Skip to content

Commit

Permalink
Set compilers in CMake before calling project()
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanlabelle authored Mar 29, 2024
1 parent 4332d52 commit 3af1401
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions swiftwinrt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
project(swiftwinrt)

# Set pre-project() cache variables
set(CMAKE_C_COMPILER cl)
set(CMAKE_CXX_COMPILER cl)

project(swiftwinrt)

set(SWIFTWINRT_VERSION_STRING "0.0.1")
set(MicrosoftWindowsWinMD_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/winmd/src)

Expand Down
9 changes: 6 additions & 3 deletions tests/test_component/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
project(test_component_cpp)
include(nuget)

# Set pre-project() cache variables
# 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")
Expand All @@ -14,6 +12,11 @@ else()
set(CMAKE_C_COMPILER cl)
set(CMAKE_CXX_COMPILER cl)
endif()

project(test_component_cpp)
include(nuget)


set(H_FILE
${CMAKE_TEST_COMPONENT_OUTPUT}/test_component.h
)
Expand Down

0 comments on commit 3af1401

Please sign in to comment.