summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Giessen <charles@lunarg.com>2022-12-27 18:40:34 -0700
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>2022-12-28 09:20:41 -0700
commit431f1af98a7ccfc03e98979629b55f50e18d6a10 (patch)
tree40dc8306e8536ea09e8ed7c8600d1cd09340784c
parent7ed703eaa4df34111ac4006db9e826e55633a20f (diff)
downloadVulkan-Loader-431f1af98a7ccfc03e98979629b55f50e18d6a10.tar.gz
Vulkan-Loader-431f1af98a7ccfc03e98979629b55f50e18d6a10.tar.bz2
Vulkan-Loader-431f1af98a7ccfc03e98979629b55f50e18d6a10.zip
Revert asm_offset CMake code to work with 3.10
The revertion of gen_defines.asm generation during cross compilation changed the form of add_custom_command used, which inadvertently relied on CMake 3.16 support. From the CMake Docs: DEPENDS: ... A target-level dependency is added if any dependency is a byproduct of a target or any of its build events in the same directory to ensure the byproducts will be available before this target is built.
-rw-r--r--loader/CMakeLists.txt8
1 files changed, 2 insertions, 6 deletions
diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt
index 10fa787e..eb6032c7 100644
--- a/loader/CMakeLists.txt
+++ b/loader/CMakeLists.txt
@@ -157,9 +157,7 @@ if(WIN32)
target_link_libraries(asm_offset PRIVATE loader_specific_options)
# If not cross compiling, run asm_offset to generage gen_defines.asm
if (NOT CMAKE_CROSSCOMPILING)
- add_custom_command(TARGET asm_offset POST_BUILD
- COMMAND asm_offset MASM
- BYPRODUCTS gen_defines.asm)
+ add_custom_command(OUTPUT gen_defines.asm DEPENDS asm_offset COMMAND asm_offset MASM)
else()
# Forces compiler to write the intermediate asm file, needed so that we can get sizeof/offset of info out of it.
target_compile_options(asm_offset PRIVATE "/Fa$<TARGET_FILE_DIR:asm_offset>/asm_offset.asm" /FA)
@@ -233,9 +231,7 @@ else() # i.e.: Linux
target_link_libraries(asm_offset loader_specific_options)
# If not cross compiling, run asm_offset to generage gen_defines.asm
if (NOT CMAKE_CROSSCOMPILING)
- add_custom_command(TARGET asm_offset POST_BUILD
- COMMAND asm_offset GAS
- BYPRODUCTS gen_defines.asm)
+ add_custom_command(OUTPUT gen_defines.asm DEPENDS asm_offset COMMAND asm_offset GAS)
else()
# Forces compiler to write the intermediate asm file, needed so that we can get sizeof/offset of info out of it.
target_compile_options(asm_offset PRIVATE -save-temps=obj)