changeset 43:b94d72292dfa

fix build arm asm file
author anatofuz
date Sat, 02 Mar 2019 19:28:23 +0900
parents 997c54d8912c
children 94ca6db2ee9c 5f19e9554c30
files src/CMakeLists.txt
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/CMakeLists.txt	Sat Mar 02 19:06:28 2019 +0900
+++ b/src/CMakeLists.txt	Sat Mar 02 19:28:23 2019 +0900
@@ -1,11 +1,14 @@
 cmake_minimum_required(VERSION 3.8)
+project(xv6cbc C ASM)
 
 set(USE_CUDA,0)
 # -DUSE_CUDA
 #  add_definitions("-Wall -g -O")
 
 set(CMAKE_C_COMPILER $ENV{CBC_COMPILER})
-add_definitions("-Wall -g")
+add_definitions("-Wall -g -arch arm -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -Werror -I. -g -O0 
+         -Wno-macro-redefined -Wno-gnu-designator -Wno-sometimes-uninitialized -Wno-tautological-compare 
+         -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include")
 
 # -DCMAKE_BUILD_TYPE=Debug
 set(CMAKE_C_FLAGS_DEBUG "-O0")
@@ -30,6 +33,7 @@
     set( _MULTI_VALUE_ARGS SOURCES )
     cmake_parse_arguments( _Gears "${_OPTIONS_ARGS}" "${_ONE_VALUE_ARGS}" "${_MULTI_VALUE_ARGS}" ${ARGN} )
 
+    set (_Gears_CBC_SOURCES)
     set (_Gears_CSOURCES)
     foreach(i ${_Gears_SOURCES})
         if (${i} MATCHES "\\.cbc")
@@ -39,7 +43,7 @@
                 DEPENDS   ${i}
                 COMMAND  "perl" "gearsTools/generate_stub.pl" "-o" ${j} ${i}
             )
-            list(APPEND _Gears_CSOURCES ${j})
+            list(APPEND _Gears_CBC_SOURCES ${j})
         elseif (${i} MATCHES "\\.cu")
             string(REGEX REPLACE "(.*).cu" "c/\\1.ptx" j ${i})
             add_custom_command (
@@ -47,18 +51,19 @@
                 DEPENDS   ${i}
                 COMMAND  nvcc ${NVCCFLAG} -c -ptx -o ${j} ${i}
             )
-            list(APPEND _Gears_CSOURCES ${j})
+            list(APPEND _Gears_CBC_SOURCES ${j})
         else()
             set(j ${i})
+            list(APPEND _Gears_CSOURCES ${j})
         endif()
     endforeach(i)
 
     add_custom_command (
           OUTPUT    c/${_Gears_TARGET}-context.c
-          DEPENDS   ${_Gears_CSOURCES}
-          COMMAND  "perl" "gearsTools/generate_context.pl" "-o" ${_Gears_TARGET} ${_Gears_CSOURCES}
+          DEPENDS   ${_Gears_CBC_SOURCES}
+          COMMAND  "perl" "gearsTools/generate_context.pl" "-o" ${_Gears_TARGET} ${_Gears_CBC_SOURCES}
     )
-    add_executable(${_Gears_TARGET} ${_Gears_CSOURCES} c/${_Gears_TARGET}-context.c)
+    add_executable(${_Gears_TARGET} ${_Gears_CBC_SOURCES} ${_Gears_CSOURCES} c/${_Gears_TARGET}-context.c)
     target_link_libraries(${_Gears_TARGET} m pthread)
 endmacro()