Skip to content

Commit

Permalink
build: change targets iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
es3n1n committed Feb 6, 2024
1 parent 579d450 commit b826e86
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
19 changes: 18 additions & 1 deletion CMakeLists.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 18 additions & 1 deletion cmake.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,22 @@ build-tests = "OBFUSCATOR_BUILD_TESTS"

# Ugly fix for Zydis collisions :/
cmake-after = """
set_target_properties(obfuscator obfuscator-lib obfuscator-tests zasm Zydis Zycore PROPERTIES VS_GLOBAL_VcpkgEnabled false)
function(get_all_targets var)
set(targets)
get_all_targets_recursive(targets ${CMAKE_CURRENT_SOURCE_DIR})
set(${var} ${targets} PARENT_SCOPE)
endfunction()
macro(get_all_targets_recursive targets dir)
get_property(subdirectories DIRECTORY ${dir} PROPERTY SUBDIRECTORIES)
foreach(subdir ${subdirectories})
get_all_targets_recursive(${targets} ${subdir})
endforeach()
get_property(current_targets DIRECTORY ${dir} PROPERTY BUILDSYSTEM_TARGETS)
list(APPEND ${targets} ${current_targets})
endmacro()
get_all_targets(all_targets)
set_target_properties(${all_targets} PROPERTIES VS_GLOBAL_VcpkgEnabled false)
"""

0 comments on commit b826e86

Please sign in to comment.