summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorGravatar Lioncash2018-01-17 19:37:34 -0500
committerGravatar Lioncash2018-01-17 21:51:43 -0500
commite710a1b9894d835d740ed63c03098fd637f61f63 (patch)
tree7585a15cdf38ea2913a847c738c84e769e43ea77 /src/common
parentMerge pull request #73 from N00byKing/3093 (diff)
downloadyuzu-e710a1b9894d835d740ed63c03098fd637f61f63.tar.gz
yuzu-e710a1b9894d835d740ed63c03098fd637f61f63.tar.xz
yuzu-e710a1b9894d835d740ed63c03098fd637f61f63.zip
CMakeLists: Derive the source directory grouping from targets themselves
Removes the need to store to separate SRC and HEADER variables, and then construct the target in most cases.
Diffstat (limited to 'src/common')
-rw-r--r--src/common/CMakeLists.txt120
1 files changed, 57 insertions, 63 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 26cf9480b..1af80769a 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -24,78 +24,72 @@ if ($ENV{CI})
24endif() 24endif()
25configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in" "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp" @ONLY) 25configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in" "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp" @ONLY)
26 26
27set(SRCS 27add_library(common STATIC
28 break_points.cpp 28 alignment.h
29 file_util.cpp 29 assert.h
30 hash.cpp 30 bit_field.h
31 logging/filter.cpp 31 bit_set.h
32 logging/text_formatter.cpp 32 break_points.cpp
33 logging/backend.cpp 33 break_points.h
34 memory_util.cpp 34 chunk_file.h
35 microprofile.cpp 35 code_block.h
36 misc.cpp 36 color.h
37 param_package.cpp 37 common_funcs.h
38 scm_rev.cpp 38 common_paths.h
39 string_util.cpp 39 common_types.h
40 telemetry.cpp 40 file_util.cpp
41 thread.cpp 41 file_util.h
42 timer.cpp 42 hash.cpp
43 ) 43 hash.h
44 44 linear_disk_cache.h
45set(HEADERS 45 logging/backend.cpp
46 alignment.h 46 logging/backend.h
47 assert.h 47 logging/filter.cpp
48 bit_field.h 48 logging/filter.h
49 bit_set.h 49 logging/log.h
50 break_points.h 50 logging/text_formatter.cpp
51 chunk_file.h 51 logging/text_formatter.h
52 code_block.h 52 math_util.h
53 color.h 53 memory_util.cpp
54 common_funcs.h 54 memory_util.h
55 common_paths.h 55 microprofile.cpp
56 common_types.h 56 microprofile.h
57 file_util.h 57 microprofileui.h
58 hash.h 58 misc.cpp
59 linear_disk_cache.h 59 param_package.cpp
60 logging/text_formatter.h 60 param_package.h
61 logging/filter.h 61 platform.h
62 logging/log.h 62 quaternion.h
63 logging/backend.h 63 scm_rev.cpp
64 math_util.h 64 scm_rev.h
65 memory_util.h 65 scope_exit.h
66 microprofile.h 66 string_util.cpp
67 microprofileui.h 67 string_util.h
68 param_package.h 68 swap.h
69 platform.h 69 synchronized_wrapper.h
70 quaternion.h 70 telemetry.cpp
71 scm_rev.h 71 telemetry.h
72 scope_exit.h 72 thread.cpp
73 string_util.h 73 thread.h
74 swap.h 74 thread_queue_list.h
75 synchronized_wrapper.h 75 threadsafe_queue.h
76 telemetry.h 76 timer.cpp
77 thread.h 77 timer.h
78 thread_queue_list.h 78 vector_math.h
79 threadsafe_queue.h 79)
80 timer.h
81 vector_math.h
82 )
83 80
84if(ARCHITECTURE_x86_64) 81if(ARCHITECTURE_x86_64)
85 set(SRCS ${SRCS} 82 target_sources(common
83 PRIVATE
86 x64/cpu_detect.cpp 84 x64/cpu_detect.cpp
87 )
88
89 set(HEADERS ${HEADERS}
90 x64/cpu_detect.h 85 x64/cpu_detect.h
91 x64/xbyak_abi.h 86 x64/xbyak_abi.h
92 x64/xbyak_util.h 87 x64/xbyak_util.h
93 ) 88 )
94endif() 89endif()
95 90
96create_directory_groups(${SRCS} ${HEADERS}) 91create_target_directory_groups(common)
97 92
98add_library(common STATIC ${SRCS} ${HEADERS})
99target_link_libraries(common PUBLIC Boost::boost microprofile) 93target_link_libraries(common PUBLIC Boost::boost microprofile)
100if (ARCHITECTURE_x86_64) 94if (ARCHITECTURE_x86_64)
101 target_link_libraries(common PRIVATE xbyak) 95 target_link_libraries(common PRIVATE xbyak)