-
Notifications
You must be signed in to change notification settings - Fork 20
/
CMakeLists.txt
58 lines (50 loc) · 2.53 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
### Generic native Skirmish AI config
#
set(mySourceDirRel "src/") # Common values are "" or "src"
set(additionalSources ${CMAKE_SOURCE_DIR}/rts/System/StringUtil.cpp)
set(additionalSources ${additionalSources} ${CMAKE_SOURCE_DIR}/rts/System/Misc/SpringTime.cpp)
if (WIN32) # spring::condition_variable_any requirement
set(additionalSources ${additionalSources} ${CMAKE_SOURCE_DIR}/rts/System/Platform/Win/CriticalSection.cpp)
elseif (APPLE)
set(additionalSources ${additionalSources} ${CMAKE_SOURCE_DIR}/rts/System/Platform/Mac/Signal.cpp)
else ()
set(additionalSources ${additionalSources} ${CMAKE_SOURCE_DIR}/rts/System/Platform/Linux/Futex.cpp)
endif ()
set(additionalLibraries ${Cpp_AIWRAPPER_TARGET} CUtils)
#set(additionalLibraries ${Cpp_AIWRAPPER_TARGET} CUtils ${SDL2_LIBRARY})
#set(additionalCompileFlags "-Isrc/lib/ -Isrc/circuit/ -O1 -DDEBUG -DDEBUG_VIS -DDEBUG_LOG -Wall -Wextra -D_GLIBCXX_USE_CXX11_ABI=0")
if (CIRCUIT_DEBUG)
set(additionalCompileFlags "-DDEBUG_VIS -Wall")
# set(additionalCompileFlags "-DDEBUG_LOG -Wall -fsanitize=address -fno-omit-frame-pointer -fno-common -O1 -fno-strict-aliasing")
else ()
set(additionalCompileFlags "-Wall")
endif ()
#set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -static-libgcc -static-libstdc++ -lasan")
if (CIRCUIT_AS_JIT)
if (WIN32)
set(additionalSources ${additionalSources} platform/angelscript/jit/virtual_asm_windows.cpp)
elseif (APPLE)
set(additionalSources ${additionalSources} platform/angelscript/jit/virtual_asm_linux.cpp)
else ()
set(additionalSources ${additionalSources} platform/angelscript/jit/virtual_asm_linux.cpp)
endif ()
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(additionalSources ${additionalSources} platform/angelscript/jit/virtual_asm_x64.cpp)
else ()
set(additionalSources ${additionalSources} platform/angelscript/jit/virtual_asm_x86.cpp)
endif ()
set(additionalSources ${additionalSources} platform/angelscript/jit/as_jit.cpp)
set(additionalCompileFlags "${additionalCompileFlags} -DCIRCUIT_AS_JIT")
endif (CIRCUIT_AS_JIT)
if (BUILD_Cpp_AIWRAPPER)
include_directories(BEFORE
${Cpp_AIWRAPPER_INCLUDE_DIRS}
${SDL2_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/src/lib/
${CMAKE_CURRENT_SOURCE_DIR}/src/lib/angelscript/include/
${CMAKE_CURRENT_SOURCE_DIR}/src/circuit/
)
configure_native_skirmish_ai(mySourceDirRel additionalSources additionalCompileFlags additionalLibraries)
else (BUILD_Cpp_AIWRAPPER)
message ("warning: (New) C++ Circuit AI will not be built! (missing Cpp Wrapper)")
endif (BUILD_Cpp_AIWRAPPER)