Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An omnibus of improvements #131

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
SystemHeaders: false
HeaderFilterRegex: '^(?!.*(boost|_deps)).*$'
FormatStyle: none
17 changes: 1 addition & 16 deletions .github/workflows/adobe_source_libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,35 +47,21 @@ jobs:
rm '/usr/local/bin/python3.12'
rm '/usr/local/bin/python3-config'
rm '/usr/local/bin/python3.12-config'
brew install boost
brew install ninja
shell: bash

- name: Install dependencies (ubuntu)
if: ${{ startsWith(matrix.config.os, 'ubuntu') }}
run: |
sudo apt-get install -y ninja-build
sudo apt-get install -y libboost-all-dev
shell: bash

- name: Install dependencies (Windows)
if: ${{ startsWith(matrix.config.os, 'windows') }}
run: |
choco install --yes ninja
vcpkg install --triplet=x64-windows
shell: cmd

# Keep this around for debugging. If something in the `vcpkg` setup chokes,
# this step can be used to extract `issue_body.md` from the build system
# and its contents pasted into an issue filed against `vcpkg`.
# (for example, https://github.com/microsoft/vcpkg/issues/39518)
# - name: Archive dependency log files (Windows)
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: win-dependency-log-body
# path: D:/a/adobe_source_libraries/adobe_source_libraries/vcpkg_installed/vcpkg/issue_body.md

- name: Set enviroment variables (Linux+GCC)
if: ${{ matrix.config.compiler == 'gcc' }}
shell: bash
Expand Down Expand Up @@ -117,8 +103,7 @@ jobs:
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
mkdir ..\build
cmake -S. -B../build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=${{matrix.config.cxxstd}} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DBOOST_TEST_DYN_LINK=TRUE

cmake -S. -B../build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=${{matrix.config.cxxstd}}
- name: Build (Unix)
if: ${{ startsWith(matrix.config.os, 'ubuntu') || startsWith(matrix.config.os, 'macos') }}
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ gh-pages/
documentation/doxyfile.bak
build_asl/
.vs/
.vscode/
.vscode/settings.json
162 changes: 162 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "(Windows) Launch",
"type": "cppvsdbg",
"request": "launch",
"program": "${command:cmake.launchTargetPath}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "PATH",
"value": "${env:PATH};${command:cmake.launchTargetDirectory}"
}
],
"console": "integratedTerminal",
"windows": {
"type": "cppvsdbg"
}
},
{
"name": "(lldb) Launch",
"type": "lldb",
"request": "launch",
// Resolved by CMake Tools:
"program": "${command:cmake.launchTargetPath}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [
{
// add the directory where our target was built to the PATHs
// it gets resolved by CMake Tools:
"name": "PATH",
"value": "$PATH:${command:cmake.launchTargetDirectory}"
},
{
"name": "OTHER_VALUE",
"value": "Something something"
}
],
"externalConsole": true,
"MIMode": "lldb",
"setupCommands": [
{
"description": "Enable pretty-printing for lldb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"console": "integratedTerminal"
},
{
"name": "(Windows) property_model_eval - minmax",
"type": "cppvsdbg",
"request": "launch",
"program": "${command:cmake.launchTargetPath}",
"args": [
"${workspaceFolder}/test/property_model_eval/minmax.pme"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "PATH",
"value": "${env:PATH};${command:cmake.launchTargetDirectory}"
}
],
"console": "integratedTerminal",
"windows": {
"type": "cppvsdbg"
}
},
{
"name": "(Windows) property_model_eval - default",
"type": "cppvsdbg",
"request": "launch",
"program": "${command:cmake.launchTargetPath}",
"args": [
"${workspaceFolder}/test/property_model_eval/default.pme"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "PATH",
"value": "${env:PATH};${command:cmake.launchTargetDirectory}"
}
],
"console": "integratedTerminal",
"windows": {
"type": "cppvsdbg"
}
},
{
"name": "(Windows) property_model_eval - pm_tut",
"type": "cppvsdbg",
"request": "launch",
"program": "${command:cmake.launchTargetPath}",
"args": [
"${workspaceFolder}/test/property_model_eval/pm_tut.pme"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "PATH",
"value": "${env:PATH};${command:cmake.launchTargetDirectory}"
}
],
"console": "integratedTerminal",
"windows": {
"type": "cppvsdbg"
}
},
{
"name": "property_model_eval - default",
"type": "lldb",
"request": "launch",
"program": "${command:cmake.launchTargetPath}",
"args": [
"${workspaceFolder}/test/property_model_eval/default.pme"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "PATH",
"value": "$PATH:${command:cmake.launchTargetDirectory}"
}
],
"externalConsole": true,
"MIMode": "lldb",
"setupCommands": [
{
"description": "Enable pretty-printing for lldb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"console": "integratedTerminal"
}
],
"compounds": [
{
"name": "Launch (Platform Specific)",
"configurations": [
"(Windows) Launch",
"(lldb) Launch"
]
},
{
"name": "property_model_eval (Platform Specific)",
"configurations": [
"(Windows) property_model_eval - minmax",
"property_model_eval - minmax"
]
}
]
}
68 changes: 19 additions & 49 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
cmake_minimum_required(VERSION 3.29)
include(FindGit)
include(CMakeParseArguments)
include(./cmake/CPM.cmake)
enable_testing()

