Skip to content

Commit

Permalink
Sync with d9d6ca9 (#17)
Browse files Browse the repository at this point in the history
Co-authored-by: Jérémie Dumas <[email protected]>
  • Loading branch information
HasKha and jdumas authored Sep 27, 2023
1 parent f294ce1 commit ab40520
Show file tree
Hide file tree
Showing 63 changed files with 962 additions and 1,250 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/continuous.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
mkdir -p build
cd build
cmake .. \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DLAGRANGE_CACHE_PROGRAM=ccache \
-DCMAKE_BUILD_TYPE=${{ matrix.config }} \
-DLAGRANGE_JENKINS=OFF \
-DUSE_SANITIZER=${{ matrix.sanitizer }}
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64
cmake -G Ninja ^
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^
-DLAGRANGE_CACHE_PROGRAM=sccache ^
-DCMAKE_BUILD_TYPE=${{ matrix.config }} ^
-B build ^
-S .
Expand Down
46 changes: 34 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ else()
endif()

# Check required CMake version
set(REQUIRED_CMAKE_VERSION "3.24.0")
set(REQUIRED_CMAKE_VERSION "3.25.0")
if(LAGRANGE_TOPLEVEL_PROJECT)
cmake_minimum_required(VERSION ${REQUIRED_CMAKE_VERSION})
else()
Expand All @@ -46,14 +46,41 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/LagrangeOptions.cmake)
endif()
endif()

# Enable ccache if available
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
option(LAGRANGE_WITH_CCACHE "Enable ccache when building Lagrange" ${LAGRANGE_TOPLEVEL_PROJECT})
# Set default macOS deployment target
if(LAGRANGE_TOPLEVEL_PROJECT)
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "Minimum OS X deployment version")
endif()

#########################################
# Enable sccache or ccache if available #
#########################################

set(LAGRANGE_CACHE_DESCRIPTION "Cache program to use when building Lagrange (none, ccache or sccache)")

# Set compiler cache default based on available programs
find_program(SCCACHE_PROGRAM sccache)
if(SCCACHE_PROGRAM)
set(LAGRANGE_CACHE_PROGRAM "sccache" CACHE STRING ${LAGRANGE_CACHE_DESCRIPTION})
else()
option(LAGRANGE_WITH_CCACHE "Enable ccache when building Lagrange" OFF)
find_program(CCACHE_PROGRAM ccache)
if(CACHE_PROGRAM)
set(LAGRANGE_CACHE_PROGRAM "ccache" CACHE STRING ${LAGRANGE_CACHE_DESCRIPTION})
else()
set(LAGRANGE_CACHE_PROGRAM "none" CACHE STRING ${LAGRANGE_CACHE_DESCRIPTION})
endif()
endif()
if(LAGRANGE_WITH_CCACHE AND CCACHE_PROGRAM)
set(LAGRANGE_CACHE_CHOICES none ccache sccache)
set_property(CACHE LAGRANGE_CACHE_PROGRAM PROPERTY STRINGS ${LAGRANGE_CACHE_CHOICES})
message(STATUS "Compile cache program: ${LAGRANGE_CACHE_PROGRAM}")

# Now enable compiler cache based on requested option
if(LAGRANGE_CACHE_PROGRAM STREQUAL "sccache")
find_program(SCCACHE_PROGRAM sccache REQUIRED)
set(CMAKE_C_COMPILER_LAUNCHER ${SCCACHE_PROGRAM})
set(CMAKE_CXX_COMPILER_LAUNCHER ${SCCACHE_PROGRAM})
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded)
elseif(LAGRANGE_WITH_CCACHE AND CCACHE_PROGRAM)
find_program(CCACHE_PROGRAM ccache REQUIRED)
set(ccacheEnv
CCACHE_BASEDIR=${CMAKE_BINARY_DIR}
CCACHE_SLOPPINESS=clang_index_store,include_file_ctime,include_file_mtime,locale,pch_defines,time_macros
Expand All @@ -65,11 +92,6 @@ if(LAGRANGE_WITH_CCACHE AND CCACHE_PROGRAM)
endforeach()
endif()

# Set default macOS deployment target
if(LAGRANGE_TOPLEVEL_PROJECT)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
endif()

################################################################################
file(READ "VERSION" lagrange_version)
string(STRIP ${lagrange_version} lagrange_version)
Expand Down
3 changes: 1 addition & 2 deletions LagrangeOptions.cmake.sample
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# set(CMAKE_CXX_COMPILER "/usr/local/opt/llvm/bin/clang++" CACHE STRING "C++ compiler")

# Set deployment platform for macOS
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12 CACHE STRING "macOS deployment target")
# set(CMAKE_OSX_DEPLOYMENT_TARGET 12.0 CACHE STRING "macOS deployment target")

# Always add colored output (e.g. when using Ninja)
# list(APPEND CMAKE_CXX_FLAGS -fdiagnostics-color=always) # GCC
Expand Down Expand Up @@ -72,7 +72,6 @@
# option(LAGRANGE_ENABLE_GPU_TESTS "Enable unit tests that run on the GPU" ON)
# option(LAGRANGE_MORE_WARNINGS "Increase the level of warnings when compiling" OFF)
# option(LAGRANGE_SLOW_TESTS "Enable slow unit tests" ON)
# option(LAGRANGE_UI_USE_MDL "Use Material Definition Library" ON)
# option(LAGRANGE_USE_PCH "Enable precompiled headers" ON)
# option(LAGRANGE_USE_WASM_EXCEPTIONS "Use -fwasm-exception flag with Emscripten" OFF)
# option(LAGRANGE_WITH_ASSIMP "Add assimp functionality to lagrange::io" ON)
Expand Down
8 changes: 8 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ This codebase contains a modified portion of code from CMake Scripts which can b
* LICENSE:
* https://github.com/StableCoder/cmake-scripts/blob/master/LICENSE

