-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #421 from cse-sim/build-tree
Generalize build tree to support additional platforms/compilers/architectures
- Loading branch information
Showing
77 changed files
with
234 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,31 @@ | ||
name: "Build CSE" | ||
description: "Get git info (for version) and build CSE executable" | ||
inputs: | ||
arch: | ||
description: Target architecture ("32" or "64" bit) | ||
default: "32" | ||
config: | ||
description: Configuration (Release or Debug) | ||
default: Release | ||
compiler: | ||
description: Compiler used for windows builds (clang or msvc) | ||
default: msvc | ||
build_dir: | ||
description: Relative path to the build directory | ||
default: build | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Get branch name | ||
uses: tj-actions/[email protected] | ||
id: branch-name | ||
- name: Install Linux Libraries | ||
if: runner.os == 'Linux' | ||
shell: bash | ||
run: sudo apt-get update && sudo apt-get -y install xorg-dev libgl1-mesa-dev | ||
- name: Save branch name | ||
run: echo "CI_GIT_BRANCH=${{steps.branch-name.outputs.current_branch}}" >> $GITHUB_ENV | ||
shell: bash | ||
- name: Build | ||
shell: cmd | ||
run: build.bat | ||
- name: Build and Configure | ||
shell: bash | ||
run: cmake -DBUILD_ARCHITECTURE=${{ inputs.arch }} -DCOMPILER_ID=${{ inputs.compiler }} -DCONFIGURATION=${{ inputs.config }} -DTARGET_NAME=CSE -DBUILD_DIRECTORY=${{ inputs.build_dir }} -P cmake/configure-and-build.cmake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,6 @@ runs: | |
run: rake | ||
shell: bash | ||
working-directory: doc | ||
env: | ||
CSE_EXE_PATH: ..\\build\\CSE.exe | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
cmake -DCONFIGURATION=Release -P cmake/configure-and-build.cmake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include(cmake/configure.cmake) | ||
include(cmake/build.cmake) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,35 @@ | ||
set(TARGET_VS_ARCHITECTURE Win32) | ||
set(BUILD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/msvc/build) | ||
if ("${BUILD_ARCHITECTURE}" STREQUAL "64") | ||
set(TARGET_VS_ARCHITECTURE x64) | ||
set(BUILD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/msvc/build64) | ||
include(cmake/utility.cmake) | ||
set_build_configuration() | ||
if (NOT DEFINED BUILD_DIRECTORY) | ||
set(BUILDS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/builds") | ||
set(BUILD_DIRECTORY "${BUILDS_DIRECTORY}/${BUILD_CONFIGURATION}") | ||
set(EXECUTABLE_DIRECTORY ${BUILDS_DIRECTORY}) | ||
endif () | ||
|
||
file(MAKE_DIRECTORY ${BUILD_DIRECTORY}) | ||
|
||
set(configure_command ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR} -DCSE_BUILD_ARCHITECTURE=${BUILD_ARCHITECTURE}) | ||
|
||
if (DEFINED EXECUTABLE_DIRECTORY) | ||
set(configure_command ${configure_command} -DCSE_EXECUTABLE_DIRECTORY=${EXECUTABLE_DIRECTORY}) | ||
endif () | ||
|
||
if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") | ||
if (${COMPILER_ID} STREQUAL "msvc") | ||
set(configure_command ${configure_command} -T v142,version=14.29.16.11 -A ${TARGET_VS_ARCHITECTURE} -DCMAKE_SYSTEM_VERSION=10.0.20348.0) | ||
elseif(${COMPILER_ID} STREQUAL "clang") | ||
set(configure_command ${configure_command} -T ClangCL -A ${TARGET_VS_ARCHITECTURE}) | ||
endif () | ||
else() | ||
set(configure_command ${configure_command} -DCMAKE_BUILD_TYPE=${CONFIGURATION}) | ||
endif() | ||
message("Making build directory: ${BUILD_DIR}") | ||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/msvc) | ||
file(MAKE_DIRECTORY ${BUILD_DIR}) | ||
|
||
message("Generating project files...") | ||
execute_process(COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR} -T v142,version=14.29.16.11 -A ${TARGET_VS_ARCHITECTURE} -DCSE_BUILD_ARCHITECTURE=${BUILD_ARCHITECTURE} -DCMAKE_SYSTEM_VERSION=10.0.20348.0 | ||
WORKING_DIRECTORY ${BUILD_DIR} | ||
RESULT_VARIABLE success | ||
execute_process(COMMAND ${configure_command} | ||
WORKING_DIRECTORY ${BUILD_DIRECTORY} | ||
RESULT_VARIABLE success | ||
) | ||
|
||
if (NOT ${success} MATCHES "0") | ||
message(FATAL_ERROR "Generation step failed.") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
macro(set_build_configuration) | ||
if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") | ||
set(OS_ID "win") | ||
if (NOT DEFINED COMPILER_ID) | ||
set(COMPILER_ID "msvc") | ||
endif () | ||
if (NOT DEFINED BUILD_ARCHITECTURE) | ||
set(BUILD_ARCHITECTURE "32") | ||
endif () | ||
if ("${BUILD_ARCHITECTURE}" STREQUAL "64") | ||
set(TARGET_VS_ARCHITECTURE "x64") | ||
else () | ||
set(TARGET_VS_ARCHITECTURE "Win32") | ||
endif () | ||
else () | ||
if (NOT DEFINED CONFIGURATION) | ||
set(CONFIGURATION Release) | ||
endif () | ||
string(TOLOWER "-${CONFIGURATION}" CONFIGURATION_STRING) | ||
if (NOT DEFINED BUILD_ARCHITECTURE) | ||
set(BUILD_ARCHITECTURE "64") | ||
endif () | ||
if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Darwin") | ||
set(OS_ID "macos") | ||
set(COMPILER_ID "appleclang") | ||
elseif ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux") | ||
set(OS_ID "linux") | ||
set(COMPILER_ID "gcc") | ||
endif () | ||
endif () | ||
set(BUILD_CONFIGURATION "${OS_ID}${BUILD_ARCHITECTURE}-${COMPILER_ID}${CONFIGURATION_STRING}") | ||
endmacro() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.