1 2function(add_host_tool _tool) 3 add_executable(${_tool} ${ARGN}) 4 set_target_properties(${_tool} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TOOLS_FOLDER}) 5endfunction() 6 7function(add_host_module _module) 8 add_library(${_module} MODULE ${ARGN}) 9 set_target_properties(${_module} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${TOOLS_FOLDER}) 10endfunction() 11 12if(MSVC) 13 add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_IO_H=1) 14 add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:/EHsc>") 15 16 # Disable warning "conversion from 'size_t' to 'int', possible loss of data" 17 add_compile_options("/wd4267") 18endif() 19 20add_host_tool(bin2c bin2c.c) 21add_host_tool(gendib gendib/gendib.c) 22add_host_tool(geninc geninc/geninc.c) 23add_host_tool(mkshelllink mkshelllink/mkshelllink.c) 24add_host_tool(obj2bin obj2bin/obj2bin.c) 25target_link_libraries(obj2bin PRIVATE host_includes) 26 27add_host_tool(spec2def spec2def/spec2def.c) 28add_host_tool(utf16le utf16le/utf16le.cpp) 29 30add_subdirectory(cabman) 31add_subdirectory(fatten) 32add_subdirectory(hhpcomp) 33add_subdirectory(hpp) 34add_subdirectory(isohybrid) 35add_subdirectory(kbdtool) 36add_subdirectory(mkhive) 37add_subdirectory(mkisofs) 38add_subdirectory(txt2nls) 39add_subdirectory(unicode) 40add_subdirectory(widl) 41add_subdirectory(wpp) 42add_subdirectory(xml2sdb) 43 44if ((ARCH STREQUAL "amd64") AND (TARGET_COMPILER_ID STREQUAL "GNU")) 45 add_subdirectory(gcc_plugin_seh) 46endif() 47 48if(NOT MSVC) 49 add_subdirectory(log2lines) 50 add_subdirectory(rsym) 51 52 add_host_tool(pefixup pefixup.c) 53if (ARCH STREQUAL "amd64") 54 target_compile_definitions(pefixup PRIVATE _TARGET_PE64) 55endif() 56 target_link_libraries(pefixup PRIVATE host_includes) 57endif() 58