mirror of
https://github.com/facebook/sapling.git
synced 2025-01-01 01:25:49 +03:00
14e791a7dc
Summary: - CMake allows the user to add additional compilation options using `CXXFLAGS=<flags>` or `-DCMAKE_CXX_FLAGS=<flags>`. - Eden clobbers these CMAKE_CXX_FLAGS for both debug and release modes which prevents the user from passing additional flags. - Teach Eden to respect user-supplied compiler flags instead of simply overriding them. Pull Request resolved: https://github.com/facebookexperimental/eden/pull/8 Reviewed By: simpkins Differential Revision: D14481846 Pulled By: wez fbshipit-source-id: 4d2034ddb4f9b781dde603a140c4d199eb0ad7d6
34 lines
1.0 KiB
CMake
34 lines
1.0 KiB
CMake
# Copyright (c) 2016-present, Facebook, Inc.
|
|
# All rights reserved.
|
|
#
|
|
# This source code is licensed under the BSD-style license found in the
|
|
# LICENSE file in the root directory of this source tree. An additional grant
|
|
# of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
set(CMAKE_CXX_FLAGS_COMMON "-g -Wall -Wextra -Wno-deprecated -Wno-deprecated-declarations")
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_COMMON}")
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON} -O3")
|
|
|
|
function(apply_eden_compile_options_to_target THETARGET)
|
|
target_compile_options(${THETARGET}
|
|
PUBLIC
|
|
-g
|
|
-finput-charset=UTF-8
|
|
-fsigned-char
|
|
-Werror
|
|
-Wall
|
|
-Wno-deprecated
|
|
-Wno-deprecated-declarations
|
|
-Wno-error=deprecated-declarations
|
|
-Wno-sign-compare
|
|
-Wno-unused
|
|
-Wunused-label
|
|
-Wunused-result
|
|
-Wnon-virtual-dtor
|
|
${FOLLY_CXX_FLAGS}
|
|
PRIVATE
|
|
-D_REENTRANT
|
|
-D_GNU_SOURCE
|
|
)
|
|
endfunction()
|