Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add initial cmake script (only builds parts of the code)
- Loading branch information
1 parent
41cb6fa
commit d248ad5
Showing
16 changed files
with
139 additions
and
1 deletion.
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
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,28 @@ | ||
# NOTE that this CMake file doesn't current build all of avian. | ||
# It only builds what's required for example/kaleidoscope. | ||
|
||
cmake_minimum_required (VERSION 2.6) | ||
project (avian) | ||
|
||
include_directories (include src) | ||
|
||
add_definitions ( | ||
-DAVIAN_TARGET_FORMAT=AVIAN_FORMAT_MACHO | ||
|
||
-DAVIAN_TARGET_ARCH=AVIAN_ARCH_X86_64 | ||
|
||
-DTARGET_BYTES_PER_WORD=8 | ||
-D__STDC_LIMIT_MACROS | ||
-D__STDC_CONSTANT_MACROS | ||
) | ||
|
||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -fno-exceptions") | ||
|
||
include ("cmake/Platform.cmake") | ||
include (CTest) | ||
|
||
# Sadly, we can't use the 'test' target, as that's coopted by ctest | ||
add_custom_target(check ${CMAKE_CTEST_COMMAND} -V) | ||
|
||
add_subdirectory (src) | ||
add_subdirectory (unittest) |
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,8 @@ | ||
IF (APPLE) | ||
INCLUDE_DIRECTORIES ( /Developer/Headers/FlatCarbon ) | ||
FIND_LIBRARY(CORE_FOUNDATION_LIBRARY CoreFoundation) | ||
|
||
MARK_AS_ADVANCED (CORE_FOUNDATION_LIBRARY) | ||
|
||
SET(PLATFORM_LIBS ${CORE_FOUNDATION_LIBRARY}) | ||
ENDIF() |
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,7 @@ | ||
add_subdirectory(codegen) | ||
add_subdirectory(system) | ||
add_subdirectory(heap) | ||
add_subdirectory(util) | ||
add_subdirectory(tools) | ||
|
||
add_library(avian_jvm_finder finder.cpp) |
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,19 @@ | ||
add_library (avian_codegen | ||
compiler.cpp | ||
registers.cpp | ||
runtime.cpp | ||
targets.cpp | ||
|
||
compiler/context.cpp | ||
compiler/event.cpp | ||
compiler/frame.cpp | ||
compiler/ir.cpp | ||
compiler/promise.cpp | ||
compiler/read.cpp | ||
compiler/regalloc.cpp | ||
compiler/resource.cpp | ||
compiler/site.cpp | ||
compiler/value.cpp | ||
) | ||
|
||
add_subdirectory(target) |
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,2 @@ | ||
add_subdirectory(arm) | ||
add_subdirectory(x86) |
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,8 @@ | ||
add_library(avian_codegen_arm | ||
assembler.cpp | ||
block.cpp | ||
context.cpp | ||
fixup.cpp | ||
multimethod.cpp | ||
operations.cpp | ||
) |
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,11 @@ | ||
add_library(avian_codegen_x86 | ||
assembler.cpp | ||
block.cpp | ||
context.cpp | ||
detect.cpp | ||
encode.cpp | ||
fixup.cpp | ||
multimethod.cpp | ||
operations.cpp | ||
padding.cpp | ||
) |
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,2 @@ | ||
|
||
add_library(avian_heap heap.cpp) |
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,3 @@ | ||
|
||
# TODO: use posix.cpp or windows.cpp, depending on platform | ||
add_library(avian_system posix.cpp posix/crash.cpp) |
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,3 @@ | ||
add_subdirectory(binary-to-object) | ||
add_subdirectory(object-writer) | ||
add_subdirectory(type-generator) |
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,3 @@ | ||
add_executable(binary_to_object main.cpp) | ||
|
||
target_link_libraries(binary_to_object object_writer) |
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,6 @@ | ||
add_library(object_writer | ||
elf.cpp | ||
mach-o.cpp | ||
pe.cpp | ||
tools.cpp | ||
) |
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,11 @@ | ||
add_executable(type_generator main.cpp) | ||
|
||
target_link_libraries(type_generator | ||
avian_jvm_finder | ||
avian_system | ||
avian_util | ||
z | ||
pthread | ||
dl | ||
${PLATFORM_LIBS} | ||
) |
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 @@ | ||
add_library(avian_util arg-parser.cpp fixed-allocator.cpp) |
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,25 @@ | ||
|
||
include_directories (${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
add_executable (avian_unittest | ||
test-harness.cpp | ||
|
||
codegen/assembler-test.cpp | ||
codegen/registers-test.cpp | ||
|
||
util/arg-parser-test.cpp | ||
) | ||
|
||
target_link_libraries (avian_unittest | ||
avian_codegen | ||
avian_codegen_x86 | ||
avian_system | ||
avian_heap | ||
avian_util | ||
pthread | ||
dl | ||
${PLATFORM_LIBS} | ||
) | ||
|
||
add_test(NAME avian_unittest COMMAND avian_unittest) | ||
add_dependencies(check avian_unittest) |