Fix readlink error in asm_offset on linux
authorCharles Giessen <charles@lunarg.com>
Tue, 30 Nov 2021 18:21:01 +0000 (11:21 -0700)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Tue, 30 Nov 2021 20:53:34 +0000 (13:53 -0700)
The readlink function required _GNU_SOURCE to be a compiler definition but
wasn't added since it was in a different executable than the main vulkan
loader. Adding it to the asm_offset target fixes the error.

loader/CMakeLists.txt

index c33858d813e59d28a5068007755dc71c2d04c088..8bb10fd1979ca871675ff4b9ee87acd14ac20471 100644 (file)
@@ -245,6 +245,7 @@ else(UNIX AND NOT APPLE) # i.e.: Linux
     if(ASSEMBLER_WORKS)
         add_executable(asm_offset asm_offset.c)
         target_link_libraries(asm_offset Vulkan::Headers)
+        target_compile_definitions(asm_offset PRIVATE _GNU_SOURCE)
         add_custom_command(OUTPUT gen_defines.asm DEPENDS asm_offset COMMAND asm_offset GAS)
         add_custom_target(loader_asm_gen_files DEPENDS gen_defines.asm)
     else()