On Wednesday, 7 December 2016 05:31:02 CET you wrote:
> There's no problem as the compiler will just use the last flag value.
> See an example at http://coliru.stacked-crooked.com/a/738fff0fcc2eb3c4.

Still, seems very ugly solution. Also doesn't work with multiple different 
flags. Better solution I have found is to create a static library from the 
header in a subdirectory and set CMAKE_CXX_FLAGS for that subdirectory only. 
This seems to be working and looks robust for all test cases I have 
encountered. 

-- 
Cheers
Jayesh Badwaik
https://www.jayeshbadwaik.in

Attachment: signature.asc
Description: This is a digitally signed message part.

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to