Are per-source COMPILE_FLAGS lost on non-x86?

Sep 29, 2014 at 6:17 AM
More likely this is a cmake 'user error' bug on our part. What I'm seeing is that per-source-file settings don't seem to be used when generating for x64 or ARM.


cmake version 3.0.20140918

set_property(SOURCE ${CURL_SRC_FILES} APPEND_STRING PROPERTY COMPILE_FLAGS "-DCURL_STATICLIB -DHAVE_CONFIG_H /wd4013 /wd4057 /wd4127 /wd4189 /wd4310 /wd4701")

For Win32, preprocessor defines starts with CURL_STATICLIB and HAVE_CONFIG_H in the VS2013 IDE GUI. For x64 and ARM, they aren't defined. Since there's nothing config or architecture specific about the above line of cmake code, I was expecting those compiler settings to apply to all configs & architectures.


I tried adding this:
set_property(SOURCE ${CURL_SRC_FILES} APPEND_STRING PROPERTY COMPILE_DEFINITIONS "CURL_STATICLIB,HAVE_CONFIG_H")
But then I got them both twice on x86 and still not at all on x64 or ARM.

If I set CMAKE_VS_EFFECTIVE_PLATFORMS to just one config (x64) it still doesn't set the compiler flags.
Coordinator
Sep 29, 2014 at 7:38 AM
Let me take a look,

This is most likely an omission in the multiplatform implementation where we usually take the outputs that are output as conditionals on the configs and make them conditional on both the platforms and the configs.

~Gilles
Coordinator
Sep 29, 2014 at 8:45 AM
Hi Ted,

Found and fixed the issue. We were writing the options for each configuration (that's why you had them twice), but weren't changing the platform.

Can you try the new installer?

Thanks.

~Gilles
Sep 29, 2014 at 11:34 AM
Amazing turnaround time! Now I'm very confused about what time zone you're in.

The latest build solves the issue: cmake version 3.0.20140929

Who are your manager and skip-level? I will pester those I know internally until your contributions are recognized. Seriously, tell me aliases and I will make them aware of you contributions. If you don't tell me, I'll just start pestering people I know who can find you.