Skip to content

Commit

Permalink
Add release builds to Composite Engine.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreduvoisin committed Mar 25, 2019
1 parent 6dddc1e commit 11520e3
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 113 deletions.
42 changes: 30 additions & 12 deletions .vscode/launch.json
Expand Up @@ -5,26 +5,44 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "Launch Composite Engine (Windows)", "name": "Composite Engine (Debug)",
"type": "cppvsdbg", "type": "cppdbg", // This must exist to appease VS Code even though it gets overwritten in the per-OS config.
"request": "launch", "request": "launch",
"program": "${workspaceFolder}/install/CompositeEngine.exe",
"cwd": "${workspaceFolder}/install",
"externalConsole": false, "externalConsole": false,
"stopAtEntry": 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)", "name": "Composite Engine (Release)",
"type": "cppdbg", "type": "cppdbg", // This must exist to appease VS Code even though it gets overwritten in the per-OS config.
"request": "launch", "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, "externalConsole": false,
"stopAtEntry": 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",
}
} }
] ]
} }
89 changes: 76 additions & 13 deletions .vscode/tasks.json
Expand Up @@ -4,52 +4,52 @@
"version": "2.0.0", "version": "2.0.0",
"tasks": [ "tasks": [
{ {
"label": "Create Build Folder", "label": "Make Build Directory (Debug)",
"type": "shell", "type": "shell",
"command": "cmake", "command": "cmake",
"args": [ "args": [
"-E", "-E",
"make_directory", "make_directory",
"build" "build/Debug"
], ],
"options": { "options": {
"cwd": "${workspaceFolder}" "cwd": "${workspaceFolder}"
} }
}, },
{ {
"label": "Create Install Folder", "label": "Make Install Directory (Debug)",
"type": "shell", "type": "shell",
"command": "cmake", "command": "cmake",
"args": [ "args": [
"-E", "-E",
"make_directory", "make_directory",
"install" "install/Debug"
], ],
"options": { "options": {
"cwd": "${workspaceFolder}" "cwd": "${workspaceFolder}"
} }
}, },
{ {
"label": "Generate Composite Engine", "label": "Generate (Debug)",
"type": "shell", "type": "shell",
"command": "cmake", "command": "cmake",
"args": [ "args": [
"-G", "-G",
"Ninja", "Ninja",
"-DCMAKE_BUILD_TYPE=\"Debug\"", "-DCMAKE_BUILD_TYPE=\"Debug\"",
"-DCMAKE_INSTALL_PREFIX=\"${workspaceFolder}/install\"", "-DCMAKE_INSTALL_PREFIX=\"${workspaceFolder}/install/Debug\"",
".." "../.."
], ],
"options": { "options": {
"cwd": "${workspaceFolder}/build" "cwd": "${workspaceFolder}/build/Debug"
}, },
"dependsOn": [ "dependsOn": [
"Create Build Folder", "Make Build Directory (Debug)",
"Create Install Folder" "Make Install Directory (Debug)"
] ]
}, },
{ {
"label": "Build Composite Engine", "label": "Build and Install (Debug)",
"type": "shell", "type": "shell",
"command": "cmake", "command": "cmake",
"args": [ "args": [
Expand All @@ -59,15 +59,78 @@
"install" "install"
], ],
"options": { "options": {
"cwd": "${workspaceFolder}/build" "cwd": "${workspaceFolder}/build/Debug"
}, },
"dependsOn": [ "dependsOn": [
"Generate Composite Engine" "Generate (Debug)"
], ],
"group": { "group": {
"kind": "build", "kind": "build",
"isDefault": true "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"
} }
] ]
} }
28 changes: 2 additions & 26 deletions CMakeSettings.json
Expand Up @@ -2,31 +2,7 @@
// See https://go.microsoft.com//fwlink//?linkid=834763 for more information about this file. // See https://go.microsoft.com//fwlink//?linkid=834763 for more information about this file.
"configurations": [ "configurations": [
{ {
"name": "x86-Debug", "name": "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",
"generator": "Ninja", "generator": "Ninja",
"configurationType": "Debug", "configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64" ], "inheritEnvironments": [ "msvc_x64" ],
Expand All @@ -38,7 +14,7 @@
"variables": [] "variables": []
}, },
{ {
"name": "x64-Release", "name": "Release",
"generator": "Ninja", "generator": "Ninja",
"configurationType": "Release", "configurationType": "Release",
"inheritEnvironments": [ "msvc_x64" ], "inheritEnvironments": [ "msvc_x64" ],
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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). * 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 #### All Platforms


Expand Down
19 changes: 3 additions & 16 deletions asset-converter/CMakeLists.txt
@@ -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}) 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}) source_group(TREE ${CMAKE_SOURCE_DIR} FILES ${ASSET_CONVERTER_SRC_FILES})


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


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


Expand Down
29 changes: 4 additions & 25 deletions engine/CMakeLists.txt
@@ -1,34 +1,13 @@


if(OS_MACOSX) add_executable(CompositeEngine MACOSX_BUNDLE ${ENGINE_SRC_FILES})
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}")


# Output binaries (executables, libraries) to the correct directory. source_group(TREE ${CMAKE_SOURCE_DIR} FILES ${ENGINE_SRC_FILES})
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(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) target_link_libraries(CompositeEngine PRIVATE CEF GLEW GLM OpenGL RapidJSON SDL)


source_group(TREE ${CMAKE_SOURCE_DIR} FILES ${ENGINE_SRC_FILES}) target_include_directories(CompositeEngine PRIVATE ${ENGINE_SRC_DIR} ${UI_SRC_DIR})

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



if(OS_WINDOWS) if(OS_WINDOWS)
target_compile_options(CompositeEngine PRIVATE /W3 /WX) target_compile_options(CompositeEngine PRIVATE /W3 /WX)
Expand Down
23 changes: 3 additions & 20 deletions ui/CMakeLists.txt
@@ -1,28 +1,11 @@


if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") add_executable(CompositeCefSubprocess ${CEF_SUBPROCESS_SRC_FILES})
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 ${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) target_link_libraries(CompositeCefSubprocess PRIVATE CEF)


source_group(TREE ${CMAKE_SOURCE_DIR} FILES ${CEF_SUBPROCESS_SRC_FILES}) target_include_directories(CompositeCefSubprocess PRIVATE ${CEF_SUBPROCESS_SRC_DIR})

include_directories(${CEF_SUBPROCESS_SRC_DIR})


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

0 comments on commit 11520e3

Please sign in to comment.