|
|
1.1 root 1:
2: include_directories(. ../.. ../includes ${SDL_INCLUDE_DIR})
3:
4: # Unfortunately we've got to specify the rules for the generated files twice,
5: # once for cross compiling (with calling the host cc directly) and once
6: # for native compiling so that the rules also work for non-Unix environments...
7: if(CMAKE_CROSSCOMPILING)
8:
9: add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/build68k
10: COMMAND cc ${CMAKE_CURRENT_SOURCE_DIR}/build68k.c
11: -o ${CMAKE_CURRENT_BINARY_DIR}/build68k
12: DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/build68k.c)
13:
14: add_custom_command(OUTPUT cpudefs.c
15: COMMAND ./build68k < ${CMAKE_CURRENT_SOURCE_DIR}/table68k >cpudefs.c
16: DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/table68k
17: ${CMAKE_CURRENT_BINARY_DIR}/build68k)
18:
19: add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/gencpu
20: COMMAND cc -I${CMAKE_CURRENT_SOURCE_DIR}
21: cpudefs.c ${CMAKE_CURRENT_SOURCE_DIR}/gencpu.c
22: ${CMAKE_CURRENT_SOURCE_DIR}/readcpu.c
23: -o ${CMAKE_CURRENT_BINARY_DIR}/gencpu
24: DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gencpu.c
25: ${CMAKE_CURRENT_SOURCE_DIR}/readcpu.c cpudefs.c)
26:
27: add_custom_command(OUTPUT cpuemu.c cpustbl.c
28: COMMAND ${CMAKE_CURRENT_BINARY_DIR}/gencpu
29: DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/gencpu)
30:
31: else() # Rules for normal build follow
32:
33: add_executable(build68k build68k.c)
34:
35: get_target_property(BUILD68K_EXE build68k LOCATION)
36: add_custom_command(OUTPUT cpudefs.c
37: COMMAND ${BUILD68K_EXE} < ${CMAKE_CURRENT_SOURCE_DIR}/table68k >cpudefs.c
38: DEPENDS table68k build68k)
39:
40: add_executable(gencpu gencpu.c readcpu.c cpudefs.c)
41:
42: get_target_property(GENCPU_EXE gencpu LOCATION)
43: add_custom_command(OUTPUT cpuemu.c cpustbl.c
44: COMMAND ${GENCPU_EXE} DEPENDS gencpu)
45:
46: endif(CMAKE_CROSSCOMPILING)
47:
48:
49: # Generated cpuemu.c contains a lot of warnings we don't really care about...
1.1.1.2 ! root 50: if(CMAKE_COMPILER_IS_GNUCC)
! 51: set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-sign-compare -Wno-shadow")
! 52: set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-variable -Wno-unused-label")
! 53: endif(CMAKE_COMPILER_IS_GNUCC)
1.1 root 54:
55: add_library(UaeCpu
56: cpudefs.c cpuemu.c cpustbl.c
57: hatari-glue.c memory.c newcpu.c readcpu.c fpp.c
58: )
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.