Rename NXT -> Dawn in the rest of CMakeLists
This commit is contained in:
parent
f684040e0a
commit
fde3f2b5e0
|
@ -92,7 +92,7 @@ if (WIN32)
|
|||
list(APPEND DAWN_DEFS "NOMINMAX")
|
||||
# Avoid Windows.h including a lot of headers
|
||||
list(APPEND DAWN_DEFS "WIN32_LEAN_AND_MEAN")
|
||||
# Remove compile error where the mock NXT creates too many sections for the old obj format.
|
||||
# Remove compile error where the mock Dawn creates too many sections for the old obj format.
|
||||
list(APPEND DAWN_FLAGS "/bigobj")
|
||||
endif()
|
||||
|
||||
|
@ -100,7 +100,7 @@ if (MSVC)
|
|||
list(APPEND DAWN_FLAGS "/std:c++14")
|
||||
list(APPEND DAWN_FLAGS "/EHsc")
|
||||
list(APPEND DAWN_INTERNAL_FLAGS "/W4")
|
||||
# Allow declarations hiding members as it is used all over NXT
|
||||
# Allow declarations hiding members as it is used all over Dawn
|
||||
list(APPEND DAWN_INTERNAL_FLAGS "/wd4458")
|
||||
list(APPEND DAWN_INTERNAL_FLAGS "/wd4996") # Allow deprecated functions like strncpy
|
||||
|
||||
|
@ -141,14 +141,14 @@ else()
|
|||
endif()
|
||||
endif()
|
||||
|
||||
function(NXTExternalTarget folder target)
|
||||
function(DawnExternalTarget folder target)
|
||||
set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS ${DAWN_FLAGS})
|
||||
set_property(TARGET ${target} APPEND PROPERTY COMPILE_DEFINITIONS ${DAWN_DEFS})
|
||||
set_property(TARGET ${target} PROPERTY FOLDER "dawn/${folder}")
|
||||
endfunction()
|
||||
|
||||
function(NXTInternalTarget folder target)
|
||||
NXTExternalTarget("${folder}" ${target})
|
||||
function(DawnInternalTarget folder target)
|
||||
DawnExternalTarget("${folder}" ${target})
|
||||
set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS ${DAWN_INTERNAL_FLAGS})
|
||||
set_property(TARGET ${target} APPEND PROPERTY COMPILE_DEFINITIONS ${DAWN_INTERNAL_DEFS})
|
||||
|
||||
|
@ -174,7 +174,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
|||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
|
||||
################################################################################
|
||||
# Generate the C and C++ NXT APIs
|
||||
# Generate the C and C++ Dawn APIs
|
||||
################################################################################
|
||||
|
||||
set(INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/include)
|
||||
|
@ -185,7 +185,7 @@ add_subdirectory(generator)
|
|||
Generate(
|
||||
LIB_NAME dawn
|
||||
LIB_TYPE STATIC
|
||||
PRINT_NAME libNXT
|
||||
PRINT_NAME libDawn
|
||||
COMMAND_LINE_ARGS
|
||||
${GENERATOR_COMMON_ARGS}
|
||||
-T dawn
|
||||
|
@ -195,7 +195,7 @@ target_include_directories(dawn PUBLIC ${GENERATED_DIR})
|
|||
Generate(
|
||||
LIB_NAME dawncpp
|
||||
LIB_TYPE STATIC
|
||||
PRINT_NAME libNXT++
|
||||
PRINT_NAME libDawn++
|
||||
COMMAND_LINE_ARGS
|
||||
${GENERATOR_COMMON_ARGS}
|
||||
-T dawncpp
|
||||
|
|
|
@ -17,14 +17,14 @@ add_library(sample_utils
|
|||
SampleUtils.h
|
||||
)
|
||||
target_link_libraries(sample_utils utils dawn_wire)
|
||||
NXTInternalTarget("examples" sample_utils)
|
||||
DawnInternalTarget("examples" sample_utils)
|
||||
|
||||
function(add_dawn_sample target sources)
|
||||
add_executable(${target} ${sources})
|
||||
target_link_libraries(${target} sample_utils)
|
||||
target_include_directories(${target} SYSTEM PRIVATE ${GLM_INCLUDE_DIR})
|
||||
target_include_directories(${target} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
NXTInternalTarget("examples" ${target})
|
||||
DawnInternalTarget("examples" ${target})
|
||||
|
||||
# Suppress some warnings in our sample dependencies
|
||||
if (MSVC)
|
||||
|
|
|
@ -61,7 +61,7 @@ function(Generate)
|
|||
${OUTPUTS}
|
||||
)
|
||||
|
||||
NXTInternalTarget("${G_FOLDER}" ${G_LIB_NAME})
|
||||
DawnInternalTarget("${G_FOLDER}" ${G_LIB_NAME})
|
||||
set_property(TARGET ${G_LIB_NAME} APPEND PROPERTY COMPILE_OPTIONS ${DAWN_GENERATED_FLAGS})
|
||||
endfunction()
|
||||
|
||||
|
|
|
@ -389,7 +389,7 @@ list(APPEND BACKEND_SOURCES
|
|||
)
|
||||
|
||||
add_library(dawn_backend STATIC ${BACKEND_SOURCES})
|
||||
NXTInternalTarget("backend" dawn_backend)
|
||||
DawnInternalTarget("backend" dawn_backend)
|
||||
target_link_libraries(dawn_backend dawn_common glfw glad spirv_cross)
|
||||
|
||||
if (DAWN_ENABLE_D3D12)
|
||||
|
|
|
@ -35,4 +35,4 @@ list(APPEND COMMON_SOURCES
|
|||
|
||||
add_library(dawn_common STATIC ${COMMON_SOURCES})
|
||||
target_include_directories(dawn_common PUBLIC ${SRC_DIR})
|
||||
NXTInternalTarget("" dawn_common)
|
||||
DawnInternalTarget("" dawn_common)
|
||||
|
|
|
@ -16,7 +16,7 @@ Generate(
|
|||
LIB_NAME mock_dawn
|
||||
LIB_TYPE STATIC
|
||||
FOLDER "tests"
|
||||
PRINT_NAME libMockNXT
|
||||
PRINT_NAME libMockDawn
|
||||
COMMAND_LINE_ARGS
|
||||
${GENERATOR_COMMON_ARGS}
|
||||
-T mock_dawn
|
||||
|
@ -68,7 +68,7 @@ endif()
|
|||
|
||||
add_executable(dawn_unittests ${UNITTEST_SOURCES})
|
||||
target_link_libraries(dawn_unittests dawn_common gtest dawn_backend mock_dawn dawn_wire utils)
|
||||
NXTInternalTarget("tests" dawn_unittests)
|
||||
DawnInternalTarget("tests" dawn_unittests)
|
||||
|
||||
add_executable(dawn_end2end_tests
|
||||
${END2END_TESTS_DIR}/BasicTests.cpp
|
||||
|
@ -91,4 +91,4 @@ add_executable(dawn_end2end_tests
|
|||
${TESTS_DIR}/NXTTest.h
|
||||
)
|
||||
target_link_libraries(dawn_end2end_tests dawn_common dawn_wire gtest utils)
|
||||
NXTInternalTarget("tests" dawn_end2end_tests)
|
||||
DawnInternalTarget("tests" dawn_end2end_tests)
|
||||
|
|
|
@ -56,7 +56,7 @@ endif()
|
|||
add_library(utils STATIC ${UTILS_SOURCES})
|
||||
target_link_libraries(utils dawn_backend shaderc_shared dawncpp dawn)
|
||||
target_include_directories(utils PUBLIC ${SRC_DIR})
|
||||
NXTInternalTarget("" utils)
|
||||
DawnInternalTarget("" utils)
|
||||
if(NOT MSVC)
|
||||
# allow C-style casts -- for shaderc
|
||||
set_property(TARGET utils APPEND PROPERTY COMPILE_OPTIONS "-Wno-old-style-cast")
|
||||
|
|
|
@ -37,4 +37,4 @@ add_library(dawn_wire STATIC
|
|||
${WIRE_DIR}/Wire.h
|
||||
)
|
||||
target_link_libraries(dawn_wire wire_autogen)
|
||||
NXTInternalTarget("wire" dawn_wire)
|
||||
DawnInternalTarget("wire" dawn_wire)
|
||||
|
|
|
@ -18,7 +18,7 @@ set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
|||
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||
set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
|
||||
add_subdirectory(glfw)
|
||||
NXTExternalTarget("third_party" glfw)
|
||||
DawnExternalTarget("third_party" glfw)
|
||||
|
||||
# GoogleTest
|
||||
set(GTEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/googletest/googletest)
|
||||
|
@ -28,7 +28,7 @@ target_include_directories(gtest SYSTEM PUBLIC ${GTEST_DIR}/include ${GMOCK_DIR}
|
|||
target_include_directories(gtest SYSTEM PRIVATE ${GTEST_DIR} ${GMOCK_DIR})
|
||||
find_package(Threads)
|
||||
target_link_libraries(gtest ${CMAKE_THREAD_LIBS_INIT})
|
||||
NXTExternalTarget("third_party" gtest)
|
||||
DawnExternalTarget("third_party" gtest)
|
||||
|
||||
# Glad
|
||||
add_library(glad STATIC
|
||||
|
@ -37,7 +37,7 @@ add_library(glad STATIC
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/glad/include/KHR/khrplatform.h
|
||||
)
|
||||
target_include_directories(glad SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/glad/include)
|
||||
NXTExternalTarget("third_party" glad)
|
||||
DawnExternalTarget("third_party" glad)
|
||||
|
||||
# ShaderC
|
||||
# Prevent SPIRV-Tools from using Werror as it has a warning on MSVC
|
||||
|
@ -130,7 +130,7 @@ endif()
|
|||
|
||||
add_library(spirv_cross STATIC ${SPIRV_CROSS_SOURCES})
|
||||
target_include_directories(spirv_cross SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
NXTExternalTarget("third_party" spirv_cross)
|
||||
DawnExternalTarget("third_party" spirv_cross)
|
||||
|
||||
# STB, used for stb_image
|
||||
set(STB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/stb PARENT_SCOPE)
|
||||
|
|
Loading…
Reference in New Issue