Skip to content

Commit

Permalink
ARROW-15678: [C++] Add support for -DCMAKE_BUILD_TYPE=MinSizeRel
Browse files Browse the repository at this point in the history
If we build with -DCMAKE_BUILD_TYPE=MinSizeRel, our SIMD related code
may violate the one-definition-rule. See also ARROW-15664 and
https://issues.apache.org/jira/browse/ARROW-15678?focusedCommentId=17613909#comment-17613909
for details.

This change prevents the one-definition-rule violation by forcing
inlining as much as possible.
  • Loading branch information
kou committed Oct 7, 2022
1 parent c29ca51 commit 22cdaf6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cpp/cmake_modules/SetupCxxFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,9 @@ elseif("${CMAKE_BUILD_TYPE}" STREQUAL "PROFILE_GEN")
elseif("${CMAKE_BUILD_TYPE}" STREQUAL "PROFILE_BUILD")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_FLAGS_PROFILE_BUILD}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAGS_PROFILE_BUILD}")
elseif("${CMAKE_BUILD_TYPE}" STREQUAL "MINSIZEREL")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_FLAGS_MINSIZEREL}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAGS_MINSIZEREL}")
else()
message(FATAL_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE}")
endif()
Expand Down
6 changes: 6 additions & 0 deletions dev/tasks/r/github.macos-linux.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ jobs:
autobrew:
name: "install from local source"
runs-on: {{ "${{ matrix.os }}" }}
{% if env is defined %}
env:
{% for key, value in env.items() %}
{{ key }}: "{{ value }}"
{% endfor %}
{% endif %}
strategy:
fail-fast: false
matrix:
Expand Down
8 changes: 7 additions & 1 deletion dev/tasks/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,13 @@ tasks:
ci: github
template: r/github.macos-linux.local.yml

test-r-install-local-minsizerel:
ci: github
template: r/github.macos-linux.local.yml
params:
env:
CMAKE_BUILD_TYPE: MinSizeRel

test-r-devdocs:
ci: github
template: r/github.devdocs.yml
Expand Down Expand Up @@ -1355,7 +1362,6 @@ tasks:
ci: github
template: r/github.linux.offline.build.yml


test-r-rhub-debian-gcc-release-custom-ccache:
ci: azure
template: r/azure.linux.yml
Expand Down

0 comments on commit 22cdaf6

Please sign in to comment.