8004
|
1 |
|
|
2 |
if(CLANG)
|
|
3 |
set(clang_executable ${CLANG})
|
|
4 |
else()
|
8023
|
5 |
find_program(clang_executable
|
|
6 |
NAMES clang-mp-3.2 clang-mp-3.1 clang-mp-3.0 clang
|
|
7 |
PATHS /opt/local/bin /usr/local/bin /usr/bin)
|
8004
|
8 |
endif()
|
|
9 |
|
|
10 |
if (clang_executable)
|
|
11 |
exec_program(${clang_executable} ARGS "-v" OUTPUT_VARIABLE clang_version_full)
|
|
12 |
string(REGEX MATCH "[0-9]+\\.[0-9]+" clang_version_long "${clang_version_full}")
|
|
13 |
string(REGEX REPLACE "([0-9]+\\.[0-9]+)" "\\1" clang_version "${clang_version_long}")
|
8008
|
14 |
#TODO: check version >= 3.0
|
8004
|
15 |
message(STATUS "Found CLANG: ${clang_executable} (version ${clang_version})")
|
|
16 |
else()
|
|
17 |
message(FATAL_ERROR "No LLVM/Clang compiler found (required for engine_c target)")
|
|
18 |
endif()
|
|
19 |
|
8006
|
20 |
set(CMAKE_C_COMPILER ${clang_executable})
|
|
21 |
|
8004
|
22 |
|
|
23 |
find_package(GLEW REQUIRED)
|
|
24 |
|
|
25 |
|
8006
|
26 |
configure_file(${hedgewars_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc)
|
7999
|
27 |
|
|
28 |
|
|
29 |
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/hwengine.c"
|
|
30 |
COMMAND "${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}"
|
8006
|
31 |
ARGS -n hwengine
|
|
32 |
-i "${hedgewars_SOURCE_DIR}/hedgewars"
|
8008
|
33 |
#-i "~/xymengxy-webport/hedgewars"
|
8006
|
34 |
-o "${CMAKE_CURRENT_BINARY_DIR}"
|
|
35 |
-a "${CMAKE_CURRENT_BINARY_DIR}"
|
7999
|
36 |
DEPENDS pas2c
|
8006
|
37 |
)
|
7999
|
38 |
|
|
39 |
add_custom_target(engine_c ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/hwengine.c")
|
|
40 |
|
8006
|
41 |
|
7999
|
42 |
add_subdirectory(rtl)
|
|
43 |
|
8004
|
44 |
include_directories("${GLEW_INCLUDE_PATH}")
|
|
45 |
include_directories(rtl)
|
7999
|
46 |
|
8006
|
47 |
set(engine_src uDebug.c uLandTexture.c
|
|
48 |
LuaPas.c uFloat.c uLocale.c
|
|
49 |
SDLh.c uGame.c uMisc.c
|
|
50 |
adler32.c uGears.c uMobile.c
|
|
51 |
hwengine.c uGearsHandlers.c uRandom.c
|
|
52 |
uAI.c uGearsHandlersRope.c uRender.c
|
|
53 |
uAIActions.c uGearsHedgehog.c uRenderUtils.c
|
|
54 |
uAIAmmoTests.c uGearsList.c uScript.c
|
|
55 |
uAILandMarks.c uGearsRender.c uSinTable.c
|
|
56 |
uAIMisc.c uGearsUtils.c uSound.c
|
|
57 |
uAmmos.c uIO.c uStats.c
|
|
58 |
uCaptions.c uInputHandler.c uStore.c
|
|
59 |
uChat.c uLand.c uTeams.c
|
|
60 |
uCollisions.c uLandGenMaze.c uTextures.c
|
|
61 |
uCommandHandlers.c uLandGraphics.c uTypes.c
|
|
62 |
uCommands.c uLandObjects.c uUtils.c
|
|
63 |
uConsole.c uLandOutline.c uVariables.c
|
|
64 |
uConsts.c uLandPainted.c uVisualGears.c
|
|
65 |
uCursor.c uLandTemplates.c uWorld.c
|
|
66 |
)
|
|
67 |
|
|
68 |
set(engine_hdr uGame.h uFloat.h
|
|
69 |
uLocale.h SDLh.h uMisc.h
|
|
70 |
adler32.h uDebug.h uLandTexture.h
|
|
71 |
LuaPas.h uGears.h uMobile.h
|
|
72 |
uAI.h uGearsHandlersRope.h uRender.h
|
|
73 |
uAIActions.h uGearsHedgehog.h uRenderUtils.h
|
|
74 |
uAIAmmoTests.h uGearsList.h uScript.h
|
|
75 |
uGearsHandlers.h uRandom.h
|
|
76 |
uAILandMarks.h uGearsRender.h uSinTable.h
|
|
77 |
uAIMisc.h uGearsUtils.h uSound.h
|
|
78 |
uAmmos.h uIO.h uStats.h
|
|
79 |
uCaptions.h uInputHandler.h uStore.h
|
|
80 |
uChat.h uLand.h uTeams.h
|
|
81 |
uCollisions.h uLandGenMaze.h uTextures.h
|
|
82 |
uCommandHandlers.h uLandGraphics.h uTypes.h
|
|
83 |
uCommands.h uLandObjects.h uUtils.h
|
|
84 |
uConsole.h uLandOutline.h uVariables.h
|
|
85 |
uConsts.h uLandPainted.h uVisualGears.h
|
|
86 |
uCursor.h uLandTemplates.h uWorld.h
|
|
87 |
)
|
|
88 |
|
7999
|
89 |
add_executable(hwengine WIN32 ${engine_src})
|
|
90 |
add_dependencies(hwengine engine_c fpcrtl)
|
8006
|
91 |
|