if(WIN32)
set(CMAKE_OBJECT_PATH_MAX 500)
endif()

project(adobe_source_libraries CXX)

set(CMAKE_CXX_EXTENSIONS OFF)
Expand All @@ -12,67 +17,32 @@ endif(NOT DEFINED CMAKE_CXX_STANDARD)

set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")

set(VCPKG_FEATURE_FLAGS "versions")
project(adobe-source-libraries CXX)

# add_definitions ("-Wall")
# add_definitions ("-Werror")

# There is a big choice this file makes, namely how to include Boost. Build environments
# vary and we're trying to support all of them.

set(root_path ${CMAKE_SOURCE_DIR}/..)

function(setup_dep)
set(options IS_CMAKE)
set(oneValueArgs URL BRANCH TAG NAME)
set(multiValueArgs SUBMODULES)
cmake_parse_arguments(setup_dep "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

if ("${setup_dep_NAME}" STREQUAL "")
get_filename_component(name ${setup_dep_URL} NAME_WE)
else()
set(name ${setup_dep_NAME})
endif()

set(dep_path ${root_path}/${name})

if(NOT IS_DIRECTORY ${dep_path})
message("ASL_INFO: Setting up dep " ${name} " into " ${dep_path})
execute_process(COMMAND ${GIT_EXECUTABLE} clone ${setup_dep_URL} ${name} WORKING_DIRECTORY ${root_path})
CPMAddPackage(
NAME Boost
VERSION 1.87.0
URL https://github.com/boostorg/boost/releases/download/boost-1.87.0/boost-1.87.0-cmake.7z
URL_HASH SHA256=61d61a3f33283bab8f3736745a4e47c37141f07e413986cd05d1f942c69d529a
OPTIONS
"BOOST_ENABLE_CMAKE ON"
"CMAKE_CXX_CLANG_TIDY ;"
)

if("${setup_dep_BRANCH}" STREQUAL "")
message(FATAL_ERROR "ASL_INFO: No branch given for dep " ${name})
endif()

execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${setup_dep_BRANCH} WORKING_DIRECTORY ${dep_path})

foreach(submodule ${setup_dep_SUBMODULES})
message("ASL_INFO: Setting up submodule " ${submodule} " for " ${name})
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init ${submodule} WORKING_DIRECTORY ${dep_path})
endforeach(submodule)
else()
message("ASL_INFO: Found dep " ${name} " into " ${dep_path})
endif()

if (setup_dep_IS_CMAKE)
add_subdirectory(${dep_path} ${CMAKE_BINARY_DIR}/imported/${name})
endif()

endfunction()

function(target_link_boost target)
target_link_libraries(${target} PUBLIC Boost::system)
target_link_libraries(${target} PUBLIC Boost::signals2)
target_link_libraries(${target} PUBLIC Boost::range)
target_link_libraries(${target} PUBLIC Boost::multiprecision)
target_link_libraries(${target} PUBLIC Boost::date_time)
endfunction(target_link_boost)

function(target_link_boost_test target)
target_compile_definitions(${target} PRIVATE BOOST_TEST_DYN_LINK)
target_link_libraries(${target} PRIVATE Boost::unit_test_framework)
target_link_libraries(${target} PRIVATE Boost::program_options)
endfunction(target_link_boost_test)

message("ASL_INFO: Using system boost.")
set(ASL_BOOST_COMPONENTS system unit_test_framework program_options)
find_package(Boost COMPONENTS ${ASL_BOOST_COMPONENTS} REQUIRED)

add_subdirectory(source)
add_subdirectory(test)
Loading
Loading