| author | |
| committer | |
| log | 9741b2aab47ec899276a52827f72509fc322388a |
| tree | 2401c596d75282a6a6c1b75d24f2101b221cd0d8 |
| parent | 5570bc986b916ffb07b77853cf995d90c7e99805 |
| signature |
5 files changed, 17 insertions(+), 26 deletions(-)
CMakeLists.txt+11-4| ... | @@ -6639,10 +6639,17 @@ configure_file ( | ... | @@ -6639,10 +6639,17 @@ configure_file ( |
| 6639 | "${CMAKE_SOURCE_DIR}/src/config.h.in" | 6639 | "${CMAKE_SOURCE_DIR}/src/config.h.in" |
| 6640 | "${CMAKE_BINARY_DIR}/config.h" | 6640 | "${CMAKE_BINARY_DIR}/config.h" |
| 6641 | ) | 6641 | ) |
| 6642 | configure_file ( | 6642 | set(INSTALL_FILES_H "${CMAKE_BINARY_DIR}/install_files.h") |
| 6643 | "${CMAKE_SOURCE_DIR}/src/install_files.h.in" | 6643 | file(REMOVE "${INSTALL_FILES_H}") |
| 6644 | "${CMAKE_BINARY_DIR}/install_files.h" | 6644 | file(APPEND "${INSTALL_FILES_H}" "#ifndef ZIG_INSTALL_FILES_H\n") |
| 6645 | ) | 6645 | file(APPEND "${INSTALL_FILES_H}" "#define ZIG_INSTALL_FILES_H\n") |
| 6646 | file(APPEND "${INSTALL_FILES_H}" "static const char *ZIG_MUSL_SRC_FILES[] = {\n") | ||
| 6647 | foreach(filename ${ZIG_MUSL_SRC_FILES}) | ||
| 6648 | file(APPEND "${INSTALL_FILES_H}" "\"${filename}\",\n") | ||
| 6649 | endforeach(filename) | ||
| 6650 | file(APPEND "${INSTALL_FILES_H}" "};\n") | ||
| 6651 | file(APPEND "${INSTALL_FILES_H}" "#endif\n") | ||
| 6652 | |||
| 6646 | 6653 | ||
| 6647 | include_directories( | 6654 | include_directories( |
| 6648 | ${CMAKE_SOURCE_DIR} | 6655 | ${CMAKE_SOURCE_DIR} |
src/config.h.in+2| ... | @@ -23,5 +23,7 @@ | ... | @@ -23,5 +23,7 @@ |
| 23 | #define ZIG_LLD_LIBRARIES "@LLD_LIBRARIES@" | 23 | #define ZIG_LLD_LIBRARIES "@LLD_LIBRARIES@" |
| 24 | #define ZIG_LLVM_CONFIG_EXE "@LLVM_CONFIG_EXE@" | 24 | #define ZIG_LLVM_CONFIG_EXE "@LLVM_CONFIG_EXE@" |
| 25 | #define ZIG_DIA_GUIDS_LIB "@ZIG_DIA_GUIDS_LIB_ESCAPED@" | 25 | #define ZIG_DIA_GUIDS_LIB "@ZIG_DIA_GUIDS_LIB_ESCAPED@" |
| 26 | #define ZIG_STD_FILES "@ZIG_STD_FILES@" | ||
| 27 | #define ZIG_C_HEADER_FILES "@ZIG_C_HEADER_FILES@" | ||
| 26 | 28 | ||
| 27 | #endif | 29 | #endif |
src/install_files.h.in deleted-15| ... | @@ -1,15 +0,0 @@ | ||
| 1 | /* | ||
| 2 | * Copyright (c) 2019 Andrew Kelley | ||
| 3 | * | ||
| 4 | * This file is part of zig, which is MIT licensed. | ||
| 5 | * See http://opensource.org/licenses/MIT | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef ZIG_INSTALL_FILES_H | ||
| 9 | #define ZIG_INSTALL_FILES_H | ||
| 10 | |||
| 11 | #define ZIG_MUSL_SRC_FILES "@ZIG_MUSL_SRC_FILES@" | ||
| 12 | #define ZIG_STD_FILES "@ZIG_STD_FILES@" | ||
| 13 | #define ZIG_C_HEADER_FILES "@ZIG_C_HEADER_FILES@" | ||
| 14 | |||
| 15 | #endif | ||
src/link.cpp+4-6| ... | @@ -501,15 +501,13 @@ static const char *build_musl(CodeGen *parent) { | ... | @@ -501,15 +501,13 @@ static const char *build_musl(CodeGen *parent) { |
| 501 | MuslSrcO3, | 501 | MuslSrcO3, |
| 502 | }; | 502 | }; |
| 503 | 503 | ||
| 504 | const char *target_musl_arch_name = musl_arch_name(parent->zig_target); | ||
| 505 | |||
| 504 | HashMap<Buf *, MuslSrc, buf_hash, buf_eql_buf> source_table = {}; | 506 | HashMap<Buf *, MuslSrc, buf_hash, buf_eql_buf> source_table = {}; |
| 505 | source_table.init(1800); | 507 | source_table.init(1800); |
| 506 | 508 | ||
| 507 | SplitIterator install_h_it = memSplit(str(ZIG_MUSL_SRC_FILES), str(";")); | 509 | for (size_t i = 0; i < array_length(ZIG_MUSL_SRC_FILES); i += 1) { |
| 508 | const char *target_musl_arch_name = musl_arch_name(parent->zig_target); | 510 | Buf *src_file = buf_create_from_str(ZIG_MUSL_SRC_FILES[i]); |
| 509 | for (;;) { | ||
| 510 | Optional<Slice<uint8_t>> opt_item = SplitIterator_next(&install_h_it); | ||
| 511 | if (!opt_item.is_some) break; | ||
| 512 | Buf *src_file = buf_create_from_slice(opt_item.value); | ||
| 513 | 511 | ||
| 514 | MuslSrc src_kind; | 512 | MuslSrc src_kind; |
| 515 | if (buf_ends_with_str(src_file, ".c")) { | 513 | if (buf_ends_with_str(src_file, ".c")) { |
src/main.cpp-1| ... | @@ -10,7 +10,6 @@ | ... | @@ -10,7 +10,6 @@ |
| 10 | #include "codegen.hpp" | 10 | #include "codegen.hpp" |
| 11 | #include "compiler.hpp" | 11 | #include "compiler.hpp" |
| 12 | #include "config.h" | 12 | #include "config.h" |
| 13 | #include "install_files.h" | ||
| 14 | #include "error.hpp" | 13 | #include "error.hpp" |
| 15 | #include "os.hpp" | 14 | #include "os.hpp" |
| 16 | #include "target.hpp" | 15 | #include "target.hpp" |