-------------------------------------------------------------------------------
This codebase contains a modified portion of code from CPM which can be obtained at:
* SOURCE:
* https://github.com/cpm-cmake/CPM.cmake

* LICENSE:
* https://github.com/cpm-cmake/CPM.cmake/blob/master/LICENSE

-------------------------------------------------------------------------------
This codebase contains a modified portion of code from Earcut which can be obtained at:
* SOURCE:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.14.0
6.15.0
1 change: 0 additions & 1 deletion cmake/lagrange/lagrange_cpm_cache.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#
# Copyright 2021 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
Expand Down
101 changes: 0 additions & 101 deletions cmake/recipes/external/mdl.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion cmake/recipes/external/pcg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ include(CPM)
CPMAddPackage(
NAME pcg
GITHUB_REPOSITORY imneme/pcg-cpp
GIT_TAG 5b5cac8d61339e810c5dbb4692d868a1d7ca1b2d
GIT_TAG 428802d1a5634f96bcd0705fab379ff0113bcf13
)

add_library(pcg::pcg INTERFACE IMPORTED GLOBAL)
Expand Down
28 changes: 2 additions & 26 deletions cmake/recipes/external/tracy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# OF ANY KIND, either express or implied. See the License for the specific language
# governing permissions and limitations under the License.
#
if(TARGET tracy::client)
if(TARGET Tracy::TracyClient)
return()
endif()

Expand All @@ -19,29 +19,5 @@ include(CPM)
CPMAddPackage(
NAME tracy
GITHUB_REPOSITORY wolfpld/tracy
GIT_TAG v0.7.7
GIT_TAG v0.9.1
)

################################################################################
# Client
################################################################################

# Do not forget to add global compilation flags '-fno-omit-frame-pointer' and '-g'!
add_library(tracy_client ${tracy_SOURCE_DIR}/TracyClient.cpp)
add_library(tracy::client ALIAS tracy_client)

include(GNUInstallDirs)
target_include_directories(tracy_client SYSTEM INTERFACE
$<BUILD_INTERFACE:${tracy_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

target_compile_definitions(tracy_client PUBLIC TRACY_ENABLE)

target_compile_features(tracy_client PUBLIC cxx_std_11)
set_target_properties(tracy_client PROPERTIES ENABLE_EXPORTS ON)

# Install rules
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME tracy)
install(TARGETS tracy_client EXPORT Tracy_Targets)
install(EXPORT Tracy_Targets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/tracy NAMESPACE tracy::)
2 changes: 1 addition & 1 deletion cmake/recipes/external/usd.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2021 Adobe. All rights reserved.
# Copyright 2023 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
Expand Down
1 change: 0 additions & 1 deletion docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ list(JOIN DOXYGEN_INCLUDE_PATHS " " DOXYGEN_INCLUDE_PATHS)
set(DOXYGEN_EXCLUDE_FOLDERS
modules/ui/ibls/
modules/ui/shaders/
modules/ui/adobe_mdl/
)
list(JOIN DOXYGEN_EXCLUDE_FOLDERS " " DOXYGEN_EXCLUDE_FOLDERS)

Expand Down
2 changes: 1 addition & 1 deletion modules/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ target_link_libraries(lagrange_core PUBLIC

if(LAGRANGE_WITH_TRACY)
include(tracy)
target_link_libraries(lagrange_core PUBLIC tracy::client)
target_link_libraries(lagrange_core PUBLIC Tracy::TracyClient)
endif()

# precompile headers target. Link to this target in tests or modules with
Expand Down
13 changes: 9 additions & 4 deletions modules/core/include/lagrange/SurfaceMesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,6 @@ class SurfaceMesh
///
/// Shrink buffer capacities to fit current mesh attributes, deallocating any extra capacity.
///
/// @todo Not implemented yet.
///
void shrink_to_fit();

///
Expand All @@ -507,8 +505,6 @@ class SurfaceMesh
/// - "$facet_to_first_corner"
/// - "$corner_to_facet"
///
/// @todo Not implemented yet.
///
void compress_if_regular();

public:
Expand Down Expand Up @@ -2016,6 +2012,15 @@ class SurfaceMesh
///
std::array<Index, 2> get_edge_vertices(Index e) const;

///
/// Retrieve the edge index cooresponding to (v0, v1).
///
/// @param[in] v0, v1 The vertex indices for edge end points.
///
/// @return The edge index if found, otherwise `invalid<Index>()`.
///
Index find_edge_from_vertices(Index v0, Index v1) const;

///
/// Get the index of the first corner around a given edge.
///
Expand Down
2 changes: 1 addition & 1 deletion modules/core/include/lagrange/attributes/attribute_utils.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Adobe. All rights reserved.
* Copyright 2017 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Adobe. All rights reserved.
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Adobe. All rights reserved.
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
Expand Down
2 changes: 1 addition & 1 deletion modules/core/include/lagrange/attributes/map_attributes.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Adobe. All rights reserved.
* Copyright 2019 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Adobe. All rights reserved.
* Copyright 2017 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Adobe. All rights reserved.
* Copyright 2018 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Adobe. All rights reserved.
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Adobe. All rights reserved.
* Copyright 2017 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Adobe. All rights reserved.
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
Expand Down
Loading

0 comments on commit ab40520

Please sign in to comment.