-
Notifications
You must be signed in to change notification settings - Fork 83
/
CMakeLists.txt
52 lines (44 loc) · 1.4 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
cmake_minimum_required(VERSION 3.12)
project(d3d8to9 CXX)
set(SRCS
source/d3d8.hpp
source/d3d8to9.cpp
source/d3d8to9.hpp
source/d3d8to9_base.cpp
source/d3d8to9_device.cpp
source/d3d8to9_index_buffer.cpp
source/d3d8to9_surface.cpp
source/d3d8to9_swap_chain.cpp
source/d3d8to9_texture.cpp
source/d3d8to9_vertex_buffer.cpp
source/d3d8to9_volume.cpp
source/d3d8types.cpp
source/d3d8types.hpp
source/d3dx9.hpp
source/interface_query.cpp
source/interface_query.hpp
res/d3d8to9.rc
)
set(CMAKE_CXX_STANDARD 17)
option(D3D8TO9_STATIC "Build as a static library" OFF)
if(D3D8TO9_STATIC)
add_library(d3d8to9 STATIC ${SRCS})
else()
add_library(d3d8to9 SHARED ${SRCS})
set_target_properties(d3d8to9 PROPERTIES PREFIX "")
set_target_properties(d3d8to9 PROPERTIES OUTPUT_NAME "d3d8")
endif()
target_compile_definitions(d3d8to9 PUBLIC
$<$<CONFIG:Debug>:D3D_DEBUG_INFO;_DEBUG>
$<$<CONFIG:RelWithDebInfo>:D3D_DEBUG_INFO;_DEBUG>
$<$<CONFIG:Release>:D3D8TO9NOLOG>
$<$<CONFIG:MinSizeRel>:D3D8TO9NOLOG>
)
if(MSVC)
target_compile_options(d3d8to9 PRIVATE /W3)
target_link_options(d3d8to9 PRIVATE /DEF:${CMAKE_CURRENT_SOURCE_DIR}/res/d3d8.def)
else()
target_compile_options(d3d8to9 PRIVATE -Wall -Wno-delete-non-virtual-dtor -Wno-unknown-pragmas)
target_link_options(d3d8to9 PRIVATE -Wl,--enable-stdcall-fixup ${CMAKE_CURRENT_SOURCE_DIR}/res/d3d8.def)
endif()
target_link_libraries(d3d8to9 d3d9)