diff options
author | 2020-11-11 21:07:19 -0800 | |
---|---|---|
committer | 2020-11-11 21:07:19 -0800 | |
commit | 09600801287ee5f219c4389688f81ec3b5ab5404 (patch) | |
tree | d214e5968641f9373392a2503132e032d37375ec /src/com | |
parent | f6cdbabe1cd74616b2d88cce211bd95f21098b12 (diff) | |
download | crafting-interpreters-09600801287ee5f219c4389688f81ec3b5ab5404.tar.gz crafting-interpreters-09600801287ee5f219c4389688f81ec3b5ab5404.zip |
Split CMake project into several files
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/craftinginterpreters/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/com/craftinginterpreters/lox/.gitignore | 1 | ||||
-rw-r--r-- | src/com/craftinginterpreters/lox/CMakeLists.txt | 16 | ||||
-rw-r--r-- | src/com/craftinginterpreters/tool/CMakeLists.txt | 3 |
4 files changed, 22 insertions, 0 deletions
diff --git a/src/com/craftinginterpreters/CMakeLists.txt b/src/com/craftinginterpreters/CMakeLists.txt new file mode 100644 index 0000000..959eedd --- /dev/null +++ b/src/com/craftinginterpreters/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(tool) +add_subdirectory(lox) diff --git a/src/com/craftinginterpreters/lox/.gitignore b/src/com/craftinginterpreters/lox/.gitignore new file mode 100644 index 0000000..0260b11 --- /dev/null +++ b/src/com/craftinginterpreters/lox/.gitignore @@ -0,0 +1 @@ +Expr.java diff --git a/src/com/craftinginterpreters/lox/CMakeLists.txt b/src/com/craftinginterpreters/lox/CMakeLists.txt new file mode 100644 index 0000000..d2807e6 --- /dev/null +++ b/src/com/craftinginterpreters/lox/CMakeLists.txt @@ -0,0 +1,16 @@ +get_target_property(GENERATE_AST_JAR GenerateAst JAR_FILE) + +set(EXPR_JAVA_FILENAME ${CMAKE_CURRENT_BINARY_DIR}/Expr.java CACHE INTERNAL "") + +add_custom_command(OUTPUT ${EXPR_JAVA_FILENAME} + COMMAND java -jar ${GENERATE_AST_JAR} ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS GenerateAst) + +add_jar(Lox + Lox.java + TokenType.java + Token.java + Scanner.java + ${EXPR_JAVA_FILENAME} + AstPrinter.java + ENTRY_POINT com/craftinginterpreters/lox/Lox) diff --git a/src/com/craftinginterpreters/tool/CMakeLists.txt b/src/com/craftinginterpreters/tool/CMakeLists.txt new file mode 100644 index 0000000..b98d2eb --- /dev/null +++ b/src/com/craftinginterpreters/tool/CMakeLists.txt @@ -0,0 +1,3 @@ +add_jar(GenerateAst + GenerateAst.java + ENTRY_POINT com/craftinginterpreters/tool/GenerateAst) |