mirror of
https://github.com/ziglang/zig.git
synced 2024-12-12 14:16:59 +00:00
Bring back ZIG_SKIP_INSTALL_LIB_FILES
This commit is contained in:
parent
7b5b7bda87
commit
1f861ecc95
@ -801,31 +801,32 @@ endif()
|
||||
|
||||
install(TARGETS zig DESTINATION bin)
|
||||
|
||||
set(ZIG_INSTALL_ARGS "build"
|
||||
--override-lib-dir "${CMAKE_SOURCE_DIR}/lib"
|
||||
"-Dlib-files-only"
|
||||
--prefix "${CMAKE_INSTALL_PREFIX}"
|
||||
"-Dconfig_h=${ZIG_CONFIG_H_OUT}"
|
||||
install
|
||||
)
|
||||
set(ZIG_SKIP_INSTALL_LIB_FILES off CACHE BOOL
|
||||
"Disable copying lib/ files to install prefix during the build phase")
|
||||
|
||||
# CODE has no effect with Visual Studio build system generator, therefore
|
||||
# when using Visual Studio build system generator we resort to running
|
||||
# `zig build install` during the build phase.
|
||||
if(MSVC)
|
||||
set(ZIG_SKIP_INSTALL_LIB_FILES off CACHE BOOL
|
||||
"Windows-only: Disable copying lib/ files to install prefix during the build phase")
|
||||
if(NOT ZIG_SKIP_INSTALL_LIB_FILES)
|
||||
if(NOT ZIG_SKIP_INSTALL_LIB_FILES)
|
||||
set(ZIG_INSTALL_ARGS "build"
|
||||
--override-lib-dir "${CMAKE_SOURCE_DIR}/lib"
|
||||
"-Dlib-files-only"
|
||||
--prefix "${CMAKE_INSTALL_PREFIX}"
|
||||
"-Dconfig_h=${ZIG_CONFIG_H_OUT}"
|
||||
install
|
||||
)
|
||||
|
||||
# CODE has no effect with Visual Studio build system generator, therefore
|
||||
# when using Visual Studio build system generator we resort to running
|
||||
# `zig build install` during the build phase.
|
||||
if(MSVC)
|
||||
add_custom_target(zig_install_lib_files ALL
|
||||
COMMAND zig ${ZIG_INSTALL_ARGS}
|
||||
DEPENDS zig
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
)
|
||||
else()
|
||||
get_target_property(zig_BINARY_DIR zig BINARY_DIR)
|
||||
install(CODE "set(zig_EXE \"${ZIG_EXECUTABLE}\")")
|
||||
install(CODE "set(ZIG_INSTALL_ARGS \"${ZIG_INSTALL_ARGS}\")")
|
||||
install(CODE "set(CMAKE_SOURCE_DIR \"${CMAKE_SOURCE_DIR}\")")
|
||||
install(SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/cmake/install.cmake)
|
||||
endif()
|
||||
else()
|
||||
get_target_property(zig_BINARY_DIR zig BINARY_DIR)
|
||||
install(CODE "set(zig_EXE \"${ZIG_EXECUTABLE}\")")
|
||||
install(CODE "set(ZIG_INSTALL_ARGS \"${ZIG_INSTALL_ARGS}\")")
|
||||
install(CODE "set(CMAKE_SOURCE_DIR \"${CMAKE_SOURCE_DIR}\")")
|
||||
install(SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/cmake/install.cmake)
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user