Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document and improve the usage of wsl/winadapter.h and wsl/wrladapter.h #113

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(DirectX-Headers
VERSION 1.611.1
)
include(CTest)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
enable_testing()
Expand Down Expand Up @@ -53,12 +53,6 @@ if (NOT WIN32)
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/wsl/stubs>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/wsl/stubs>"
)
elseif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
# MinGW has RPC headers which define old versions, and complain if D3D
# headers are included before the RPC headers, since D3D headers were
# generated with new MIDL and "require" new RPC headers.
target_compile_options(DirectX-Headers PRIVATE "-D__REQUIRED_RPCNDR_H_VERSION__=475")
target_compile_options(DirectX-Guids PRIVATE "-D__REQUIRED_RPCNDR_H_VERSION__=475")
endif()

if (DXHEADERS_INSTALL)
Expand Down Expand Up @@ -89,12 +83,12 @@ if (DXHEADERS_INSTALL)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/directx-headers-config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/directx-headers-config-version.cmake"
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/directx-headers/cmake)
# Create pkg-config file

# Create pkg-config file
include(cmake/JoinPaths.cmake)
# from: https://github.com/jtojnar/cmake-snips#concatenating-paths-when-building-pkg-config-files
join_paths(DIRECTX_INCLUDEDIR_FOR_PKG_CONFIG "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}")
join_paths(DIRECTX_LIBDIR_FOR_PKG_CONFIG "\${prefix}" "${CMAKE_INSTALL_LIBDIR}")
join_paths(DIRECTX_LIBDIR_FOR_PKG_CONFIG "\${prefix}" "${CMAKE_INSTALL_LIBDIR}")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/DirectX-Headers.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/DirectX-Headers.pc" @ONLY)
Expand All @@ -107,7 +101,7 @@ endif()

if (BUILD_TESTING)
if (DXHEADERS_BUILD_TEST)
add_subdirectory(test)
add_subdirectory(test)
endif()

if (DXHEADERS_BUILD_GOOGLE_TEST)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Make sure that you visit the [DirectX Landing Page](https://devblogs.microsoft.c

## Use on Windows

Note that these headers may conflict with the headers from the Windows SDK, depending on include ordering. These headers should be added to the include directory list before the SDK, and should be included before other graphics headers (e.g. `d3d11.h`) from the Windows SDK. Otherwise, the corresponding header from the Windows SDK may be included first, and will define the include guards which prevents these headers from being used.
Note that these headers may conflict with the headers from the Windows SDK, depending on include ordering. These headers should be added to the include directory list before the SDK, and should be included before other graphics headers (e.g. `d3d11.h`) from the Windows SDK. Otherwise, the corresponding header from the Windows SDK may be included first, and will define the include guards which prevents these headers from being used. To make sure the souce to be compatiable for both Win32(MSVC/MINGW)/Linux, `wsl/winadapter.h` and `wsl/wrladapter.h` should be included at the begnning of the souce file.

## Use on WSL

Expand Down
5 changes: 0 additions & 5 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ compile_options = []
if host_machine.system() != 'windows'
inc_dirs += include_directories('include/wsl/stubs', is_system : true)
install_inc_subdirs += ['', 'wsl/stubs', 'directx']
elif meson.get_compiler('cpp').get_id() != 'msvc' and meson.get_compiler('cpp').get_id() != 'clang-cl'
# MinGW has RPC headers which define old versions, and complain if D3D
# headers are included before the RPC headers, since D3D headers were
# generated with new MIDL and "require" new RPC headers.
compile_options = ['-D__REQUIRED_RPCNDR_H_VERSION__=475']
endif

format_properties_lib = static_library(
Expand Down
Loading