summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/CMakeLists.txt
blob: e1f4276a153d6fe41b8b4b5b19fc99b5d3dd27f8 (plain) (blame)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
add_executable(shader_recompiler
    backend/spirv/emit_spirv.cpp
    backend/spirv/emit_spirv.h
    backend/spirv/emit_spirv_bitwise_conversion.cpp
    backend/spirv/emit_spirv_composite.cpp
    backend/spirv/emit_spirv_context_get_set.cpp
    backend/spirv/emit_spirv_control_flow.cpp
    backend/spirv/emit_spirv_floating_point.cpp
    backend/spirv/emit_spirv_integer.cpp
    backend/spirv/emit_spirv_logical.cpp
    backend/spirv/emit_spirv_memory.cpp
    backend/spirv/emit_spirv_select.cpp
    backend/spirv/emit_spirv_undefined.cpp
    environment.h
    exception.h
    file_environment.cpp
    file_environment.h
    frontend/ir/attribute.cpp
    frontend/ir/attribute.h
    frontend/ir/basic_block.cpp
    frontend/ir/basic_block.h
    frontend/ir/condition.cpp
    frontend/ir/condition.h
    frontend/ir/flow_test.cpp
    frontend/ir/flow_test.h
    frontend/ir/function.cpp
    frontend/ir/function.h
    frontend/ir/ir_emitter.cpp
    frontend/ir/ir_emitter.h
    frontend/ir/microinstruction.cpp
    frontend/ir/microinstruction.h
    frontend/ir/opcodes.cpp
    frontend/ir/opcodes.h
    frontend/ir/opcodes.inc
    frontend/ir/post_order.cpp
    frontend/ir/post_order.h
    frontend/ir/pred.h
    frontend/ir/program.cpp
    frontend/ir/program.h
    frontend/ir/reg.h
    frontend/ir/structured_control_flow.cpp
    frontend/ir/structured_control_flow.h
    frontend/ir/type.cpp
    frontend/ir/type.h
    frontend/ir/value.cpp
    frontend/ir/value.h
    frontend/maxwell/control_flow.cpp
    frontend/maxwell/control_flow.h
    frontend/maxwell/decode.cpp
    frontend/maxwell/decode.h
    frontend/maxwell/instruction.h
    frontend/maxwell/location.h
    frontend/maxwell/maxwell.inc
    frontend/maxwell/opcodes.cpp
    frontend/maxwell/opcodes.h
    frontend/maxwell/program.cpp
    frontend/maxwell/program.h
    frontend/maxwell/translate/impl/common_encoding.h
    frontend/maxwell/translate/impl/floating_point_add.cpp
    frontend/maxwell/translate/impl/floating_point_conversion_integer.cpp
    frontend/maxwell/translate/impl/floating_point_fused_multiply_add.cpp
    frontend/maxwell/translate/impl/floating_point_multi_function.cpp
    frontend/maxwell/translate/impl/floating_point_multiply.cpp
    frontend/maxwell/translate/impl/impl.cpp
    frontend/maxwell/translate/impl/impl.h
    frontend/maxwell/translate/impl/integer_add.cpp
    frontend/maxwell/translate/impl/integer_scaled_add.cpp
    frontend/maxwell/translate/impl/integer_set_predicate.cpp
    frontend/maxwell/translate/impl/integer_shift_left.cpp
    frontend/maxwell/translate/impl/integer_short_multiply_add.cpp
    frontend/maxwell/translate/impl/load_store_attribute.cpp
    frontend/maxwell/translate/impl/load_store_memory.cpp
    frontend/maxwell/translate/impl/not_implemented.cpp
    frontend/maxwell/translate/impl/move_register.cpp
    frontend/maxwell/translate/impl/move_special_register.cpp
    frontend/maxwell/translate/translate.cpp
    frontend/maxwell/translate/translate.h
    ir_opt/constant_propagation_pass.cpp
    ir_opt/dead_code_elimination_pass.cpp
    ir_opt/global_memory_to_storage_buffer_pass.cpp
    ir_opt/identity_removal_pass.cpp
    ir_opt/passes.h
    ir_opt/ssa_rewrite_pass.cpp
    ir_opt/verification_pass.cpp
    main.cpp
    object_pool.h
)

target_include_directories(video_core PRIVATE sirit)
target_link_libraries(shader_recompiler PRIVATE fmt::fmt sirit)

if (MSVC)
    target_compile_options(shader_recompiler PRIVATE
        /W4
        /WX
        /we4018 # 'expression' : signed/unsigned mismatch
        /we4244 # 'argument' : conversion from 'type1' to 'type2', possible loss of data (floating-point)
        /we4245 # 'conversion' : conversion from 'type1' to 'type2', signed/unsigned mismatch
        /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
        /we4267 # 'var' : conversion from 'size_t' to 'type', possible loss of data
        /we4305 # 'context' : truncation from 'type1' to 'type2'
        /we4800 # Implicit conversion from 'type' to bool. Possible information loss
        /we4826 # Conversion from 'type1' to 'type2' is sign-extended. This may cause unexpected runtime behavior.
    )
else()
    target_compile_options(shader_recompiler PRIVATE
        -Werror
        -Werror=conversion
        -Werror=ignored-qualifiers
        -Werror=implicit-fallthrough
        -Werror=shadow
        -Werror=sign-compare
        $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter>
        $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable>
        -Werror=unused-variable
    )
endif()

create_target_directory_groups(shader_recompiler)