-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
static rlib linking for fabric_rust_pal
- Loading branch information
Showing
13 changed files
with
120 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# pal (Platform Abstraction Layer) | ||
This crate provides a single shared library for linux environment. | ||
This crate fills windows api needed for windows-rs to work in linux environment. | ||
It contains bare minimum WIN32 API substitute on linux to make windows-rs crate COM support working. | ||
Service Fabric Rust app and test all requires this pal shared library to work. | ||
So make sure the rust executable can load this lib, i.e. this lib is in `LD_LIBRARY_PATH`. | ||
This crate is forced to be linked with fabric_base crate. | ||
|
||
Originally this crate is a shared lib, but it is a rlib now to avoid dynamic loading and packaging. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
use log::info; | ||
|
||
#[cfg(target_os = "windows")] | ||
pub fn wait_for_debugger() { | ||
if cfg!(windows) { | ||
loop { | ||
if unsafe { windows::Win32::System::Diagnostics::Debug::IsDebuggerPresent().as_bool() } | ||
{ | ||
info!("Debugger found."); | ||
break; | ||
} else { | ||
info!("Waiting for debugger."); | ||
std::thread::sleep(std::time::Duration::from_secs(5)); | ||
} | ||
loop { | ||
if unsafe { windows::Win32::System::Diagnostics::Debug::IsDebuggerPresent().as_bool() } { | ||
log::info!("Debugger found."); | ||
break; | ||
} else { | ||
log::info!("Waiting for debugger."); | ||
std::thread::sleep(std::time::Duration::from_secs(5)); | ||
} | ||
} | ||
} | ||
|
||
#[cfg(target_os = "linux")] | ||
pub fn wait_for_debugger() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
add_custom_target(build_rust_sample_echomain ALL | ||
COMMAND ${cargo_exe} build -p samples_echomain | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
DEPENDS build_fabric_rust_pal | ||
) | ||
|
||
set(_pkg_root ${CMAKE_BINARY_DIR}/echoapp_root) | ||
set(_pkg_src ${CMAKE_SOURCE_DIR}/crates/samples/echomain) | ||
if(WIN32) | ||
set(_pkg_exe ${CMAKE_SOURCE_DIR}/target/debug/samples_echomain.exe) | ||
else() | ||
set(_pkg_exe ${CMAKE_SOURCE_DIR}/target/debug/samples_echomain) | ||
endif(WIN32) | ||
# shared files | ||
add_custom_command(TARGET build_rust_sample_echomain POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E make_directory ${_pkg_root} | ||
COMMAND ${CMAKE_COMMAND} | ||
-E copy_if_different ${_pkg_src}/manifests/ApplicationManifest.xml ${_pkg_root} | ||
COMMAND ${CMAKE_COMMAND} | ||
-E copy_if_different ${_pkg_exe} ${_pkg_root}/EchoAppServicePackage/Code/echomain.exe # note the rename | ||
COMMAND ${CMAKE_COMMAND} | ||
-E copy_if_different ${_pkg_src}/manifests/ServiceManifest.xml ${_pkg_root}/EchoAppServicePackage/ServiceManifest.xml | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters