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

Fix CMAKE_C_VISIBILITY_PRESET for cmake versions greater than 1.8 (e.g. 3.6.2) #162

Merged
merged 1 commit into from Nov 9, 2016
Merged

Conversation

hughbe
Copy link
Contributor

@hughbe hughbe commented Nov 9, 2016

This lets us build swift-cmark on Windows, using clang-cl

This was an oversight: CMAKE_C_VISIBILITY_PRESET is only available on CMAKE 1.8 or greater. However, the current check doesn't work for a version such as CMAKE 3.6.2, for example.

If this is not added, we get an error: error: unknown argument: '-fvisibility=hidden'

mkdir "C:/Users/hughb/Documents/GitHub/my-swift/build/Ninja-DebugAssert/cmark-windows-amd64"
pushd "C:/Users/hughb/Documents/GitHub/my-swift/build/Ninja-DebugAssert/cmark-windows-amd64"
cmake -G Ninja -DCMAKE_C_COMPILER="C:/Program Files/LLVM/msbuild-bin/cl.exe" -DCMAKE_CXX_COMPILER="C:/Program Files/LLVM/msbuild-bin/cl.exe" -DCMAKE_CXX_FLAGS="-Xclang -std=c++14" "C:/Users/hughb/Documents/GitHub/my-swift/cmark"
popd
cmake --build "C:/Users/hughb/Documents/GitHub/my-swift/build/Ninja-DebugAssert/cmark-windows-amd64/" -- -j6 all

/cc @jgm @kivikakk

…g. 3.6.2)

This lets us build swift-cmark on Windows, using clang-cl

This was an oversight: CMAKE_C_VISIBILITY_PRESET is only available on CMAKE 1.8 or greater. However, the current check doesn't work for a version such as CMAKE 3.6.2, for example

```bash
mkdir "C:/Users/hughb/Documents/GitHub/my-swift/build/Ninja-DebugAssert/cmark-windows-amd64"
pushd "C:/Users/hughb/Documents/GitHub/my-swift/build/Ninja-DebugAssert/cmark-windows-amd64"
cmake -G Ninja -DCMAKE_C_COMPILER="C:/Program Files/LLVM/msbuild-bin/cl.exe" -DCMAKE_CXX_COMPILER="C:/Program Files/LLVM/msbuild-bin/cl.exe" -DCMAKE_CXX_FLAGS="-Xclang -std=c++14" "C:/Users/hughb/Documents/GitHub/my-swift/cmark"
popd
cmake --build "C:/Users/hughb/Documents/GitHub/my-swift/build/Ninja-DebugAssert/cmark-windows-amd64/" -- -j6 all
```
@hughbe hughbe changed the title Fix CMAKE_C_VISIBILITY_PRESET for cmake versions greater than 1.8 (e.… Fix CMAKE_C_VISIBILITY_PRESET for cmake versions greater than 1.8 (e.g. 3.6.2) Nov 9, 2016
@jgm jgm merged commit 9f2c3ba into commonmark:master Nov 9, 2016
@jgm
Copy link
Member

jgm commented Nov 9, 2016

Thanks!

@kainjow
Copy link
Contributor

kainjow commented Nov 9, 2016

Side note: wouldn't it be better to use VERSION_GREATER here? It's available for 2.8.9.

Edit: Actually, if these features require CMake 1.8, then no version check is necessary as the top-level CMakeLists requires 2.8.9 anyways.

@jgm
Copy link
Member

jgm commented Nov 9, 2016

+++ Kevin Wojniak [Nov 09 16 09:24 ]:

Side note: wouldn't it be better to use VERSION_GREATER here? It's
available for [1]2.8.9.

I didn't even know about VERSION_GREATER, but that does
sound right. Feel free to submit a PR!

@hughbe hughbe deleted the patch-2 branch November 9, 2016 19:06
jgm added a commit that referenced this pull request Nov 18, 2016
CyberShadow pushed a commit to CyberShadow/cmark that referenced this pull request Apr 1, 2021
)

Also rename "get" method for tasklist to better match others.
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

Successfully merging this pull request may close these issues.

None yet

3 participants