Преглед изворни кода

luajit implemented, new test added

mikymod пре 12 година
родитељ
комит
5a18a38eb2

+ 12 - 10
CMakeLists.txt

@@ -35,7 +35,7 @@ set (INCLUDES
 )
 
 include_directories(${INCLUDES})
-add_definitions(-pipe -ansi -W -Wall -Wextra -Wno-long-long -pedantic -fPIC -g -pg -llua)
+add_definitions(-pipe -ansi -W -Wall -Wextra -Wno-long-long -pedantic -fPIC -g -pg)
 
 # detect operating system
 if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
@@ -48,6 +48,17 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
 	add_subdirectory(src/os/win)
 endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
 
+#detect architecture
+if (CROWN_ARCH MATCHES "x86")
+	set (CROWN_THIRD third/x86)
+endif (CROWN_ARCH MATCHES "x86")
+
+if (CROWN_ARCH MATCHES "x86_64")
+	set (CROWN_THIRD third/x86_64)
+endif (CROWN_ARCH MATCHES "x86_64")
+
+add_subdirectory(${CROWN_THIRD})
+
 # add build directories
 add_subdirectory(src)
 
@@ -71,16 +82,7 @@ if (CROWN_BUILD_TESTS)
 	add_subdirectory(tests)
 endif (CROWN_BUILD_TESTS)
 
-#detect architecture
-if (CROWN_ARCH MATCHES "x86")
-	set (CROWN_THIRD third/x86)
-endif (CROWN_ARCH MATCHES "x86")
-
-if (CROWN_ARCH MATCHES "x86_64")
-	set (CROWN_THIRD third/x86_64)
-endif (CROWN_ARCH MATCHES "x86_64")
 
-add_subdirectory(${CROWN_THIRD})
 
 
 

+ 4 - 4
tests/CMakeLists.txt

@@ -22,9 +22,10 @@ target_link_libraries(compressors crown)
 target_link_libraries(connections crown)
 target_link_libraries(strings crown)
 target_link_libraries(paths crown)
-<<<<<<< HEAD
-target_link_libraries(script crown)
-=======
+
+link_directories(${CROWN_THIRD}/luajit/lib)
+include_directories(${CROWN_THIRD}/luajit/include)
+target_link_libraries(script crown lua m)
 
 add_test(allocators-test ${EXECUTABLE_OUTPUT_PATH}/allocators)
 add_test(containers-test containers)
@@ -33,4 +34,3 @@ add_test(compressors-test compressors)
 add_test(connections-test connections)
 add_test(strings-test strings)
 add_test(paths-test paths)
->>>>>>> master

+ 5 - 2
tests/script.cpp

@@ -18,7 +18,9 @@ int main ()
 
     /* Load the file containing the script we are going to run */
     status = luaL_loadfile(L, "hello.lua");
-    if (status) {
+
+    if (status) 
+    {
         /* If something went wrong, error message is at the top of */
         /* the stack */
         fprintf(stderr, "Couldn't load file: %s\n", lua_tostring(L, -1));
@@ -47,7 +49,8 @@ int main ()
      * of the stack, so that after it has been called, the table is at the
      * top of the stack.
      */
-    for (i = 1; i <= 5; i++) {
+    for (i = 1; i <= 5; i++) 
+    {
         lua_pushnumber(L, i);   /* Push the table index */
         lua_pushnumber(L, i*2); /* Push the cell value */
         lua_rawset(L, -3);      /* Stores the pair in the table */

+ 1 - 1
third/x86_64/CMakeLists.txt

@@ -5,7 +5,7 @@ install (FILES 	luajit/include/luajit-2.0/lua.hpp
 				luajit/include/luajit-2.0/lua.h
 				luajit/include/luajit-2.0/luaconf.h
 				luajit/include/luajit-2.0/luajit.h
-				luajit/include/luajit-2.0/lualib.h DESTINATION include/crown)
+				luajit/include/luajit-2.0/lualib.h DESTINATION include/crown/luajit)
 				
 install (DIRECTORY luajit/lib/lua
 				   luajit/lib/pkgconfig DESTINATION lib/crown)

+ 0 - 1
third/x86_64/luajit/lib/libluajit-5.1.so

@@ -1 +0,0 @@
-libluajit-5.1.so.2.0.1

+ 0 - 1
third/x86_64/luajit/lib/libluajit-5.1.so.2

@@ -1 +0,0 @@
-libluajit-5.1.so.2.0.1