mirror of
https://github.com/autc04/Retro68.git
synced 2025-01-13 16:33:02 +00:00
rez include paths
This commit is contained in:
parent
273f7eacba
commit
c0dbb90b0b
12
Rez/Rez.cc
12
Rez/Rez.cc
@ -136,6 +136,18 @@ int main(int argc, const char *argv[])
|
|||||||
for(std::string path : options["include"].as<std::vector<std::string>>())
|
for(std::string path : options["include"].as<std::vector<std::string>>())
|
||||||
lexer.addIncludePath(path);
|
lexer.addIncludePath(path);
|
||||||
|
|
||||||
|
if(const char *path = getenv("REZ_INCLUDE_PATH"))
|
||||||
|
{
|
||||||
|
while(const char* end = strchr(path, ':'))
|
||||||
|
{
|
||||||
|
if(end != path)
|
||||||
|
lexer.addIncludePath(std::string(path, end));
|
||||||
|
path = end + 1;
|
||||||
|
}
|
||||||
|
if(*path)
|
||||||
|
lexer.addIncludePath(path);
|
||||||
|
}
|
||||||
|
|
||||||
if(world.verboseFlag)
|
if(world.verboseFlag)
|
||||||
{
|
{
|
||||||
std::cerr << "Compiling " << fn << "...\n";
|
std::cerr << "Compiling " << fn << "...\n";
|
||||||
|
@ -23,11 +23,15 @@ function(add_application name)
|
|||||||
set(files)
|
set(files)
|
||||||
set(rsrc_files)
|
set(rsrc_files)
|
||||||
set(rez_files)
|
set(rez_files)
|
||||||
|
|
||||||
|
set(rez_include_options ${REZ_INCLUDE_PATH})
|
||||||
|
list(TRANSFORM rez_include_options PREPEND -I)
|
||||||
|
|
||||||
foreach(f ${ARGS_FILES})
|
foreach(f ${ARGS_FILES})
|
||||||
if(${f} MATCHES "\\.r$")
|
if(${f} MATCHES "\\.r$")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${f}.rsrc.bin
|
OUTPUT ${f}.rsrc.bin
|
||||||
COMMAND ${REZ} ${REZ_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/${f} -I ${REZ_INCLUDE_PATH} -o ${f}.rsrc.bin
|
COMMAND ${REZ} ${REZ_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/${f} ${rez_include_options} -o ${f}.rsrc.bin
|
||||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${f})
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${f})
|
||||||
list(APPEND rsrc_files "${CMAKE_CURRENT_BINARY_DIR}/${f}.rsrc.bin")
|
list(APPEND rsrc_files "${CMAKE_CURRENT_BINARY_DIR}/${f}.rsrc.bin")
|
||||||
list(APPEND rez_files "${f}")
|
list(APPEND rez_files "${f}")
|
||||||
|
20
flake.nix
20
flake.nix
@ -241,7 +241,6 @@
|
|||||||
set(CMAKE_CROSSCOMPILING TRUE)
|
set(CMAKE_CROSSCOMPILING TRUE)
|
||||||
|
|
||||||
set( REZ "${pkgs.buildPackages.retro68_tools}/bin/Rez" )
|
set( REZ "${pkgs.buildPackages.retro68_tools}/bin/Rez" )
|
||||||
set( REZ_INCLUDE_PATH "${pkgs.multiversal}/RIncludes" )
|
|
||||||
|
|
||||||
include(${self + "/cmake/add_application.cmake"})
|
include(${self + "/cmake/add_application.cmake"})
|
||||||
'';
|
'';
|
||||||
@ -250,6 +249,25 @@
|
|||||||
name = "retro68_setup_hook";
|
name = "retro68_setup_hook";
|
||||||
text = ''
|
text = ''
|
||||||
export CMAKE_TOOLCHAIN_FILE=${toolchain}
|
export CMAKE_TOOLCHAIN_FILE=${toolchain}
|
||||||
|
|
||||||
|
retro68_addRIncludes() {
|
||||||
|
echo "retro68_addRIncludes: $1 $depHostOffset"
|
||||||
|
case $depHostOffset in
|
||||||
|
-1) local role='BUILD_' ;;
|
||||||
|
0) local role="" ;;
|
||||||
|
1) local role='TARGET_' ;;
|
||||||
|
*) echo "retro68_addRIncludes: Error: Cannot be used with $depHostOffset-offset deps" >2;
|
||||||
|
return 1 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [[ -d "$1/RIncludes" ]]; then
|
||||||
|
export REZ_INCLUDE_PATH+=":$1/RIncludes"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "targetOffset: $targetOffset"
|
||||||
|
addEnvHooks "$targetOffset" retro68_addRIncludes
|
||||||
|
|
||||||
'' + (pkgs.lib.optionalString (systemName == "Retro68") ''
|
'' + (pkgs.lib.optionalString (systemName == "Retro68") ''
|
||||||
export RETRO68_LD_WRAPPER_Retro68="${pkgs.buildPackages.retro68_tools}/bin/Elf2Mac"
|
export RETRO68_LD_WRAPPER_Retro68="${pkgs.buildPackages.retro68_tools}/bin/Elf2Mac"
|
||||||
export RETRO68_REAL_LD="${pkgs.buildPackages.retro68_binutils}/bin/m68k-apple-macos-ld.real"
|
export RETRO68_REAL_LD="${pkgs.buildPackages.retro68_binutils}/bin/m68k-apple-macos-ld.real"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user