New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LDMD: Append default file extension if -of doesn't contain any #2002
Conversation
Would be good to have tests for this. |
I wanted to make sure all agree on this (not just for LDMD, but for LDC too) before adding the PITA tests. |
Do we not have the ability to do tests for only LDMD? or are you wanting to do this for both and hence waiting? |
the tests should verify this:
|
Of course, e.g., dmd-testsuite uses LDMD exclusively.
This PR does it for both, as it's implemented in LDC, regardless of being invoked via LDMD or not. We could also keep the previous behavior of not tampering with the @bbasile: You missed the DLL output case. |
The corner case is just when a dot is present in the |
Also a question: You seem make the change in a file that's not specific to LDMD. Does the fix only applies to LDMD ? (it should not affect LDC2). |
Don't worry and don't rely on your feelings :], the extension is only added if the filename part doesn't contain a dot (see PR title...). DMD uses the same logic, and |
I already explained 2 posts further up... |
I think LDC should do what other compilers do: no automatic file extension adding. |
Which ones did you check? If gcc and clang don't add anything, I very much agree. |
I checked clang. |
driver/cl_options.cpp
Outdated
@@ -59,6 +59,9 @@ cl::list<std::string> runargs( | |||
"Runs the resulting program, passing the remaining arguments to it"), | |||
cl::Positional, cl::PositionalEatsArgs); | |||
|
|||
cl::opt<bool> ldmd("ldmd", cl::desc("Invoked by LDMD?"), cl::ZeroOrMore, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you rename the ldmd
variable to invokedByLDMD
or something else more descriptive?
https://github.com/ldc-developers/ldc/blob/master/driver/main.cpp#L1031 - shouldn't the default |
bd908b3
to
67454bf
Compare
I'd say let's put this and (adapted) #2021 into 1.2 and then release the first alpha asap. |
@@ -16,8 +16,6 @@ if (LDC_WITH_PGO) | |||
if (NOT (LDC_LLVM_VER GREATER 309)) | |||
set(PROFRT_EXTRA_LDFLAGS "Ws2_32.lib") | |||
endif() | |||
else() | |||
set(PROFRT_EXTRA_FLAGS "-fPIC -O3") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appropriate optimizations (for MSVC too) are already enforced - we rewrite all CMAKE_C_FLAGS_{DEBUG,MINSIZEREL,RELWITHDEBINFO}
with ..._RELEASE in runtime/CMakeLists.txt
(as the C parts of druntime/Phobos are always compiled in release too).
308a81a
to
f16b2a4
Compare
Thus providing a generic way to slightly alter some command-line semantics in DMD compatibility mode.
The POSITION_INDEPENDENT_CODE target property seems to be supported since CMake 2.8.9, and Ubuntu 12.04 uses 2.8.7.
Resolves issue #2001.