authorgravatar for quae@daurnimator.comdaurnimator <quae@daurnimator.com> 2021-01-02 02:46:02+11:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-03-01 16:23:10-08:00
log1f861ecc95a827fc979f3371901f1ae93dd2c283
treebe4b221992336f5ec376f2a7f16029b56514fa07
parent7b5b7bda87dc4121e2942042d19fd375c73f90e5

Bring back ZIG_SKIP_INSTALL_LIB_FILES


1 files changed, 21 insertions(+), 20 deletions(-)

CMakeLists.txt+21-20
...@@ -801,31 +801,32 @@ endif()...@@ -801,31 +801,32 @@ endif()
801801
802install(TARGETS zig DESTINATION bin)802install(TARGETS zig DESTINATION bin)
803803
804set(ZIG_INSTALL_ARGS "build"804set(ZIG_SKIP_INSTALL_LIB_FILES off CACHE BOOL
805 --override-lib-dir "${CMAKE_SOURCE_DIR}/lib"805 "Disable copying lib/ files to install prefix during the build phase")
806 "-Dlib-files-only"806
807 --prefix "${CMAKE_INSTALL_PREFIX}"807if(NOT ZIG_SKIP_INSTALL_LIB_FILES)
808 "-Dconfig_h=${ZIG_CONFIG_H_OUT}"808 set(ZIG_INSTALL_ARGS "build"
809 install809 --override-lib-dir "${CMAKE_SOURCE_DIR}/lib"
810)810 "-Dlib-files-only"
811 --prefix "${CMAKE_INSTALL_PREFIX}"
812 "-Dconfig_h=${ZIG_CONFIG_H_OUT}"
813 install
814 )
811815
812# CODE has no effect with Visual Studio build system generator, therefore816 # CODE has no effect with Visual Studio build system generator, therefore
813# when using Visual Studio build system generator we resort to running817 # when using Visual Studio build system generator we resort to running
814# `zig build install` during the build phase.818 # `zig build install` during the build phase.
815if(MSVC)819 if(MSVC)
816 set(ZIG_SKIP_INSTALL_LIB_FILES off CACHE BOOL
817 "Windows-only: Disable copying lib/ files to install prefix during the build phase")
818 if(NOT ZIG_SKIP_INSTALL_LIB_FILES)
819 add_custom_target(zig_install_lib_files ALL820 add_custom_target(zig_install_lib_files ALL
820 COMMAND zig ${ZIG_INSTALL_ARGS}821 COMMAND zig ${ZIG_INSTALL_ARGS}
821 DEPENDS zig822 DEPENDS zig
822 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"823 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
823 )824 )
825 else()
826 get_target_property(zig_BINARY_DIR zig BINARY_DIR)
827 install(CODE "set(zig_EXE \"${ZIG_EXECUTABLE}\")")
828 install(CODE "set(ZIG_INSTALL_ARGS \"${ZIG_INSTALL_ARGS}\")")
829 install(CODE "set(CMAKE_SOURCE_DIR \"${CMAKE_SOURCE_DIR}\")")
830 install(SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/cmake/install.cmake)
824 endif()831 endif()
825else()
826 get_target_property(zig_BINARY_DIR zig BINARY_DIR)
827 install(CODE "set(zig_EXE \"${ZIG_EXECUTABLE}\")")
828 install(CODE "set(ZIG_INSTALL_ARGS \"${ZIG_INSTALL_ARGS}\")")
829 install(CODE "set(CMAKE_SOURCE_DIR \"${CMAKE_SOURCE_DIR}\")")
830 install(SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/cmake/install.cmake)
831endif()832endif()