Skip to content

Commit

Permalink
CMake: add Release/Debug swith, fixed luajit linking
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleivg committed Aug 2, 2018
1 parent 9d9b1e7 commit bbf2b50
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,19 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive --std=c++17")

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
set(LUA_LIBRARIES luajit)
elseif(${CMAKE_BUILD_TYPE} STREQUAL "RELWITHDEBINFO")
set(LUA_LIBRARIES luajit)
else()
set(LUA_LIBRARIES luajit-debug)
endif()

message("CMake build ${CMAKE_BUILD_TYPE}")

add_definitions(-D_MT -D_CPPUNWIND -DPURE_DYNAMIC_CAST -DDECLARE_SPECIALIZATION -DM_NOSTDCONTAINERS_EXT -DUSE_OGL)

set(LUA_INCLUDE_DIR Externals/LuaJIT/src)
set(LUA_LIBRARIES luajit)

set(LUA_FOUND 1)
if (NOT WIN32)
find_package(Crypto++ REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion src/xrAICore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ add_definitions(-DXRAICORE_EXPORTS -DAI_COMPILER -D_SECURE_SCL=0)
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}__SOURCES} ${${PROJECT_NAME}__INCLUDES})

set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} xrCore xrMiscMath xrAPI xrScriptEngine luabind luajit)
target_link_libraries(${PROJECT_NAME} xrCore xrMiscMath xrAPI xrScriptEngine luabind ${LUA_LIBRARIES})
2 changes: 1 addition & 1 deletion src/xrEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ add_definitions(-DENGINE_BUILD)
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}__SOURCES} ${${PROJECT_NAME}__INCLUDES})

set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} xrCore xrMiscMath luabind xrAPI xrSound xrScriptEngine luajit theora ${OGG_LIBRARIES} xrCDB xrPhysics freeimage openal lockfile ${SDL_LIBRARIES})
target_link_libraries(${PROJECT_NAME} xrCore xrMiscMath luabind xrAPI xrSound xrScriptEngine ${LUA_LIBRARIES} theora ${OGG_LIBRARIES} xrCDB xrPhysics freeimage openal lockfile ${SDL_LIBRARIES})
2 changes: 1 addition & 1 deletion src/xrScriptEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}__SOURCES} ${${PROJECT_NAME}__INCLUDES})

set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_link_libraries(${PROJECT_NAME} xrAPI xrCore luabind luajit)
target_link_libraries(${PROJECT_NAME} xrAPI xrCore luabind ${LUA_LIBRARIES})

0 comments on commit bbf2b50

Please sign in to comment.