mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2024-12-13 05:40:48 +00:00
10 lines
383 B
CMake
10 lines
383 B
CMake
# Usage: cmake -Dlib=lib.bat -Ddef=out.def -Ddll=out.dll -Dimp=out.dll.a -P GNUtoMS_lib.cmake
|
|
get_filename_component(name ${dll} NAME) # .dll file name
|
|
string(REGEX REPLACE "\\.dll\\.a$" ".lib" out "${imp}") # .dll.a -> .lib
|
|
execute_process(
|
|
COMMAND ${lib} /def:${def} /name:${name} /out:${out}
|
|
RESULT_VARIABLE res
|
|
)
|
|
if(res)
|
|
message(FATAL_ERROR "lib failed: ${res}")
|
|
endif()
|