aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Freilich <sfreilich@google.com>2022-03-08 09:17:55 -0800
committerCopybara-Service <copybara-worker@google.com>2022-03-08 09:18:26 -0800
commit57a5df655002b468581bbc6c35666c78b5b5081e (patch)
treefae61629cec0c3425b4d9b41668c80b4f100e34e
parent07abddf7c78825c801599b3022ed02d42967b8bb (diff)
downloadink-stroke-modeler-57a5df655002b468581bbc6c35666c78b5b5081e.tar.gz
Add MacOS test CI
This requires more care in how header-only libraries are defined, since the Mac version of ar is more finicky about that. PiperOrigin-RevId: 433229538
-rw-r--r--.github/workflows/bazel-test.yaml7
-rw-r--r--.github/workflows/cmake-test.yaml7
-rw-r--r--CMakeLists.txt2
-rw-r--r--cmake/InkBazelEquivalents.cmake7
4 files changed, 18 insertions, 5 deletions
diff --git a/.github/workflows/bazel-test.yaml b/.github/workflows/bazel-test.yaml
index 50550a6..9234190 100644
--- a/.github/workflows/bazel-test.yaml
+++ b/.github/workflows/bazel-test.yaml
@@ -1,10 +1,15 @@
+# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
name: BazelTest
on: [push, workflow_dispatch]
jobs:
bazel_test:
- runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ os: [ubuntu-latest, macos-latest]
+
+ runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
diff --git a/.github/workflows/cmake-test.yaml b/.github/workflows/cmake-test.yaml
index 405a230..a5eeaea 100644
--- a/.github/workflows/cmake-test.yaml
+++ b/.github/workflows/cmake-test.yaml
@@ -1,10 +1,15 @@
+# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
name: CMakeTest
on: [push, workflow_dispatch]
jobs:
cmake_test:
- runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ os: [ubuntu-latest, macos-latest]
+
+ runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 99e79a5..44effab 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-cmake_minimum_required(VERSION 3.15)
+cmake_minimum_required(VERSION 3.19)
Project(InkStrokeModeler VERSION 0.1 LANGUAGES CXX)
enable_testing()
diff --git a/cmake/InkBazelEquivalents.cmake b/cmake/InkBazelEquivalents.cmake
index 8bdc3fb..fa3f03b 100644
--- a/cmake/InkBazelEquivalents.cmake
+++ b/cmake/InkBazelEquivalents.cmake
@@ -20,11 +20,14 @@ function(ink_cc_library)
${ARGN}
)
set(_NAME "ink_stroke_modeler_${INK_CC_LIB_NAME}")
- add_library(${_NAME} ${INK_CC_LIB_SRCS} ${INK_CC_LIB_HDRS})
if(NOT DEFINED INK_CC_LIB_SRCS)
+ add_library(${_NAME} INTERFACE ${INK_CC_LIB_HDRS})
set_target_properties(${_NAME} PROPERTIES LINKER_LANGUAGE CXX)
+ target_link_libraries(${_NAME} INTERFACE ${INK_CC_LIB_DEPS})
+ else()
+ add_library(${_NAME} ${INK_CC_LIB_SRCS} ${INK_CC_LIB_HDRS})
+ target_link_libraries(${_NAME} PUBLIC ${INK_CC_LIB_DEPS})
endif()
- target_link_libraries(${_NAME} PUBLIC ${INK_CC_LIB_DEPS})
add_library(InkStrokeModeler::${INK_CC_LIB_NAME} ALIAS ${_NAME})
endfunction()