Rename CMakeLists targets nxt -> dawn
This commit is contained in:
parent
f1ded9bea2
commit
d148aebf3f
|
@ -17,4 +17,4 @@ build_script:
|
||||||
- cmake --build . -- /verbosity:minimal
|
- cmake --build . -- /verbosity:minimal
|
||||||
|
|
||||||
# TODO(cwallez@chromium.org) test on more than Debug.
|
# TODO(cwallez@chromium.org) test on more than Debug.
|
||||||
- Debug\nxt_unittests.exe
|
- Debug\dawn_unittests.exe
|
||||||
|
|
|
@ -69,7 +69,7 @@ script:
|
||||||
- cmake --build .
|
- cmake --build .
|
||||||
|
|
||||||
# Test
|
# Test
|
||||||
- ./nxt_unittests
|
- ./dawn_unittests
|
||||||
|
|
||||||
# Get out of the build dir
|
# Get out of the build dir
|
||||||
- cd ..
|
- cd ..
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.8)
|
cmake_minimum_required(VERSION 2.8)
|
||||||
project(nxt C CXX)
|
project(dawn C CXX)
|
||||||
|
|
||||||
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
|
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
|
||||||
message(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
|
@ -144,7 +144,7 @@ endif()
|
||||||
function(NXTExternalTarget folder target)
|
function(NXTExternalTarget folder target)
|
||||||
set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS ${DAWN_FLAGS})
|
set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS ${DAWN_FLAGS})
|
||||||
set_property(TARGET ${target} APPEND PROPERTY COMPILE_DEFINITIONS ${DAWN_DEFS})
|
set_property(TARGET ${target} APPEND PROPERTY COMPILE_DEFINITIONS ${DAWN_DEFS})
|
||||||
set_property(TARGET ${target} PROPERTY FOLDER "nxt/${folder}")
|
set_property(TARGET ${target} PROPERTY FOLDER "dawn/${folder}")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(NXTInternalTarget folder target)
|
function(NXTInternalTarget folder target)
|
||||||
|
@ -183,25 +183,25 @@ set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
add_subdirectory(generator)
|
add_subdirectory(generator)
|
||||||
|
|
||||||
Generate(
|
Generate(
|
||||||
LIB_NAME nxt
|
LIB_NAME dawn
|
||||||
LIB_TYPE STATIC
|
LIB_TYPE STATIC
|
||||||
PRINT_NAME libNXT
|
PRINT_NAME libNXT
|
||||||
COMMAND_LINE_ARGS
|
COMMAND_LINE_ARGS
|
||||||
${GENERATOR_COMMON_ARGS}
|
${GENERATOR_COMMON_ARGS}
|
||||||
-T nxt
|
-T dawn
|
||||||
)
|
)
|
||||||
target_include_directories(nxt PUBLIC ${GENERATED_DIR})
|
target_include_directories(dawn PUBLIC ${GENERATED_DIR})
|
||||||
|
|
||||||
Generate(
|
Generate(
|
||||||
LIB_NAME nxtcpp
|
LIB_NAME dawncpp
|
||||||
LIB_TYPE STATIC
|
LIB_TYPE STATIC
|
||||||
PRINT_NAME libNXT++
|
PRINT_NAME libNXT++
|
||||||
COMMAND_LINE_ARGS
|
COMMAND_LINE_ARGS
|
||||||
${GENERATOR_COMMON_ARGS}
|
${GENERATOR_COMMON_ARGS}
|
||||||
-T nxtcpp
|
-T dawncpp
|
||||||
)
|
)
|
||||||
target_include_directories(nxtcpp PUBLIC ${GENERATED_DIR} PUBLIC ${INCLUDE_DIR})
|
target_include_directories(dawncpp PUBLIC ${GENERATED_DIR} PUBLIC ${INCLUDE_DIR})
|
||||||
target_link_libraries(nxtcpp nxt)
|
target_link_libraries(dawncpp dawn)
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Call to other CMakeLists.txt
|
# Call to other CMakeLists.txt
|
||||||
|
|
|
@ -16,10 +16,10 @@ add_library(sample_utils
|
||||||
SampleUtils.cpp
|
SampleUtils.cpp
|
||||||
SampleUtils.h
|
SampleUtils.h
|
||||||
)
|
)
|
||||||
target_link_libraries(sample_utils utils nxt_wire)
|
target_link_libraries(sample_utils utils dawn_wire)
|
||||||
NXTInternalTarget("examples" sample_utils)
|
NXTInternalTarget("examples" sample_utils)
|
||||||
|
|
||||||
function(add_nxt_sample target sources)
|
function(add_dawn_sample target sources)
|
||||||
add_executable(${target} ${sources})
|
add_executable(${target} ${sources})
|
||||||
target_link_libraries(${target} sample_utils)
|
target_link_libraries(${target} sample_utils)
|
||||||
target_include_directories(${target} SYSTEM PRIVATE ${GLM_INCLUDE_DIR})
|
target_include_directories(${target} SYSTEM PRIVATE ${GLM_INCLUDE_DIR})
|
||||||
|
@ -44,10 +44,10 @@ function(add_nxt_sample target sources)
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
add_nxt_sample(CHelloTriangle CHelloTriangle.cpp)
|
add_dawn_sample(CHelloTriangle CHelloTriangle.cpp)
|
||||||
add_nxt_sample(CppHelloTriangle CppHelloTriangle.cpp)
|
add_dawn_sample(CppHelloTriangle CppHelloTriangle.cpp)
|
||||||
add_nxt_sample(ComputeBoids ComputeBoids.cpp)
|
add_dawn_sample(ComputeBoids ComputeBoids.cpp)
|
||||||
add_nxt_sample(Animometer Animometer.cpp)
|
add_dawn_sample(Animometer Animometer.cpp)
|
||||||
add_nxt_sample(CubeReflection CubeReflection.cpp)
|
add_dawn_sample(CubeReflection CubeReflection.cpp)
|
||||||
|
|
||||||
add_nxt_sample(glTFViewer glTFViewer/glTFViewer.cpp)
|
add_dawn_sample(glTFViewer glTFViewer/glTFViewer.cpp)
|
||||||
|
|
|
@ -389,13 +389,13 @@ def debug(text):
|
||||||
print(text)
|
print(text)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
targets = ['nxt', 'nxtcpp', 'mock_nxt', 'opengl', 'metal', 'd3d12', 'null', 'wire', 'blink']
|
targets = ['dawn', 'dawncpp', 'mock_dawn', 'opengl', 'metal', 'd3d12', 'null', 'wire', 'blink']
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description = 'Generates code for various target for NXT.',
|
description = 'Generates code for various target for Dawn.',
|
||||||
formatter_class = argparse.ArgumentDefaultsHelpFormatter
|
formatter_class = argparse.ArgumentDefaultsHelpFormatter
|
||||||
)
|
)
|
||||||
parser.add_argument('json', metavar='NXT_JSON', nargs=1, type=str, help ='The NXT JSON definition to use.')
|
parser.add_argument('json', metavar='DAWN_JSON', nargs=1, type=str, help ='The DAWN JSON definition to use.')
|
||||||
parser.add_argument('-t', '--template-dir', default='templates', type=str, help='Directory with template files.')
|
parser.add_argument('-t', '--template-dir', default='templates', type=str, help='Directory with template files.')
|
||||||
parser.add_argument('-o', '--output-dir', default=None, type=str, help='Output directory for the generated source files.')
|
parser.add_argument('-o', '--output-dir', default=None, type=str, help='Output directory for the generated source files.')
|
||||||
parser.add_argument('-T', '--targets', default=None, type=str, help='Comma-separated subset of targets to output. Available targets: ' + ', '.join(targets))
|
parser.add_argument('-T', '--targets', default=None, type=str, help='Comma-separated subset of targets to output. Available targets: ' + ', '.join(targets))
|
||||||
|
@ -438,17 +438,17 @@ def main():
|
||||||
|
|
||||||
c_params = {'native_methods': lambda typ: c_native_methods(api_params['types'], typ)}
|
c_params = {'native_methods': lambda typ: c_native_methods(api_params['types'], typ)}
|
||||||
|
|
||||||
if 'nxt' in targets:
|
if 'dawn' in targets:
|
||||||
renders.append(FileRender('api.h', 'nxt/nxt.h', [base_params, api_params, c_params]))
|
renders.append(FileRender('api.h', 'nxt/nxt.h', [base_params, api_params, c_params]))
|
||||||
renders.append(FileRender('api.c', 'nxt/nxt.c', [base_params, api_params, c_params]))
|
renders.append(FileRender('api.c', 'nxt/nxt.c', [base_params, api_params, c_params]))
|
||||||
|
|
||||||
if 'nxtcpp' in targets:
|
if 'dawncpp' in targets:
|
||||||
additional_params = {'native_methods': lambda typ: cpp_native_methods(api_params['types'], typ)}
|
additional_params = {'native_methods': lambda typ: cpp_native_methods(api_params['types'], typ)}
|
||||||
renders.append(FileRender('apicpp.h', 'nxt/nxtcpp.h', [base_params, api_params, additional_params]))
|
renders.append(FileRender('apicpp.h', 'nxt/nxtcpp.h', [base_params, api_params, additional_params]))
|
||||||
renders.append(FileRender('apicpp.cpp', 'nxt/nxtcpp.cpp', [base_params, api_params, additional_params]))
|
renders.append(FileRender('apicpp.cpp', 'nxt/nxtcpp.cpp', [base_params, api_params, additional_params]))
|
||||||
renders.append(FileRender('apicpp_traits.h', 'nxt/nxtcpp_traits.h', [base_params, api_params, additional_params]))
|
renders.append(FileRender('apicpp_traits.h', 'nxt/nxtcpp_traits.h', [base_params, api_params, additional_params]))
|
||||||
|
|
||||||
if 'mock_nxt' in targets:
|
if 'mock_dawn' in targets:
|
||||||
renders.append(FileRender('mock_api.h', 'mock/mock_nxt.h', [base_params, api_params, c_params]))
|
renders.append(FileRender('mock_api.h', 'mock/mock_nxt.h', [base_params, api_params, c_params]))
|
||||||
renders.append(FileRender('mock_api.cpp', 'mock/mock_nxt.cpp', [base_params, api_params, c_params]))
|
renders.append(FileRender('mock_api.cpp', 'mock/mock_nxt.cpp', [base_params, api_params, c_params]))
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ Generate(
|
||||||
${GENERATOR_COMMON_ARGS}
|
${GENERATOR_COMMON_ARGS}
|
||||||
-T backend_utils
|
-T backend_utils
|
||||||
)
|
)
|
||||||
target_link_libraries(backend_utils_autogen nxtcpp)
|
target_link_libraries(backend_utils_autogen dawncpp)
|
||||||
target_include_directories(backend_utils_autogen PUBLIC ${GENERATED_DIR})
|
target_include_directories(backend_utils_autogen PUBLIC ${GENERATED_DIR})
|
||||||
target_include_directories(backend_utils_autogen PRIVATE ${SRC_DIR})
|
target_include_directories(backend_utils_autogen PRIVATE ${SRC_DIR})
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ function(GenerateProcTable backend)
|
||||||
${GENERATOR_COMMON_ARGS}
|
${GENERATOR_COMMON_ARGS}
|
||||||
-T ${backend}
|
-T ${backend}
|
||||||
)
|
)
|
||||||
target_link_libraries(${backend}_autogen nxtcpp backend_utils_autogen)
|
target_link_libraries(${backend}_autogen dawncpp backend_utils_autogen)
|
||||||
target_include_directories(${backend}_autogen PRIVATE ${SRC_DIR})
|
target_include_directories(${backend}_autogen PRIVATE ${SRC_DIR})
|
||||||
target_include_directories(${backend}_autogen PUBLIC ${GENERATED_DIR})
|
target_include_directories(${backend}_autogen PUBLIC ${GENERATED_DIR})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
@ -388,22 +388,22 @@ list(APPEND BACKEND_SOURCES
|
||||||
${BACKEND_DIR}/ToBackend.h
|
${BACKEND_DIR}/ToBackend.h
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(nxt_backend STATIC ${BACKEND_SOURCES})
|
add_library(dawn_backend STATIC ${BACKEND_SOURCES})
|
||||||
NXTInternalTarget("backend" nxt_backend)
|
NXTInternalTarget("backend" dawn_backend)
|
||||||
target_link_libraries(nxt_backend nxt_common glfw glad spirv_cross)
|
target_link_libraries(dawn_backend dawn_common glfw glad spirv_cross)
|
||||||
|
|
||||||
if (DAWN_ENABLE_D3D12)
|
if (DAWN_ENABLE_D3D12)
|
||||||
target_link_libraries(nxt_backend d3d12_autogen)
|
target_link_libraries(dawn_backend d3d12_autogen)
|
||||||
endif()
|
endif()
|
||||||
if (DAWN_ENABLE_METAL)
|
if (DAWN_ENABLE_METAL)
|
||||||
target_link_libraries(nxt_backend metal_autogen)
|
target_link_libraries(dawn_backend metal_autogen)
|
||||||
endif()
|
endif()
|
||||||
if (DAWN_ENABLE_NULL)
|
if (DAWN_ENABLE_NULL)
|
||||||
target_link_libraries(nxt_backend null_autogen)
|
target_link_libraries(dawn_backend null_autogen)
|
||||||
endif()
|
endif()
|
||||||
if (DAWN_ENABLE_OPENGL)
|
if (DAWN_ENABLE_OPENGL)
|
||||||
target_link_libraries(nxt_backend opengl_autogen)
|
target_link_libraries(dawn_backend opengl_autogen)
|
||||||
endif()
|
endif()
|
||||||
if (DAWN_ENABLE_VULKAN)
|
if (DAWN_ENABLE_VULKAN)
|
||||||
target_link_libraries(nxt_backend vulkan_autogen)
|
target_link_libraries(dawn_backend vulkan_autogen)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -33,6 +33,6 @@ list(APPEND COMMON_SOURCES
|
||||||
${COMMON_DIR}/windows_with_undefs.h
|
${COMMON_DIR}/windows_with_undefs.h
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(nxt_common STATIC ${COMMON_SOURCES})
|
add_library(dawn_common STATIC ${COMMON_SOURCES})
|
||||||
target_include_directories(nxt_common PUBLIC ${SRC_DIR})
|
target_include_directories(dawn_common PUBLIC ${SRC_DIR})
|
||||||
NXTInternalTarget("" nxt_common)
|
NXTInternalTarget("" dawn_common)
|
||||||
|
|
|
@ -13,16 +13,16 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
Generate(
|
Generate(
|
||||||
LIB_NAME mock_nxt
|
LIB_NAME mock_dawn
|
||||||
LIB_TYPE STATIC
|
LIB_TYPE STATIC
|
||||||
FOLDER "tests"
|
FOLDER "tests"
|
||||||
PRINT_NAME libMockNXT
|
PRINT_NAME libMockNXT
|
||||||
COMMAND_LINE_ARGS
|
COMMAND_LINE_ARGS
|
||||||
${GENERATOR_COMMON_ARGS}
|
${GENERATOR_COMMON_ARGS}
|
||||||
-T mock_nxt
|
-T mock_dawn
|
||||||
)
|
)
|
||||||
target_include_directories(mock_nxt PUBLIC ${GENERATED_DIR})
|
target_include_directories(mock_dawn PUBLIC ${GENERATED_DIR})
|
||||||
target_link_libraries(mock_nxt nxt gtest)
|
target_link_libraries(mock_dawn dawn gtest)
|
||||||
|
|
||||||
set(TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
set(TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
set(UNITTESTS_DIR ${TESTS_DIR}/unittests)
|
set(UNITTESTS_DIR ${TESTS_DIR}/unittests)
|
||||||
|
@ -66,11 +66,11 @@ if (DAWN_ENABLE_D3D12)
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(nxt_unittests ${UNITTEST_SOURCES})
|
add_executable(dawn_unittests ${UNITTEST_SOURCES})
|
||||||
target_link_libraries(nxt_unittests nxt_common gtest nxt_backend mock_nxt nxt_wire utils)
|
target_link_libraries(dawn_unittests dawn_common gtest dawn_backend mock_dawn dawn_wire utils)
|
||||||
NXTInternalTarget("tests" nxt_unittests)
|
NXTInternalTarget("tests" dawn_unittests)
|
||||||
|
|
||||||
add_executable(nxt_end2end_tests
|
add_executable(dawn_end2end_tests
|
||||||
${END2END_TESTS_DIR}/BasicTests.cpp
|
${END2END_TESTS_DIR}/BasicTests.cpp
|
||||||
${END2END_TESTS_DIR}/BufferTests.cpp
|
${END2END_TESTS_DIR}/BufferTests.cpp
|
||||||
${END2END_TESTS_DIR}/BlendStateTests.cpp
|
${END2END_TESTS_DIR}/BlendStateTests.cpp
|
||||||
|
@ -90,5 +90,5 @@ add_executable(nxt_end2end_tests
|
||||||
${TESTS_DIR}/NXTTest.cpp
|
${TESTS_DIR}/NXTTest.cpp
|
||||||
${TESTS_DIR}/NXTTest.h
|
${TESTS_DIR}/NXTTest.h
|
||||||
)
|
)
|
||||||
target_link_libraries(nxt_end2end_tests nxt_common nxt_wire gtest utils)
|
target_link_libraries(dawn_end2end_tests dawn_common dawn_wire gtest utils)
|
||||||
NXTInternalTarget("tests" nxt_end2end_tests)
|
NXTInternalTarget("tests" dawn_end2end_tests)
|
||||||
|
|
|
@ -54,7 +54,7 @@ if (DAWN_ENABLE_VULKAN)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(utils STATIC ${UTILS_SOURCES})
|
add_library(utils STATIC ${UTILS_SOURCES})
|
||||||
target_link_libraries(utils nxt_backend shaderc_shared nxtcpp nxt)
|
target_link_libraries(utils dawn_backend shaderc_shared dawncpp dawn)
|
||||||
target_include_directories(utils PUBLIC ${SRC_DIR})
|
target_include_directories(utils PUBLIC ${SRC_DIR})
|
||||||
NXTInternalTarget("" utils)
|
NXTInternalTarget("" utils)
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
|
|
|
@ -20,7 +20,7 @@ Generate(
|
||||||
LIB_TYPE STATIC
|
LIB_TYPE STATIC
|
||||||
FOLDER "wire"
|
FOLDER "wire"
|
||||||
PRINT_NAME "Wire serialization/deserialization autogenerated files"
|
PRINT_NAME "Wire serialization/deserialization autogenerated files"
|
||||||
EXTRA_DEPS nxt
|
EXTRA_DEPS dawn
|
||||||
COMMAND_LINE_ARGS
|
COMMAND_LINE_ARGS
|
||||||
${GENERATOR_COMMON_ARGS}
|
${GENERATOR_COMMON_ARGS}
|
||||||
-T wire
|
-T wire
|
||||||
|
@ -29,12 +29,12 @@ Generate(
|
||||||
)
|
)
|
||||||
target_include_directories(wire_autogen PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
target_include_directories(wire_autogen PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
target_include_directories(wire_autogen PUBLIC ${GENERATED_DIR})
|
target_include_directories(wire_autogen PUBLIC ${GENERATED_DIR})
|
||||||
target_link_libraries(wire_autogen nxt nxt_common)
|
target_link_libraries(wire_autogen dawn dawn_common)
|
||||||
|
|
||||||
add_library(nxt_wire STATIC
|
add_library(dawn_wire STATIC
|
||||||
${WIRE_DIR}/TerribleCommandBuffer.cpp
|
${WIRE_DIR}/TerribleCommandBuffer.cpp
|
||||||
${WIRE_DIR}/TerribleCommandBuffer.h
|
${WIRE_DIR}/TerribleCommandBuffer.h
|
||||||
${WIRE_DIR}/Wire.h
|
${WIRE_DIR}/Wire.h
|
||||||
)
|
)
|
||||||
target_link_libraries(nxt_wire wire_autogen)
|
target_link_libraries(dawn_wire wire_autogen)
|
||||||
NXTInternalTarget("wire" nxt_wire)
|
NXTInternalTarget("wire" dawn_wire)
|
||||||
|
|
Loading…
Reference in New Issue