Skip to content
Permalink
Browse files

Add release builds to Composite Engine.

  • Loading branch information...
andreduvoisin committed Mar 25, 2019
1 parent 6dddc1e commit 11520e38be151969461b45c4d52936339ef597e3
Showing with 120 additions and 113 deletions.
  1. +30 −12 .vscode/launch.json
  2. +76 −13 .vscode/tasks.json
  3. +2 −26 CMakeSettings.json
  4. +1 −1 README.md
  5. +3 −16 asset-converter/CMakeLists.txt
  6. +1 −0 cmake/CEF.cmake
  7. +4 −25 engine/CMakeLists.txt
  8. +3 −20 ui/CMakeLists.txt
@@ -5,26 +5,44 @@
"version": "0.2.0",
"configurations": [
{
"name": "Launch Composite Engine (Windows)",
"type": "cppvsdbg",
"name": "Composite Engine (Debug)",
"type": "cppdbg", // This must exist to appease VS Code even though it gets overwritten in the per-OS config.
"request": "launch",
"program": "${workspaceFolder}/install/CompositeEngine.exe",
"cwd": "${workspaceFolder}/install",
"externalConsole": false,
"stopAtEntry": false,
"preLaunchTask": "Build Composite Engine"
"preLaunchTask": "Build and Install (Debug)",
"windows": {
"type": "cppvsdbg",
"program": "${workspaceFolder}/install/Debug/CompositeEngine.exe",
"cwd": "${workspaceFolder}/install/Debug",
},
"osx": {
"type": "cppdbg",
"program": "${workspaceFolder}/install/Debug/CompositeEngine.app/Contents/MacOS/CompositeEngine",
"cwd": "${workspaceFolder}/install/Debug/CompositeEngine.app/Contents/MacOS",
"MIMode": "lldb",
"miDebuggerPath": "/Applications/Xcode.app/Contents/Developer/usr/bin/lldb-mi",
}
},
{
"name": "Launch Composite Engine (Mac)",
"type": "cppdbg",
"name": "Composite Engine (Release)",
"type": "cppdbg", // This must exist to appease VS Code even though it gets overwritten in the per-OS config.
"request": "launch",
"program": "${workspaceFolder}/install/CompositeEngine.app/Contents/MacOS/CompositeEngine",
"cwd": "${workspaceFolder}/install/CompositeEngine.app/Contents/MacOS",
"MIMode": "lldb",
"miDebuggerPath": "/Applications/Xcode.app/Contents/Developer/usr/bin/lldb-mi",
"externalConsole": false,
"stopAtEntry": false,
"preLaunchTask": "Build Composite Engine"
"preLaunchTask": "Build and Install (Release)",
"windows": {
"type": "cppvsdbg",
"program": "${workspaceFolder}/install/Release/CompositeEngine.exe",
"cwd": "${workspaceFolder}/install/Release",
},
"osx": {
"type": "cppdbg",
"program": "${workspaceFolder}/install/Release/CompositeEngine.app/Contents/MacOS/CompositeEngine",
"cwd": "${workspaceFolder}/install/Release/CompositeEngine.app/Contents/MacOS",
"MIMode": "lldb",
"miDebuggerPath": "/Applications/Xcode.app/Contents/Developer/usr/bin/lldb-mi",
}
}
]
}
@@ -4,52 +4,52 @@
"version": "2.0.0",
"tasks": [
{
"label": "Create Build Folder",
"label": "Make Build Directory (Debug)",
"type": "shell",
"command": "cmake",
"args": [
"-E",
"make_directory",
"build"
"build/Debug"
],
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "Create Install Folder",
"label": "Make Install Directory (Debug)",
"type": "shell",
"command": "cmake",
"args": [
"-E",
"make_directory",
"install"
"install/Debug"
],
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "Generate Composite Engine",
"label": "Generate (Debug)",
"type": "shell",
"command": "cmake",
"args": [
"-G",
"Ninja",
"-DCMAKE_BUILD_TYPE=\"Debug\"",
"-DCMAKE_INSTALL_PREFIX=\"${workspaceFolder}/install\"",
".."
"-DCMAKE_INSTALL_PREFIX=\"${workspaceFolder}/install/Debug\"",
"../.."
],
"options": {
"cwd": "${workspaceFolder}/build"
"cwd": "${workspaceFolder}/build/Debug"
},
"dependsOn": [
"Create Build Folder",
"Create Install Folder"
"Make Build Directory (Debug)",
"Make Install Directory (Debug)"
]
},
{
"label": "Build Composite Engine",
"label": "Build and Install (Debug)",
"type": "shell",
"command": "cmake",
"args": [
@@ -59,15 +59,78 @@
"install"
],
"options": {
"cwd": "${workspaceFolder}/build"
"cwd": "${workspaceFolder}/build/Debug"
},
"dependsOn": [
"Generate Composite Engine"
"Generate (Debug)"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Make Build Directory (Release)",
"type": "shell",
"command": "cmake",
"args": [
"-E",
"make_directory",
"build/Release"
],
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "Make Install Directory (Release)",
"type": "shell",
"command": "cmake",
"args": [
"-E",
"make_directory",
"install/Release"
],
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "Generate (Release)",
"type": "shell",
"command": "cmake",
"args": [
"-G",
"Ninja",
"-DCMAKE_BUILD_TYPE=\"Release\"",
"-DCMAKE_INSTALL_PREFIX=\"${workspaceFolder}/install/Release\"",
"../.."
],
"options": {
"cwd": "${workspaceFolder}/build/Release"
},
"dependsOn": [
"Make Build Directory (Release)",
"Make Install Directory (Release)"
]
},
{
"label": "Build and Install (Release)",
"type": "shell",
"command": "cmake",
"args": [
"--build",
".",
"--target",
"install"
],
"options": {
"cwd": "${workspaceFolder}/build/Release"
},
"dependsOn": [
"Generate (Release)"
],
"group": "build"
}
]
}
@@ -2,31 +2,7 @@
// See https://go.microsoft.com//fwlink//?linkid=834763 for more information about this file.
"configurations": [
{
"name": "x86-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x86" ],
"buildRoot": "${projectDir}\\build\\${name}",
"installRoot": "${projectDir}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"variables": []
},
{
"name": "x86-Release",
"generator": "Ninja",
"configurationType": "Release",
"inheritEnvironments": [ "msvc_x86" ],
"buildRoot": "${projectDir}\\build\\${name}",
"installRoot": "${projectDir}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"variables": []
},
{
"name": "x64-Debug",
"name": "Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64" ],
@@ -38,7 +14,7 @@
"variables": []
},
{
"name": "x64-Release",
"name": "Release",
"generator": "Ninja",
"configurationType": "Release",
"inheritEnvironments": [ "msvc_x64" ],
@@ -36,7 +36,7 @@ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

* Install the [C/C++ Extension from Microsoft](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools).

* On Windows, open with Developer Command Prompt.
* On Windows, open with `x64 Native Tools Command Prompt`.

#### All Platforms

@@ -1,24 +1,11 @@

if(${CMAKE_GENERATOR} STREQUAL "Ninja" OR ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
# By default Ninja and Make builds don't create a subdirectory named after
# the configuration.
set(CE_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")

# Output binaries (executables, libraries) to the correct directory.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CE_TARGET_OUT_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CE_TARGET_OUT_DIR})
else()
set(CE_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>")
endif()

add_executable(CompositeAssetConverter ${ASSET_CONVERTER_SRC_FILES})

target_link_libraries(CompositeAssetConverter PRIVATE FBXSDK GLM STB)

source_group(TREE ${CMAKE_SOURCE_DIR} FILES ${ASSET_CONVERTER_SRC_FILES})

target_include_directories(CompositeAssetConverter PRIVATE ${ASSET_CONVERTER_SRC_DIR})
target_include_directories(CompositeAssetConverter PRIVATE ${ENGINE_SRC_DIR})
target_link_libraries(CompositeAssetConverter PRIVATE FBXSDK GLM STB)

target_include_directories(CompositeAssetConverter PRIVATE ${ASSET_CONVERTER_SRC_DIR} ${ENGINE_SRC_DIR})

if(OS_WINDOWS)
target_compile_options(CompositeAssetConverter PRIVATE /W3 /WX)
@@ -70,6 +70,7 @@ ExternalProject_Add(
# Sandbox Reference: https://magpcss.org/ceforum/viewtopic.php?f=6&t=15482
CMAKE_ARGS
-DCMAKE_MAKE_PROGRAM=ninja
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCEF_RUNTIME_LIBRARY_FLAG=/MD
-DUSE_SANDBOX=OFF

@@ -1,34 +1,13 @@

if(OS_MACOSX)
set(COMPOSITE_ENGINE_EXECUTABLE_ARGS MACOSX_BUNDLE)
endif()

if(${CMAKE_GENERATOR} STREQUAL "Ninja" OR ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
# By default Ninja and Make builds don't create a subdirectory named after
# the configuration.
set(CE_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
add_executable(CompositeEngine MACOSX_BUNDLE ${ENGINE_SRC_FILES})

# Output binaries (executables, libraries) to the correct directory.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CE_TARGET_OUT_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CE_TARGET_OUT_DIR})
else()
set(CE_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>")
endif()
source_group(TREE ${CMAKE_SOURCE_DIR} FILES ${ENGINE_SRC_FILES})

add_executable(CompositeEngine ${COMPOSITE_ENGINE_EXECUTABLE_ARGS} ${ENGINE_SRC_FILES})

add_dependencies(
CompositeEngine
CompositeCefSubprocess
)
add_dependencies(CompositeEngine CompositeCefSubprocess)

target_link_libraries(CompositeEngine PRIVATE CEF GLEW GLM OpenGL RapidJSON SDL)

source_group(TREE ${CMAKE_SOURCE_DIR} FILES ${ENGINE_SRC_FILES})

include_directories(${ENGINE_SRC_DIR})
include_directories(${UI_SRC_DIR})

target_include_directories(CompositeEngine PRIVATE ${ENGINE_SRC_DIR} ${UI_SRC_DIR})

if(OS_WINDOWS)
target_compile_options(CompositeEngine PRIVATE /W3 /WX)
@@ -1,28 +1,11 @@

if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
set(COMPOSITE_CEF_SUBPROCESS_EXECUTABLE_ARGS MACOSX_BUNDLE)
endif()

# TODO: Is this needed?
if(${CMAKE_GENERATOR} STREQUAL "Ninja" OR ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
# By default Ninja and Make builds don't create a subdirectory named after
# the configuration.
set(CE_CEF_SUBPROCESS_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")

# Output binaries (executables, libraries) to the correct directory.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CE_CEF_SUBPROCESS_TARGET_OUT_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CE_CEF_SUBPROCESS_TARGET_OUT_DIR})
else()
set(CE_CEF_SUBPROCESS_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>")
endif()
add_executable(CompositeCefSubprocess ${CEF_SUBPROCESS_SRC_FILES})

add_executable(CompositeCefSubprocess ${COMPOSITE_CEF_SUBPROCESS_EXECUTABLE_ARGS} ${CEF_SUBPROCESS_SRC_FILES})
source_group(TREE ${CMAKE_SOURCE_DIR} FILES ${CEF_SUBPROCESS_SRC_FILES})

target_link_libraries(CompositeCefSubprocess PRIVATE CEF)

source_group(TREE ${CMAKE_SOURCE_DIR} FILES ${CEF_SUBPROCESS_SRC_FILES})

include_directories(${CEF_SUBPROCESS_SRC_DIR})
target_include_directories(CompositeCefSubprocess PRIVATE ${CEF_SUBPROCESS_SRC_DIR})

if(OS_WINDOWS)
target_compile_options(CompositeCefSubprocess PRIVATE /W3 /WX)

0 comments on commit 11520e3

Please sign in to comment.
You can’t perform that action at this time.