<commit_before># the use of CMAKE_CURRENT_SOURCE_DIR pollutes the source tree
add_custom_command(OUTPUT icd-dispatch-table.h
	COMMAND ${PROJECT_SOURCE_DIR}/xgl-generate.py icd-dispatch-table > ${CMAKE_CURRENT_SOURCE_DIR}/icd-dispatch-table.h
	           DEPENDS ${PROJECT_SOURCE_DIR}/xgl-generate.py
	                   ${PROJECT_SOURCE_DIR}/xgl.py)

add_custom_command(OUTPUT icd-dispatch-entrypoints.c
	COMMAND ${PROJECT_SOURCE_DIR}/xgl-generate.py icd-dispatch-entrypoints icd-dispatch-table.h > icd-dispatch-entrypoints.c
	           DEPENDS ${PROJECT_SOURCE_DIR}/xgl-generate.py
	                   ${PROJECT_SOURCE_DIR}/xgl.py)

set(ICD_SOURCES
	icd.c
	icd-dispatch-entrypoints.c
	icd-dispatch-table.h
	icd-format.c
	icd-utils.c)

set(ICD_REQUIRED_MODULES)

if (UNIX)
	set(ICD_REQUIRED_MODULES ${ICD_REQUIRED_MODULES} libudev)
	set(ICD_SOURCES ${ICD_SOURCES} icd-enumerate-drm.c)
endif()

pkg_check_modules(ICD REQUIRED ${ICD_REQUIRED_MODULES})

include_directories(
	${ICD_INCLUDE_DIRS}
)

add_library(icd OBJECT ${ICD_SOURCES})
set_target_properties(icd PROPERTIES POSITION_INDEPENDENT_CODE ON)<commit_msg>build: do not pollute source tree with icd-dispatch-table.h<commit_after>add_custom_command(OUTPUT icd-dispatch-table.h
	COMMAND ${PROJECT_SOURCE_DIR}/xgl-generate.py icd-dispatch-table > icd-dispatch-table.h
	           DEPENDS ${PROJECT_SOURCE_DIR}/xgl-generate.py
	                   ${PROJECT_SOURCE_DIR}/xgl.py)

add_custom_command(OUTPUT icd-dispatch-entrypoints.c
	COMMAND ${PROJECT_SOURCE_DIR}/xgl-generate.py icd-dispatch-entrypoints icd-dispatch-table.h > icd-dispatch-entrypoints.c
	           DEPENDS ${PROJECT_SOURCE_DIR}/xgl-generate.py
	                   ${PROJECT_SOURCE_DIR}/xgl.py)

set(ICD_SOURCES
	icd.c
	icd-dispatch-entrypoints.c
	icd-dispatch-table.h
	icd-format.c
	icd-utils.c)

set(ICD_REQUIRED_MODULES)

if (UNIX)
	set(ICD_REQUIRED_MODULES ${ICD_REQUIRED_MODULES} libudev)
	set(ICD_SOURCES ${ICD_SOURCES} icd-enumerate-drm.c)
endif()

pkg_check_modules(ICD REQUIRED ${ICD_REQUIRED_MODULES})

# icd-dispatch-table.h was generated in ${CMAKE_CURRENT_BINARY_DIR}
set(ICD_INCLUDE_DIRS
	${ICD_INCLUDE_DIRS}
	${CMAKE_CURRENT_BINARY_DIR}
	CACHE INTERNAL "")

include_directories(
	${ICD_INCLUDE_DIRS}
)

add_library(icd OBJECT ${ICD_SOURCES})
set_target_properties(icd PROPERTIES POSITION_INDEPENDENT_CODE ON)
{'fraction_non_alphanumeric': 0.10584720443875373, 'fraction_numerical': 0.0, 'mean_word_length': 4.889447236180905, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3363004', 'n_tokens_mistral': 943, 'n_tokens_neox': 894, 'n_words': 119}