CMakeLists: Generate Dawn headers separately from libdawn

libdawn will be one of the libraries produced but other libraries like
libdawn_native don't need to link against it. However they do need the
Dawn headers so we generate them separately.

This also makes all internal targets depend on the header generation and
have the include directories necessary for those headers.

Also has a small fix for setting compile flags only for C++ files.
This commit is contained in:
Corentin Wallez
2018-07-24 16:25:38 +02:00
committed by Corentin Wallez
parent deb5d33643
commit 6c27fd9c94
7 changed files with 58 additions and 46 deletions

View File

@@ -21,8 +21,7 @@ Generate(
${GENERATOR_COMMON_ARGS}
-T mock_dawn
)
target_include_directories(mock_dawn PUBLIC ${GENERATED_DIR})
target_link_libraries(mock_dawn dawn gtest)
target_link_libraries(mock_dawn gtest)
set(TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(UNITTESTS_DIR ${TESTS_DIR}/unittests)
@@ -67,7 +66,7 @@ if (DAWN_ENABLE_D3D12)
endif()
add_executable(dawn_unittests ${UNITTEST_SOURCES})
target_link_libraries(dawn_unittests dawn_common gtest lib_dawn_native mock_dawn dawn_wire utils)
target_link_libraries(dawn_unittests dawn_common gtest libdawn_native mock_dawn dawn_wire utils)
DawnInternalTarget("tests" dawn_unittests)
add_executable(dawn_end2end_tests