terralang / terrac Goto Github PK
View Code? Open in Web Editor NEWUnofficial terralang compiler
License: MIT License
Unofficial terralang compiler
License: MIT License
The filesystem and xopt submodules, required to build terrac, are private and require authentication when I try to update.
This prevents anyone without authorization to them from compiling terrac.
Not sure what to do here, since I'm not even able to know what these libraries are supposed to be, but they could be made public or there could be a copy of them inside terrac's repository.
Not sure exactly how it should be provided (directly in the CMakeLists.txt here? as a package for find_package()
?) but here is the toolchain function I've been using to create Terra projects with terrac
:
function (terra_module_directories)
foreach (arg IN LISTS ARGN)
list (APPEND TERRA_MODPATH "${arg}")
endforeach ()
set (TERRA_MODPATH "${TERRA_MODPATH}" PARENT_SCOPE)
endfunction ()
function (add_terra_executable ARG_NAME)
if (ARGC LESS 2)
message (FATAL_ERROR "add_terra_executable(name, ...) requires at least one source")
endif ()
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
foreach (DIR IN LISTS dirs)
list (APPEND includedirs "-I")
list (APPEND includedirs "${DIR}")
endforeach ()
foreach (modpath IN LISTS TERRA_MODPATH)
list (APPEND includedirs "-m")
list (APPEND includedirs "${modpath}")
endforeach ()
foreach (file IN LISTS ARGN)
get_filename_component (ext "${file}" EXT)
if (ext STREQUAL ".t")
get_filename_component (fileabs "${file}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
file (TO_CMAKE_PATH "${fileabs}" fileabssrc)
file (RELATIVE_PATH filerel "${CMAKE_CURRENT_SOURCE_DIR}" "${fileabssrc}")
get_filename_component (output "${filerel}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}")
get_filename_component (filedir "${fileabs}" DIRECTORY)
message(STATUS "terra: ${output}.o")
add_custom_command (
OUTPUT "${output}.o"
COMMAND "$<TARGET_FILE:terrac>" ARGS -I "${filedir}" -P "${CMAKE_CURRENT_BINARY_DIR}" -D "${output}.d" -o "${output}.o" ${includedirs} "${fileabs}"
WORKING_DIRECTORY "${filedir}"
MAIN_DEPENDENCY "${fileabs}"
DEPFILE "${output}.d"
COMMENT "Terra: ${output}.o"
VERBATIM
COMMAND_EXPAND_LISTS)
list (APPEND link_sources "${output}.o")
else ()
list (APPEND compile_sources "${file}")
endif ()
endforeach ()
list (LENGTH compile_sources compile_sources_count)
if (compile_sources_count EQUAL 0)
message (FATAL_ERROR "add_terra_executable(name, ...) requires at least one non-terra source file (I know, I know...)")
endif ()
list (LENGTH link_sources link_sources_count)
add_executable ("${ARG_NAME}" ${compile_sources})
if (link_sources_count GREATER 0)
target_link_libraries ("${ARG_NAME}" ${link_sources})
add_custom_target ("${ARG_NAME}__terra"
DEPENDS "${link_sources}")
add_dependencies ("${ARG_NAME}" "${ARG_NAME}__terra")
add_dependencies ("${ARG_NAME}__terra" terrac)
endif ()
endfunction ()
Anyone have any preferences on how this gets distributed?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.