https://git.reactos.org/?p=reactos.git;a=commitdiff;h=49286a6225b8dda6600cf…
commit 49286a6225b8dda6600cf0728b64691e1c97f68b
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Tue Feb 2 16:33:15 2021 +0100
Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com>
CommitDate: Wed Mar 3 08:34:32 2021 +0100
[CMAKE] Get rid of add_object_library
It's not needed anymore
---
hal/halx86/CMakeLists.txt | 30 ++++++------------------------
hal/halx86/acpi.cmake | 5 +----
hal/halx86/apic.cmake | 2 +-
hal/halx86/generic.cmake | 2 +-
hal/halx86/legacy.cmake | 6 +-----
hal/halx86/pc98.cmake | 6 ++----
hal/halx86/pic.cmake | 2 +-
hal/halx86/up.cmake | 2 +-
hal/halx86/xbox.cmake | 7 ++-----
sdk/cmake/CMakeMacros.cmake | 10 ----------
10 files changed, 16 insertions(+), 56 deletions(-)
diff --git a/hal/halx86/CMakeLists.txt b/hal/halx86/CMakeLists.txt
index e56a791d8da..68d13839dae 100644
--- a/hal/halx86/CMakeLists.txt
+++ b/hal/halx86/CMakeLists.txt
@@ -15,30 +15,12 @@ function(add_hal _halname)
spec2def(${_halname}.dll ../hal.spec ADD_IMPORTLIB)
# Create the actual target
- if(NOT MSVC)
- foreach(_component ${_haldata_COMPONENTS})
- list(APPEND _haldata_SOURCES
"$<TARGET_OBJECTS:lib_hal_${_component}>")
- endforeach()
- add_library(${_halname} MODULE
- ${_haldata_SOURCES}
- ${CMAKE_CURRENT_BINARY_DIR}/hal.def)
- else()
- foreach(_component ${_haldata_COMPONENTS})
- list(APPEND _haldata_LIBS "lib_hal_${_component}")
- endforeach()
- add_library(${_halname} MODULE
- ${_haldata_SOURCES}
- ${CMAKE_CURRENT_BINARY_DIR}/hal.def)
- target_link_libraries(${_halname} ${_haldata_LIBS})
- endif()
-
- if(${_halname} STREQUAL "halpc98")
- target_compile_definitions(lib_hal_pc98 PRIVATE SARCH_PC98)
- endif()
-
- if(${_halname} STREQUAL "halxbox")
- target_compile_definitions(lib_hal_xbox PRIVATE SARCH_XBOX)
- endif()
+ foreach(_component ${_haldata_COMPONENTS})
+ list(APPEND _haldata_SOURCES
"$<TARGET_OBJECTS:lib_hal_${_component}>")
+ endforeach()
+ add_library(${_halname} MODULE
+ ${_haldata_SOURCES}
+ ${CMAKE_CURRENT_BINARY_DIR}/hal.def)
if(${_halname} STREQUAL "hal")
target_link_libraries(${_halname} libcntpr arbiter)
diff --git a/hal/halx86/acpi.cmake b/hal/halx86/acpi.cmake
index af08c9fc18f..acc856a0b72 100644
--- a/hal/halx86/acpi.cmake
+++ b/hal/halx86/acpi.cmake
@@ -5,10 +5,7 @@ list(APPEND HAL_ACPI_SOURCE
acpi/busemul.c
legacy/bus/pcibus.c)
-add_object_library(lib_hal_acpi ${HAL_ACPI_SOURCE})
+add_library(lib_hal_acpi OBJECT ${HAL_ACPI_SOURCE})
add_dependencies(lib_hal_acpi bugcodes xdk)
#add_pch(lib_hal_acpi include/hal.h)
-if(MSVC)
- target_link_libraries(lib_hal_acpi lib_hal_generic)
-endif()
diff --git a/hal/halx86/apic.cmake b/hal/halx86/apic.cmake
index 6349e726af0..9c0139e3504 100644
--- a/hal/halx86/apic.cmake
+++ b/hal/halx86/apic.cmake
@@ -11,5 +11,5 @@ list(APPEND HAL_APIC_SOURCE
apic/tsc.c)
add_asm_files(lib_hal_apic_asm ${HAL_APIC_ASM_SOURCE})
-add_object_library(lib_hal_apic ${HAL_APIC_SOURCE} ${lib_hal_apic_asm})
+add_library(lib_hal_apic OBJECT ${HAL_APIC_SOURCE} ${lib_hal_apic_asm})
add_dependencies(lib_hal_apic asm)
diff --git a/hal/halx86/generic.cmake b/hal/halx86/generic.cmake
index 19eb850164b..4948e111fb6 100644
--- a/hal/halx86/generic.cmake
+++ b/hal/halx86/generic.cmake
@@ -24,5 +24,5 @@ if(ARCH STREQUAL "i386")
endif()
add_asm_files(lib_hal_generic_asm ${HAL_GENERIC_ASM_SOURCE})
-add_object_library(lib_hal_generic ${HAL_GENERIC_SOURCE} ${lib_hal_generic_asm})
+add_library(lib_hal_generic OBJECT ${HAL_GENERIC_SOURCE} ${lib_hal_generic_asm})
add_dependencies(lib_hal_generic asm)
diff --git a/hal/halx86/legacy.cmake b/hal/halx86/legacy.cmake
index d60be7f5938..2f487748524 100644
--- a/hal/halx86/legacy.cmake
+++ b/hal/halx86/legacy.cmake
@@ -11,10 +11,6 @@ list(APPEND HAL_LEGACY_SOURCE
legacy/halpnpdd.c
legacy/halpcat.c)
-add_object_library(lib_hal_legacy ${HAL_LEGACY_SOURCE})
+add_library(lib_hal_legacy OBJECT ${HAL_LEGACY_SOURCE})
add_dependencies(lib_hal_legacy bugcodes xdk)
#add_pch(lib_hal_legacy include/hal.h)
-
-if(MSVC)
- target_link_libraries(lib_hal_legacy lib_hal_generic)
-endif()
diff --git a/hal/halx86/pc98.cmake b/hal/halx86/pc98.cmake
index fd51a9851b9..9f04972a212 100644
--- a/hal/halx86/pc98.cmake
+++ b/hal/halx86/pc98.cmake
@@ -48,10 +48,8 @@ list(APPEND HAL_PC98_SOURCE
legacy/halpcat.c)
add_asm_files(lib_hal_pc98_asm ${HAL_PC98_ASM_SOURCE})
-add_object_library(lib_hal_pc98 ${HAL_PC98_SOURCE} ${lib_hal_pc98_asm})
+add_library(lib_hal_pc98 OBJECT ${HAL_PC98_SOURCE} ${lib_hal_pc98_asm})
add_dependencies(lib_hal_pc98 bugcodes xdk asm)
#add_pch(lib_hal_pc98 pc98/halpc98.h)
-if(MSVC)
- target_link_libraries(lib_hal_pc98)
-endif()
+target_compile_definitions(lib_hal_pc98 PRIVATE SARCH_PC98)
diff --git a/hal/halx86/pic.cmake b/hal/halx86/pic.cmake
index bd5f15f7894..d8f151f6071 100644
--- a/hal/halx86/pic.cmake
+++ b/hal/halx86/pic.cmake
@@ -13,5 +13,5 @@ list(APPEND HAL_PIC_SOURCE
up/pic.c)
add_asm_files(lib_hal_pic_asm ${HAL_PIC_ASM_SOURCE})
-add_object_library(lib_hal_pic ${HAL_PIC_SOURCE} ${lib_hal_pic_asm})
+add_library(lib_hal_pic OBJECT ${HAL_PIC_SOURCE} ${lib_hal_pic_asm})
add_dependencies(lib_hal_pic asm)
diff --git a/hal/halx86/up.cmake b/hal/halx86/up.cmake
index d61cc0c2c83..2d40c7da185 100644
--- a/hal/halx86/up.cmake
+++ b/hal/halx86/up.cmake
@@ -3,5 +3,5 @@ list(APPEND HAL_UP_SOURCE
generic/spinlock.c
up/processor.c)
-add_object_library(lib_hal_up ${HAL_UP_SOURCE})
+add_library(lib_hal_up OBJECT ${HAL_UP_SOURCE})
add_dependencies(lib_hal_up bugcodes xdk)
diff --git a/hal/halx86/xbox.cmake b/hal/halx86/xbox.cmake
index 6b121689c95..ffdbbfe8026 100644
--- a/hal/halx86/xbox.cmake
+++ b/hal/halx86/xbox.cmake
@@ -40,10 +40,7 @@ list(APPEND HAL_XBOX_SOURCE
up/pic.c)
add_asm_files(lib_hal_xbox_asm ${HAL_XBOX_ASM_SOURCE})
-add_object_library(lib_hal_xbox ${HAL_XBOX_SOURCE} ${lib_hal_xbox_asm})
+add_library(lib_hal_xbox OBJECT ${HAL_XBOX_SOURCE} ${lib_hal_xbox_asm})
add_dependencies(lib_hal_xbox bugcodes xdk asm)
#add_pch(lib_hal_xbox xbox/halxbox.h)
-
-if(MSVC)
- target_link_libraries(lib_hal_xbox)
-endif()
+target_compile_definitions(lib_hal_xbox PRIVATE SARCH_XBOX)
diff --git a/sdk/cmake/CMakeMacros.cmake b/sdk/cmake/CMakeMacros.cmake
index 80488a3a63b..1429580b2ac 100644
--- a/sdk/cmake/CMakeMacros.cmake
+++ b/sdk/cmake/CMakeMacros.cmake
@@ -717,16 +717,6 @@ function(get_defines OUTPUT_VAR)
set(${OUTPUT_VAR} ${__tmp_var} PARENT_SCOPE)
endfunction()
-if(NOT MSVC)
- function(add_object_library _target)
- add_library(${_target} OBJECT ${ARGN})
- endfunction()
-else()
- function(add_object_library _target)
- add_library(${_target} ${ARGN})
- endfunction()
-endif()
-
function(add_registry_inf)
# Add to the inf files list
foreach(_file ${ARGN})