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

cmake fails because of reserved word usage #6257

Closed
Mipsters opened this issue Nov 27, 2020 · 4 comments
Closed

cmake fails because of reserved word usage #6257

Mipsters opened this issue Nov 27, 2020 · 4 comments
Labels

Comments

@Mipsters
Copy link
Contributor

This seems like a problem any use of cmake would uncover, but I didn't see it mentioned anywhere

I did this

cmake ../curl-curl-7_73_0

I expected the following

created build files successfully

curl/libcurl version

7.73.0

[curl -V output]

-- The C compiler identification is GNU 3.3.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- curl version=[7.73.0-DEV]
-- Performing Test OPT_pedantic
-- Performing Test OPT_pedantic - Success
-- Performing Test OPT_Wall
-- Performing Test OPT_Wall - Success
-- Performing Test OPT_W
-- Performing Test OPT_W - Success
-- Performing Test OPT_Wpointer_arith
-- Performing Test OPT_Wpointer_arith - Success
-- Performing Test OPT_Wwrite_strings
-- Performing Test OPT_Wwrite_strings - Success
-- Performing Test OPT_Wunused
-- Performing Test OPT_Wunused - Success

...

-- Check size of struct sockaddr_storage
-- Check size of struct sockaddr_storage - done
-- Performing Test HAVE_POLL_FINE
-- Performing Test HAVE_POLL_FINE - Success
CMake Error at tests/CMakeLists.txt:34 (add_custom_target):
  The target name "test" is reserved or not valid for certain CMake features,
  such as generator expressions, and may result in undefined behavior.
Call Stack (most recent call first):
  tests/CMakeLists.txt:44 (add_runtests)


-- Enabled features: SSL IPv6 unix-sockets libz AsynchDNS NTLM HTTPS-proxy
-- Enabled protocols: DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS MQTT POP3 POP3S RTSP SCP SFTP SMB SMBS SMTP SMTPS TELNET TFTP
-- Enabled SSL backends: OpenSSL
-- Configuring incomplete, errors occurred!

operating system

debian sarge 3.1
cmake: 3.6.3

Linux debian 2.4.27-3-386 #1 Wed Dec 6 00:38:33 UTC 2006 i686 GNU/Linux

my notes

this probably happens because of this line
(I used the 7_73_0 tag version but it's the same in master at the time of writing this bug report)
this stack overflow answer probably has the solution, but I don't know enough cmake to be sure
changing the line in tests/CMakeLists.txt to be

add_runtests(te-st           "")

passed the command successfully

@bagder bagder added the cmake label Nov 27, 2020
@bagder
Copy link
Member

bagder commented Nov 27, 2020

This doesn't happen for me with cmake 3.18.4 and it doesn't fail in the CI builds so I presume this depends on the used cmake version.

@Mipsters
Copy link
Contributor Author

this is odd, I'll try a newer version of cmake and see if it happens there too
but if it has anything to do with cmake version, maybe the minimum cmake version should be updated

@Mipsters
Copy link
Contributor Author

I cannot update the cmake version at the same platform without a lot of effort (building cpp11 compatible compiler from source)
so I can't test this
I can ran more tests on my current setup if that's any help
if not, you can close the issue

@bagder
Copy link
Member

bagder commented Nov 27, 2020

Ideally someone can come up with a fix for all versions.

jzakrzewski added a commit to jzakrzewski/curl that referenced this issue Nov 27, 2020
CMake up to 3.10 always reserves this name

fixes curl#6257
@bagder bagder changed the title cmake command failed because of save word usage cmake fails because of reserved word usage Nov 29, 2020
jzakrzewski added a commit to jzakrzewski/curl that referenced this issue Dec 7, 2020
CMake up to 3.10 always reserves this name

fixes curl#6257
@bagder bagder closed this as completed in cfea4f2 Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants