Index: loader/CMakeLists.txt
--- loader/CMakeLists.txt.orig
+++ loader/CMakeLists.txt
@@ -17,7 +17,7 @@
 # limitations under the License.
 # ~~~
 
-include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/generated ${CMAKE_CURRENT_BINARY_DIR})
+include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/generated ${CMAKE_CURRENT_BINARY_DIR})
 
 # Get version of the API the generated code used and put it into a cmake variable LOADER_GENERATED_HEADER_VERSION
 include(generated/loader_generated_header_version.cmake)
@@ -360,7 +360,7 @@ else()
             add_library(vulkan-framework SHARED ${NORMAL_LOADER_SRCS} ${OPT_LOADER_SRCS} ${FRAMEWORK_HEADERS})
         endif()
         add_dependencies(vulkan-framework loader_asm_gen_files)
-        target_link_libraries(vulkan-framework -ldl -lpthread -lm "-framework CoreFoundation")
+        target_link_libraries(vulkan-framework -lpthread -lm "-framework CoreFoundation")
         target_link_libraries(vulkan-framework Vulkan::Headers)
 
         # The FRAMEWORK_VERSION needs to be "A" here so that Xcode code-signing works when a user adds their framework to an Xcode
@@ -385,9 +385,6 @@ else()
 # cmake-format: on
     endif()
 
-    if(NOT APPLE)
-        target_compile_definitions(vulkan PRIVATE _XOPEN_SOURCE=500) # hush compiler warnings for readlink
-    endif()
 endif()
 
 # Generate pkg-config file.
