Skip to content

Commit

Permalink
Fix macro Crystal::LIBRARY_PATH.split when cross-compiling (#14330)
Browse files Browse the repository at this point in the history
  • Loading branch information
HertzDevil authored Feb 29, 2024
1 parent 7f92639 commit 8869186
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/crystal/system/win32/process.cr
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ require "process/shell"
require "crystal/atomic_semaphore"

struct Crystal::System::Process
{% if host_flag?(:windows) %}
HOST_PATH_DELIMITER = ';'
{% else %}
HOST_PATH_DELIMITER = ':'
{% end %}

getter pid : LibC::DWORD
@thread_id : LibC::DWORD
@process_handle : LibC::HANDLE
Expand Down
2 changes: 1 addition & 1 deletion src/llvm/lib_llvm.cr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% begin %}
{% if flag?(:win32) && !flag?(:static) %}
{% config = nil %}
{% for dir in Crystal::LIBRARY_PATH.split(';') %}
{% for dir in Crystal::LIBRARY_PATH.split(Crystal::System::Process::HOST_PATH_DELIMITER) %}
{% config ||= read_file?("#{dir.id}/llvm_VERSION") %}
{% end %}

Expand Down
2 changes: 1 addition & 1 deletion src/openssl/lib_crypto.cr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% if flag?(:win32) %}
{% from_libressl = false %}
{% ssl_version = nil %}
{% for dir in Crystal::LIBRARY_PATH.split(';') %}
{% for dir in Crystal::LIBRARY_PATH.split(Crystal::System::Process::HOST_PATH_DELIMITER) %}
{% unless ssl_version %}
{% config_path = "#{dir.id}\\openssl_VERSION" %}
{% if config_version = read_file?(config_path) %}
Expand Down
2 changes: 1 addition & 1 deletion src/openssl/lib_ssl.cr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require "./lib_crypto"
{% if flag?(:win32) %}
{% from_libressl = false %}
{% ssl_version = nil %}
{% for dir in Crystal::LIBRARY_PATH.split(';') %}
{% for dir in Crystal::LIBRARY_PATH.split(Crystal::System::Process::HOST_PATH_DELIMITER) %}
{% unless ssl_version %}
{% config_path = "#{dir.id}\\openssl_VERSION" %}
{% if config_version = read_file?(config_path) %}
Expand Down

0 comments on commit 8869186

Please sign in to comment.