Skip to content
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

native-maven-plugin:1.0-alpha-7 - Has the treatment of linkerSecondaryOutputExtensions changed recently? #16

Open
minajagi opened this issue Mar 9, 2018 · 1 comment

Comments

@minajagi
Copy link

minajagi commented Mar 9, 2018

Hi,

Can you please let me know if the behaviour of this option linkerSecondaryOutputExtensions has been recently changed in the native-maven-plugin?

Our build script used to look like this earlier(see below) with two profiles and used to populate linkerSecondaryOutput with a particular value based on either Profile A or B.In one case it was empty/blank.

The way this used to work a few months ago was it used to always produce the dll and because of lib would install corresponding artifact.lib into my local repo in the install phase.
In Profile A linkerSecondaryOutput used to be set to pdb so ${linkerSecondaryOutput} used to do the samething for corresponding artifact.pdb file. For Profile B this was empty so there would be no pdb file.

Now it looks like when the >${linkerSecondaryOutput} has value it seems to overwrite the earlier lib config and thus I end up only getting the pdb in the local repo in this case and not the lib (which earlier used to be installed to my local repo no matter what).

I think I know the workaround now i.e.

  1. knockoff the static lib
  2. in the profile B have ${linkerSecondaryOutput} set to just lib and in profile A have ${linkerSecondaryOutput} set to lib,pdb

I would appreciate if anyone here can let me know if this behavior got changed recently as I can then justify these pom changes to my team. Please let me know if you have any questions so I can try explaining the issue better.
Btw, we use Maven 3 and
org.codehaus.mojo
native-maven-plugin
1.0-alpha-7
I don’t quite remember if we have maven 2 earlier. Do you think it changed from maven 2 – maven 3.I doubt as we have not changed the version of the native plugin being used.

Regards,
Chetan
`


B

/O2 /MT /GS

<!—Empty because we don’t generate the pdb in this case-- >

        <profile>
              <id>A</id>
                    <properties>
                          <compilerOptions> /Od /MTd /GS- </compilerOptions>
                          <linkerOptions> /DEBUG</linkerOptions>
                          <linkerSecondaryOutput>pdb</linkerSecondaryOutput>
                    </properties>                 
        </profile>  
  </profiles>       
org.codehaus.mojo native-maven-plugin 1.0-alpha-7 true win32 org.codehaus.mojo.natives.msvc.MSVC2008x86EnvFactory msvc ${basedir} **\*.c
                          </sources>
                    <compilerOutputDirectory>${project.build.directory}/objs/${project.name}</compilerOutputDirectory>
                          <compilerStartOptions>
                                <compilerStartOption> /D JVMINFO_EXPORTS </compilerStartOption>
                          </compilerStartOptions>
                          <compilerEndOptions>
                                <compilerEndOption>${compilerOptions}</compilerEndOption>
                          </compilerEndOptions>
                          <!-- deploy the accompany .lib file as well -->
                          <linkerSecondaryOutputExtensions>lib</linkerSecondaryOutputExtensions> <!—produce the lib file with dll always -- >                     
                    <linkerSecondaryOutputExtensions>${linkerSecondaryOutput}</linkerSecondaryOutputExtensions> <!—produce the pdb file depending on the maven profile in use during build -- >

                          <linkerStartOptions>
                                <linkerStartOption> /INCREMENTAL:NO /DLL   </linkerStartOption>
                                <linkerStartOption>${linkerOptions}</linkerStartOption>
                          </linkerStartOptions>

`

 

@dantran
Copy link
Contributor

dantran commented Apr 25, 2018

you mentioned alpha-7, but alpha-8 was out dec/2013.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants